Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
BFGS_Powell.h
Go to the documentation of this file.
1 /*
2 Copyright 2020 Peter Rakyta, Ph.D.
3 
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 
16 */
17 
18 # ifndef __BFGS_POWELL__H
19 # define __BFGS_POWELL__H
20 
21 #include "grad_descend.h"
22 
26 class BFGS_Powell : public Grad_Descend
27 {
28 protected:
29 
30 
31  // Z @ Z^T = B^-1 approximated Hesse matrix (second derivative of the cost function) (B is the inverse of the Hesse matrix) Eq (1.8) in
32  // M. J. D. Powell: A tolerant algorithm for linearly constrained optimization calculations, Mathematical Programming volume 45, pages 547–566 (1989)
33  // B is not stored, Z is updated during the BFGS formula
35 
36  // Z.T @ g to determine the search direction
38 
39 
40 protected:
41 
45  void Initialize_Zmtx( );
46 
47 
53  void Optimize(Matrix_real& x, double& f);
54 
55 
64  void BFGS_iteration(Matrix_real& x, Matrix_real& g, Matrix_real& x0_search, Matrix_real& g0_search, double& norm_Z);
65 
72  void get_search_direction(Matrix_real& g, Matrix_real& search_direction, double& search_direction__grad_overlap );
73 
74 
75 
76 
77 public:
78 
85  BFGS_Powell(void (* f_pointer) (Matrix_real, void *, double *, Matrix_real&), void* meta_data_in);
86 
87 
91  ~BFGS_Powell();
92 };
93 
94 
95 # endif
A class implementing the BFGS iterations on the.
Definition: grad_descend.h:31
void Initialize_Zmtx()
Initialize the matrix Z to identity.
Definition: BFGS_Powell.cpp:41
BFGS_Powell(void(*f_pointer)(Matrix_real, void *, double *, Matrix_real &), void *meta_data_in)
Constructor of the class.
Definition: BFGS_Powell.cpp:32
~BFGS_Powell()
Destructor of the class.
void Optimize(Matrix_real &x, double &f)
Call this method to start the optimization process.
Definition: BFGS_Powell.cpp:70
void get_search_direction(Matrix_real &g, Matrix_real &search_direction, double &search_direction__grad_overlap)
Method to get the search direction in the next line search.
Matrix_real Zmtx
Definition: BFGS_Powell.h:34
A class implementing the BFGS optimizer based on conjugate gradient direction method of M...
Definition: BFGS_Powell.h:26
Matrix_real Z_T__dot__g
Definition: BFGS_Powell.h:37
void BFGS_iteration(Matrix_real &x, Matrix_real &g, Matrix_real &x0_search, Matrix_real &g0_search, double &norm_Z)
Method implementing the BFGS update of the matrix Z.
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:39