123 Gate(
int qbit_num_in);
161 virtual void apply_to_list( std::vector<Matrix>& inputs,
int parallel );
std::vector< Gate * > parents
list of parent gates to be applied in the circuit prior to this current gate
Gate()
Default constructor of the class.
virtual void parameters_for_calc_one_qubit(double &ThetaOver2, double &Phi, double &Lambda)
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit ...
void add_child(Gate *child)
Call to add a child gate to the current gate.
virtual Matrix get_matrix()
Call to retrieve the operation matrix.
void clear_children()
Call to erase data on children.
int control_qbit
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations...
virtual std::vector< Matrix > apply_derivate_to(Matrix_real ¶meters_mtx_in, Matrix &input, int parallel)
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters...
virtual Gate * clone()
Call to create a clone of the present class.
void set_children(std::vector< Gate *> &children_)
Call to set the children of the current gate.
virtual void set_qbit_num(int qbit_num_in)
Set the number of qubits spanning the matrix of the operation.
int target_qbit
The index of the qubit on which the operation acts (target_qbit >= 0)
void apply_kernel_from_right(Matrix &u3_1qbit, Matrix &input)
Call to apply the gate kernel on the input state or unitary from right (no AVX support) ...
virtual ~Gate()
Destructor of the class.
Header file for a class containing basic methods for setting up the verbosity level.
int matrix_size
The size N of the NxN matrix associated with the operations.
int parameter_start_idx
the index in the parameter array (corrensponding to the encapsulated circuit) where the gate paramete...
A class containing basic methods for setting up the verbosity level.
gate_type type
The type of the operation (see enumeration gate_type)
virtual void apply_from_right(Matrix &input)
Call to apply the gate on the input array/matrix by input*Gate.
gate_type get_type()
Call to get the type of the operation.
Header file of complex array storage array with automatic and thread safe reference counting...
void set_control_qbit(int control_qbit_in)
Call to set the control qubit for the gate operation.
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 ...
std::vector< Gate * > get_parents()
Call to get the parents of the current gate.
int get_parameter_start_idx()
Call to get the starting index of the parameters in the parameter array corresponding to the circuit ...
void add_parent(Gate *parent)
Call to add a parent gate to the current gate.
void set_target_qbit(int target_qbit_in)
Call to set the target qubit for the gate operation.
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 clear_parents()
Call to erase data on parents.
virtual Matrix calc_one_qubit_u3()
Calculate the matrix of the constans gates.
void set_matrix(Matrix input)
Call to set the stored matrix in the operation.
std::vector< Gate * > get_children()
Call to get the children of the current gate.
Class to store data of complex arrays and its properties.
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_target_qbit()
Call to get the index of the target qubit.
void apply_kernel_to(Matrix &u3_1qbit, Matrix &input, bool deriv=false, int parallel=0)
Call to apply the gate kernel on the input state or unitary with optional AVX support.
Base class for the representation of general gate operations.
std::string get_name()
Call to get the name label of the gate.
virtual std::vector< int > get_involved_qubits()
Call to get the qubits involved in the gate operation.
int parameter_num
the number of free parameters of the operation
Header file for commonly used functions and wrappers to CBLAS functions.
virtual void apply_to_list(std::vector< Matrix > &inputs, int parallel)
Call to apply the gate on a list of inputs.
void set_parents(std::vector< Gate *> &parents_)
Call to set the parents of the current gate.
int qbit_num
number of qubits spanning the matrix of the operation
int get_qbit_num()
Call to get the number of qubits composing the unitary.
gate_type
Type definition of operation types (also generalized for decomposition classes derived from the class...
virtual void apply_to(Matrix &input, int parallel)
Call to apply the gate on the input array/matrix.
virtual void reorder_qubits(std::vector< int > qbit_list)
Call to reorder the qubits in the matrix of the operation.
Matrix matrix_alloc
Matrix of the operation.
int get_control_qbit()
Call to get the index of the control qubit.
Class to store data of complex arrays and its properties.