54 Adaptive::Adaptive(
int qbit_num_in,
int target_qbit_in,
int control_qbit_in) :
CRY(qbit_num_in, target_qbit_in, control_qbit_in) {
74 Adaptive::Adaptive(
int qbit_num_in,
int target_qbit_in,
int control_qbit_in,
int limit_in) :
CRY(qbit_num_in, target_qbit_in, control_qbit_in) {
107 std::string err(
"Adaptive::apply_to: Wrong input size in Adaptive gate apply.");
111 double Phi = parameters[0];
117 Phi_transformed[0] =
Phi;
146 std::stringstream sstream;
147 sstream <<
"Wrong matrix size in Adaptive apply_from_right" << std::endl;
152 double Phi = parameters[0];
158 Phi_transformed[0] =
Phi;
182 std::stringstream sstream;
183 sstream <<
"Wrong matrix size in Adaptive gate apply" << std::endl;
188 double Phi = parameters[0];
194 Phi_transformed[0] =
Phi;
241 std::string err(
"Adaptive::extract_parameters: Cant extract parameters, since the dinput arary has not enough elements.");
249 return extracted_parameters;
std::vector< Gate * > parents
list of parent gates to be applied in the circuit prior to this current gate
std::vector< Matrix > apply_derivate_to(Matrix_real ¶meters, Matrix &input, int parallel)
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters...
void print(const std::stringstream &sstream, int verbose_level=1) const
Call to print output messages in the function of the verbosity level.
void set_limit(int limit_in)
???????????
int control_qbit
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations...
void set_children(std::vector< Gate *> &children_)
Call to set the children of the current gate.
void apply_from_right(Matrix_real ¶meters, Matrix &input)
Call to apply the gate on the input array/matrix by input*U3.
virtual void apply_to(Matrix_real ¶meters, Matrix &input, int parallel)
Call to apply the gate on the input array/matrix by CRY*input.
int target_qbit
The index of the qubit on which the operation acts (target_qbit >= 0)
int matrix_size
The size N of the NxN matrix associated with the operations.
Adaptive * clone()
Call to create a clone of the present class.
gate_type type
The type of the operation (see enumeration gate_type)
A class representing a CRY gate.
int rows
The number of rows.
int cols
The number of columns.
virtual Matrix_real extract_parameters(Matrix_real ¶meters)
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate i...
void set_parameter_start_idx(int start_idx)
Call to set the starting index of the parameters in the parameter array corresponding to the circuit ...
int get_parameter_start_idx()
Call to get the starting index of the parameters in the parameter array corresponding to the circuit ...
virtual void apply_from_right(Matrix_real ¶meters, Matrix &input)
Call to apply the gate on the input array/matrix by input*CRY.
~Adaptive()
Destructor of the class.
Class to store data of complex arrays and its properties.
Header file for a class representing a gate used in adaptive decomposition.
int size() const
Call to get the number of the allocated elements.
int get_parameter_num()
Call to get the number of free parameters.
std::string name
A string labeling the gate operation.
std::vector< Gate * > children
list of child gates to be applied after this current gate
int get_limit()
???????????
virtual std::vector< Matrix > apply_derivate_to(Matrix_real ¶meters, Matrix &input, int parallel)
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters...
Header file for commonly used functions and wrappers to CBLAS functions.
void set_parents(std::vector< Gate *> &parents_)
Call to set the parents of the current gate.
double activation_function(double Phi, int limit)
?????
A class representing a CRY gate.
virtual void apply_to(Matrix_real ¶meters, Matrix &input, int parallel)
Call to apply the gate on the input array/matrix.
int qbit_num
number of qubits spanning the matrix of the operation
Class to store data of complex arrays and its properties.
Adaptive()
Nullary constructor of the class.