Quantum Gate Decomposer
v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
|
Function operator class to calculate the gradient components of the cost function in parallel. More...
#include <Functor_Cost_Function_Gradient.h>
Public Member Functions | |
functor_grad (const gsl_vector *parameters_in, decomp_class *instance_in, gsl_vector *f_in, double *f0_in, double dparam_in) | |
Constructor of the class. More... | |
void | operator() (int i) const |
Operator to calculate a gradient component of a cost function labeled by index i. More... | |
Protected Attributes | |
double | dparam |
the difference in one direction in the parameter for the gradient calculaiton More... | |
gsl_vector * | f |
A GNU Scientific Library vector containing the calculated values of the cost function at displaced points x = x0+dparam. More... | |
double * | f0 |
The value of the cost function at parameters_in. More... | |
decomp_class * | instance |
A pointer pointing to the instance of a class Sub_Matrix_Decomposition. More... | |
const gsl_vector * | parameters |
A GNU Scientific Library vector containing the free parameters to be optimized. More... | |
Function operator class to calculate the gradient components of the cost function in parallel.
Definition at line 34 of file Functor_Cost_Function_Gradient.h.
functor_grad< decomp_class >::functor_grad | ( | const gsl_vector * | parameters_in, |
decomp_class * | instance_in, | ||
gsl_vector * | f_in, | ||
double * | f0_in, | ||
double | dparam_in | ||
) |
Constructor of the class.
parameters_in | A GNU Scientific Library vector containing the free parameters to be optimized. |
instance_in | A pointer pointing to the instance of a class Sub_Matrix_Decomposition. |
grad_in | A GNU Scientific Library vector containing the calculated gradient components. |
f0_in | The value of the cost function at parameters_in. |
parameters_in | A GNU Scientific Library vector containing the free parameters to be optimized. |
instance_in | A pointer pointing to the instance of a class Sub_Matrix_Decomposition. |
f_in | A GNU Scientific Library vector to store the calculated function values at the displaced points x. |
f0_in | The value of the cost function at parameters_in. |
Definition at line 142 of file Functor_Cost_Function_Gradient.cpp.
void functor_grad< decomp_class >::operator() | ( | int | i | ) | const |
Operator to calculate a gradient component of a cost function labeled by index i.
i | The index labeling the component of the gradien to be calculated. |
i | The index labeling the component of the gradient to be calculated. |
Definition at line 160 of file Functor_Cost_Function_Gradient.cpp.
|
protected |
the difference in one direction in the parameter for the gradient calculaiton
Definition at line 47 of file Functor_Cost_Function_Gradient.h.
|
protected |
A GNU Scientific Library vector containing the calculated values of the cost function at displaced points x = x0+dparam.
Definition at line 43 of file Functor_Cost_Function_Gradient.h.
|
protected |
The value of the cost function at parameters_in.
Definition at line 45 of file Functor_Cost_Function_Gradient.h.
|
protected |
A pointer pointing to the instance of a class Sub_Matrix_Decomposition.
Definition at line 41 of file Functor_Cost_Function_Gradient.h.
|
protected |
A GNU Scientific Library vector containing the free parameters to be optimized.
Definition at line 39 of file Functor_Cost_Function_Gradient.h.