Sequential Quantum Gate Decomposer  v1.8.8
Powerful decomposition of general unitarias into one- and two-qubit gates gates
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
Decomposition_Base Class Reference

A class containing basic methods for the decomposition process. More...

#include <Decomposition_Base.h>

Inheritance diagram for Decomposition_Base:
Inheritance graph
[legend]

Public Member Functions

void add_adaptive (int target_qbit, int control_qbit)
 Add a Adaptive gate to the front of the list of gates. More...
 
void add_adaptive_to_end (int target_qbit, int control_qbit)
 Append a Adaptive gate to the list of gates. More...
 
void add_ch (int target_qbit, int control_qbit)
 Add a CH gate (i.e. More...
 
void add_ch_to_end (int target_qbit, int control_qbit)
 Append a CH gate (i.e. More...
 
void add_cnot (int target_qbit, int control_qbit)
 Add a C_NOT gate gate to the front of the list of gates. More...
 
void add_cnot_to_end (int target_qbit, int control_qbit)
 Append a CNOT gate gate to the list of gates. More...
 
void add_composite ()
 Add a Composite gate to the front of the list of gates. More...
 
void add_composite_to_end ()
 Append a Composite gate to the list of gates. More...
 
void add_cry (int target_qbit, int control_qbit)
 Add a CRY gate to the front of the list of gates. More...
 
void add_cry_to_end (int target_qbit, int control_qbit)
 Append a CRY gate to the list of gates. More...
 
void add_cz (int target_qbit, int control_qbit)
 Add a CZ gate gate to the front of the list of gates. More...
 
void add_cz_to_end (int target_qbit, int control_qbit)
 Append a CZ gate gate to the list of gates. More...
 
void add_gate (Gate *gate)
 Add an gate to the front of the list of gates. More...
 
void add_gate_to_end (Gate *gate)
 Append a general gate to the list of gates. More...
 
void add_gates (std::vector< Gate *> gates_in)
 Add an array of gates to the front of the list of gates. More...
 
void add_gates_to_end (std::vector< Gate *> gates_in)
 Append a list of gates to the list of gates. More...
 
void add_on ()
 Add a OUN gate to the front of the list of gates. More...
 
void add_on_to_end ()
 Append a ON gate to the list of gates. More...
 
void add_rx (int target_qbit)
 Add a RX gate to the front of the list of gates. More...
 
void add_rx_to_end (int target_qbit)
 Append a RX gate to the list of gates. More...
 
void add_ry (int target_qbit)
 Add a RY gate to the front of the list of gates. More...
 
void add_ry_to_end (int target_qbit)
 Append a RY gate to the list of gates. More...
 
void add_rz (int target_qbit)
 Add a RZ gate to the front of the list of gates. More...
 
void add_rz_p (int target_qbit)
 Add a RZ_P gate to the front of the list of gates. More...
 
void add_rz_p_to_end (int target_qbit)
 Append a RZ_P gate to the list of gates. More...
 
void add_rz_to_end (int target_qbit)
 Append a RZ gate to the list of gates. More...
 
void add_sx (int target_qbit)
 Add a SX gate to the front of the list of gates. More...
 
void add_sx_to_end (int target_qbit)
 Append a SX gate to the list of gates. More...
 
void add_syc (int target_qbit, int control_qbit)
 Add a Sycamore gate (i.e. More...
 
void add_syc_to_end (int target_qbit, int control_qbit)
 Append a Sycamore gate (i.e. More...
 
void add_u3 (int target_qbit, bool Theta, bool Phi, bool Lambda)
 Add a U3 gate to the front of the list of gates. More...
 
void add_u3_to_end (int target_qbit, bool Theta, bool Phi, bool Lambda)
 Append a U3 gate to the list of gates. More...
 
void add_un ()
 Add a UN gate to the front of the list of gates. More...
 
void add_un_to_end ()
 Append a UN gate to the list of gates. More...
 
void add_x (int target_qbit)
 Add a X gate to the front of the list of gates. More...
 
void add_x_to_end (int target_qbit)
 Append a X gate to the list of gates. More...
 
void add_y (int target_qbit)
 Add a Y gate to the front of the list of gates. More...
 
void add_y_to_end (int target_qbit)
 Append a Y gate to the list of gates. More...
 
void add_z (int target_qbit)
 Add a Z gate to the front of the list of gates. More...
 
void add_z_to_end (int target_qbit)
 Append a Z gate to the list of gates. More...
 
virtual std::vector< Matrixapply_derivate_to (Matrix_real &parameters_mtx, Matrix &input)
 Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters. More...
 
virtual void apply_from_right (Matrix &input)
 Call to apply the gate on the input array/matrix by input*Gate. More...
 
virtual void apply_from_right (Matrix_real &parameters_mtx, Matrix &input)
 Call to apply the gate on the input array/matrix by input*CNOT. More...
 
Matrix apply_gate (Matrix &gate_mtx, Matrix &input_matrix)
 Apply an gates on the input matrix. More...
 
void apply_global_phase_factor (QGD_Complex16 global_phase_factor, Matrix &u3_gate)
 Call to apply the global phase to a matrix. More...
 
void apply_global_phase_factor ()
 Call to apply the current global phase to the unitary matrix. More...
 
virtual void apply_to (Matrix &input, bool parallel=false)
 Call to apply the gate on the input array/matrix. More...
 
virtual void apply_to (Matrix_real &parameters_mtx, Matrix &input, bool parallel=false)
 Call to apply the gate on the input array/matrix Gates_block*input. More...
 
void apply_to_list (std::vector< Matrix > &input)
 Call to apply the gate on the input array/matrix by U3*input. More...
 
void apply_to_list (Matrix_real &parameters, std::vector< Matrix > input)
 Call to apply the gate on the input array/matrix by U3*input. More...
 
Matrix calc_one_qubit_u3 (double Theta, double Phi, double Lambda)
 Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space. More...
 
virtual Matrix calc_one_qubit_u3 ()
 Calculate the matrix of the constans gates. More...
 
void calculate_new_global_phase_factor (QGD_Complex16 global_phase_factor_new)
 Calculate the new global phase of the Unitary matrix after removing a trivial U3 matrix. More...
 
bool check_optimization_solution ()
 check_optimization_solution More...
 
virtual Gates_blockclone ()
 Create a clone of the present class. More...
 
void combine (Gates_block *op_block)
 Call to append the gates of an gate block to the current block. More...
 
bool contains_adaptive_gate ()
 Call to determine, whether the circuit contains daptive gate or not. More...
 
bool contains_adaptive_gate (int idx)
 Call to determine, whether the sub-circuit at a given position in the circuit contains daptive gate or not. More...
 
 Decomposition_Base ()
 Nullary constructor of the class. More...
 
 Decomposition_Base (Matrix Umtx_in, int qbit_num_in, std::map< std::string, Config_Element > &config_in, guess_type initial_guess_in)
 Contructor of the class. More...
 
void export_unitary (std::string &filename)
 exports unitary matrix to binary file More...
 
int extract_gates (Gates_block *op_block)
 Call to extract the gates stored in the class. More...
 
void finalize_decomposition ()
 After the main optimization problem is solved, the indepent qubits can be rotated into state |0> by this def. More...
 
void fragment_circuit ()
 
int get_control_qbit ()
 Call to get the index of the control qubit. More...
 
double get_current_minimum ()
 Call to get the obtained minimum of the cost function. More...
 
Matrix get_decomposed_matrix ()
 Calculate the decomposed matrix resulted by the effect of the optimized gates on the unitary Umtx. More...
 
double get_decomposition_error ()
 Call to get the error of the decomposition. More...
 
Matrix get_finalizing_gates (Matrix &mtx, Gates_block *finalizing_gates, double *finalizing_parameters)
 This method determine the gates needed to rotate the indepent qubits into the state |0> More...
 
Gateget_gate (int n)
 Call to prepare the optimized gates to export. More...
 
int get_gate_num ()
 Call to get the number of gates grouped in the class. More...
 
gates_num get_gate_nums ()
 Call to get the number of the individual gate types in the list of gates. More...
 
std::vector< Matrix, tbb::cache_aligned_allocator< Matrix > > get_gate_products (double *parameters, std::vector< Gate *>::iterator gates_it, int num_of_gates)
 Calculate the list of gate gate matrices such that the i>0-th element in the result list is the product of the gates of all 0<=n<i gates from the input list and the 0th element in the result list is the identity. More...
 
std::vector< Gate * > get_gates ()
 Call to get the gates stored in the class. More...
 
QGD_Complex16 get_global_phase_factor ()
 Get the global phase of the Unitary matrix. More...
 
std::vector< intget_involved_qubits ()
 Call to get the qubits involved in the gates stored in the block of gates. More...
 
Matrix get_matrix ()
 Call to retrieve the operation matrix. More...
 
Matrix get_matrix (Matrix_real &parameters)
 Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block) More...
 
Matrix get_matrix (Matrix_real &parameters, bool parallel)
 Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block) More...
 
Matrix_real get_optimized_parameters ()
 Call to get the optimized parameters. More...
 
void get_optimized_parameters (double *ret)
 Call to get the optimized parameters. More...
 
void get_parameter_max (Matrix_real &range_max)
 
int get_parameter_num ()
 Call to get the number of free parameters. More...
 
std::string get_project_name ()
 Call to get the current name of the project. More...
 
int get_qbit_num ()
 Call to get the number of qubits composing the unitary. More...
 
Matrix get_reduced_density_matrix (Matrix_real &parameters_mtx, Matrix &input_state, matrix_base< int > &qbit_list_subset)
 Call to evaluate the reduced densiy matrix. More...
 
double get_second_Renyi_entropy (Matrix_real &parameters_mtx, Matrix &input_state, matrix_base< int > &qbit_list)
 Call to evaluate the seconf Rényi entropy. More...
 
int get_target_qbit ()
 Call to get the index of the target qubit. More...
 
Matrix get_transformed_matrix (Matrix_real &parameters, std::vector< Gate *>::iterator gates_it, int num_of_gates)
 Calculate the transformed matrix resulting by an array of gates on the matrix Umtx. More...
 
Matrix get_transformed_matrix (Matrix_real &parameters, std::vector< Gate *>::iterator gates_it, int num_of_gates, Matrix &initial_matrix)
 Calculate the transformed matrix resulting by an array of gates on a given initial matrix. More...
 
gate_type get_type ()
 Call to get the type of the operation. More...
 
Matrix get_Umtx ()
 Call to retrive a pointer to the unitary to be transformed. More...
 
int get_Umtx_size ()
 Call to get the size of the unitary to be transformed. More...
 
Matrix import_unitary_from_binary (std::string &filename)
 Import a Unitary matrix from a file. More...
 
void insert_gate (Gate *gate, int idx)
 Call to insert a gate at a given position. More...
 
void list_gates (int start_index)
 Call to print the gates decomposing the initial unitary. More...
 
void list_gates (const Matrix_real &parameters, int start_index)
 Call to print the list of gates stored in the block of gates for a specific set of parameters. More...
 
virtual double optimization_problem (const double *parameters)
 This is an abstact definition of function giving the cost functions measuring the entaglement of the qubits. More...
 
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 space. More...
 
void prepare_gates_to_export ()
 Call to prepare the optimized gates to export. More...
 
std::vector< Gate * > prepare_gates_to_export (std::vector< Gate *> ops, double *parameters)
 Call to prepare the optimized gates to export. More...
 
std::vector< Gate * > prepare_gates_to_export (Gates_block *block_op, double *parameters)
 Call to prepare the gates of an gate block to export. More...
 
void print (const std::stringstream &sstream, int verbose_level=1) const
 Call to print output messages in the function of the verbosity level. More...
 
void release_gate (int idx)
 Call to release one gate in the list. More...
 
void release_gates ()
 Call to release the stored gates. More...
 
void reorder_qubits (std::vector< int > qbit_list)
 Call to reorder the qubits in the matrix of the gate. More...
 
void set_control_qbit (int control_qbit_in)
 Call to set the control qubit for the gate operation. More...
 
void set_convergence_threshold (double convergence_threshold_in)
 Call to set the threshold of convergence in the optimization processes. More...
 
void set_debugfile (std::string debugfile)
 Call to set the debugfile name. More...
 
void set_global_phase (double new_global_phase)
 Call to set global phase. More...
 
int set_iteration_loops (int n, int iteration_loops_in)
 Set the number of iteration loops during the subdecomposition of the n-th qubit. More...
 
int set_iteration_loops (std::map< int, int > iteration_loops_in)
 Set the number of iteration loops during the subdecomposition of the qbit-th qubit. More...
 
void set_matrix (Matrix input)
 Call to set the stored matrix in the operation. More...
 
void set_max_iteration (int max_outer_iterations_in)
 Call to set the maximal number of the iterations in the optimization process. More...
 
int set_max_layer_num (int n, int max_layer_num_in)
 Set the maximal number of layers used in the subdecomposition of the n-th qubit. More...
 
int set_max_layer_num (std::map< int, int > max_layer_num_in)
 Set the maximal number of layers used in the subdecomposition of the n-th qubit. More...
 
void set_optimization_blocks (int optimization_block_in)
 Call to set the number of gate blocks to be optimized in one shot. More...
 
void set_optimization_tolerance (double tolerance_in)
 Call to set the tolerance of the optimization processes. More...
 
void set_optimized_parameters (double *parameters, int num_of_parameters)
 Call to set the optimized parameters for initial optimization. More...
 
void set_project_name (std::string &project_name_new)
 Call to set the name of the project. More...
 
void set_qbit_num (int qbit_num_in)
 Set the number of qubits spanning the matrix of the gates stored in the block of gates. More...
 
void set_target_qbit (int target_qbit_in)
 Call to set the target qubit for the gate operation. More...
 
void set_verbose (int verbose_in)
 Call to set the verbose attribute. More...
 
virtual void solve_layer_optimization_problem (int num_of_parameters, Matrix_real solution_guess_gsl)
 Abstarct function to be used to solve a single sub-layer optimization problem. More...
 
void solve_optimization_problem (double *solution_guess, int solution_guess_num)
 This method can be used to solve the main optimization problem which is devidid into sub-layer optimization processes. More...
 
virtual ~Decomposition_Base ()
 Destructor of the class. More...
 

Static Public Member Functions

static void Init_max_layer_num ()
 Initializes default layer numbers. More...
 

Public Attributes

std::map< std::string, Config_Elementconfig
 config metadata utilized during the optimization More...
 
bool debug
 Logical variable. Set true to write output messages to the 'debug.txt' file. More...
 
std::string debugfile_name
 String variable. Set the debug file name. More...
 
QGD_Complex16 global_phase_factor
 The global phase. More...
 
int optimization_block
 number of gate blocks used in one shot of the optimization process More...
 
double optimization_tolerance
 The maximal allowed error of the optimization problem (The error of the decomposition would scale with the square root of this value) More...
 
std::string project_name
 the name of the project More...
 
int verbose
 Set the verbosity level of the output messages. More...
 

Static Public Attributes

static std::map< int, intmax_layer_num_def
 A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process by default for the subdecomposing of the nth qubits. More...
 

Protected Member Functions

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) More...
 
void apply_kernel_to (Matrix &u3_1qbit, Matrix &input, bool deriv=false, bool parallel=false)
 Call to apply the gate kernel on the input state or unitary with optional AVX support. More...
 

Protected Attributes

std::vector< intblock_end
 
std::vector< intblock_type
 
int control_qbit
 The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations. More...
 
double convergence_threshold
 The convergence threshold in the optimization process. More...
 
double current_minimum
 The current minimum of the optimization problem. More...
 
double decomposition_error
 error of the final decomposition More...
 
bool decomposition_finalized
 The optimized parameters for the gates. More...
 
int finalizing_gates_num
 number of finalizing (deterministic) opertaions rotating the disentangled qubits into state |0>. More...
 
int finalizing_parameter_num
 the number of the finalizing (deterministic) parameters of gates rotating the disentangled qubits into state |0>. More...
 
int fragmentation_type
 
bool fragmented
 boolean variable indicating whether the circuit was already partitioned or not More...
 
std::vector< Gate * > gates
 The list of stored gates. More...
 
std::mt19937 gen
 Standard mersenne_twister_engine seeded with rd() More...
 
double global_target_minimum
 The global target minimum of the optimization problem. More...
 
guess_type initial_guess
 type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2 More...
 
std::vector< std::vector< int > > involved_qbits
 
std::map< int, intiteration_loops
 A map of <int n: int num> indicating the number of iteration in each step of the decomposition. More...
 
int layer_num
 number of gate layers More...
 
int matrix_size
 The size N of the NxN matrix associated with the operations. More...
 
int max_fusion
 maximal number of qubits in partitions More...
 
std::map< int, intmax_layer_num
 A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process for the subdecomposing of the nth qubits. More...
 
int max_outer_iterations
 Maximal number of iterations allowed in the optimization process. More...
 
int num_threads
 Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.) More...
 
bool optimization_problem_solved
 logical value describing whether the optimization problem was solved or not More...
 
Matrix_real optimized_parameters_mtx
 The optimized parameters for the gates. More...
 
int parameter_num
 the number of free parameters of the operation More...
 
int qbit_num
 number of qubits spanning the matrix of the operation More...
 
int target_qbit
 The index of the qubit on which the operation acts (target_qbit >= 0) More...
 
gate_type type
 The type of the operation (see enumeration gate_type) More...
 
Matrix Umtx
 The unitary to be decomposed. More...
 

Detailed Description

A class containing basic methods for the decomposition process.

Definition at line 83 of file Decomposition_Base.h.

Constructor & Destructor Documentation

◆ Decomposition_Base() [1/2]

Decomposition_Base::Decomposition_Base ( )

Nullary constructor of the class.

Returns
An instance of the class

Definition at line 32 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ Decomposition_Base() [2/2]

Decomposition_Base::Decomposition_Base ( Matrix  Umtx_in,
int  qbit_num_in,
std::map< std::string, Config_Element > &  config_in,
guess_type  initial_guess_in = CLOSE_TO_ZERO 
)

Contructor of the class.

Constructor of the class.

Parameters
Umtx_inThe unitary matrix to be decomposed
qbit_num_inThe number of qubits spanning the unitary to be decomposed.
initial_guess_inType to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2
Returns
An instance of the class

Definition at line 114 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ ~Decomposition_Base()

Decomposition_Base::~Decomposition_Base ( )
virtual

Destructor of the class.

Definition at line 202 of file Decomposition_Base.cpp.

Member Function Documentation

◆ add_adaptive()

void Gates_block::add_adaptive ( int  target_qbit,
int  control_qbit 
)
inherited

Add a Adaptive gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1531 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_adaptive_to_end()

void Gates_block::add_adaptive_to_end ( int  target_qbit,
int  control_qbit 
)
inherited

Append a Adaptive gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1516 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_ch()

void Gates_block::add_ch ( int  target_qbit,
int  control_qbit 
)
inherited

Add a CH gate (i.e.

controlled Hadamard gate) gate to the front of the list of gates

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

controlled Hadamard gate) operation to the front of the list of gates

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1394 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_ch_to_end()

void Gates_block::add_ch_to_end ( int  target_qbit,
int  control_qbit 
)
inherited

Append a CH gate (i.e.

controlled Hadamard gate) gate to the list of gates

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

controlled Hadamard gate) operation to the list of gates

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1377 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_cnot()

void Gates_block::add_cnot ( int  target_qbit,
int  control_qbit 
)
inherited

Add a C_NOT gate gate to the front of the list of gates.

Add a C_NOT gate operation to the front of the list of gates.

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1172 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_cnot_to_end()

void Gates_block::add_cnot_to_end ( int  target_qbit,
int  control_qbit 
)
inherited

Append a CNOT gate gate to the list of gates.

Append a C_NOT gate operation to the list of gates.

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1155 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_composite()

void Gates_block::add_composite ( )
inherited

Add a Composite gate to the front of the list of gates.

Definition at line 1499 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_composite_to_end()

void Gates_block::add_composite_to_end ( )
inherited

Append a Composite gate to the list of gates.

Definition at line 1487 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_cry()

void Gates_block::add_cry ( int  target_qbit,
int  control_qbit 
)
inherited

Add a CRY gate to the front of the list of gates.

Add a RY gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1080 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_cry_to_end()

void Gates_block::add_cry_to_end ( int  target_qbit,
int  control_qbit 
)
inherited

Append a CRY gate to the list of gates.

Append a RY gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1064 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_cz()

void Gates_block::add_cz ( int  target_qbit,
int  control_qbit 
)
inherited

Add a CZ gate gate to the front of the list of gates.

Add a CZ gate operation to the front of the list of gates.

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1207 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_cz_to_end()

void Gates_block::add_cz_to_end ( int  target_qbit,
int  control_qbit 
)
inherited

Append a CZ gate gate to the list of gates.

Append a CZ gate operation to the list of gates.

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1190 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_gate()

void Gates_block::add_gate ( Gate gate)
inherited

Add an gate to the front of the list of gates.

Add a gate to the front of the list of gates.

Parameters
gateA pointer to a class Gate describing an gate.
gateA pointer to a class Gate describing a gate.

Definition at line 1569 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_gate_to_end()

void Gates_block::add_gate_to_end ( Gate gate)
inherited

Append a general gate to the list of gates.

Parameters
gateA pointer to a class Gate describing an gate.
gateA pointer to a class Gate describing a gate operation.

Definition at line 1547 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_gates()

void Gates_block::add_gates ( std::vector< Gate *>  gates_in)
inherited

Add an array of gates to the front of the list of gates.

Parameters
gates_inA list of gate class instances.
gates_inA list of operation class instances.

Definition at line 1421 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_gates_to_end()

void Gates_block::add_gates_to_end ( std::vector< Gate *>  gates_in)
inherited

Append a list of gates to the list of gates.

Parameters
gates_inA list of gate class instances.
gates_inA list of operation class instances.

Definition at line 1408 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_on()

void Gates_block::add_on ( )
inherited

Add a OUN gate to the front of the list of gates.

Add a ON gate to the front of the list of gates.

Definition at line 1473 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_on_to_end()

void Gates_block::add_on_to_end ( )
inherited

Append a ON gate to the list of gates.

Definition at line 1461 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_rx()

void Gates_block::add_rx ( int  target_qbit)
inherited

Add a RX gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1016 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_rx_to_end()

void Gates_block::add_rx_to_end ( int  target_qbit)
inherited

Append a RX gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1003 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_ry()

void Gates_block::add_ry ( int  target_qbit)
inherited

Add a RY gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1046 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_ry_to_end()

void Gates_block::add_ry_to_end ( int  target_qbit)
inherited

Append a RY gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1032 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_rz()

void Gates_block::add_rz ( int  target_qbit)
inherited

Add a RZ gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1109 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_rz_p()

void Gates_block::add_rz_p ( int  target_qbit)
inherited

Add a RZ_P gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1138 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_rz_p_to_end()

void Gates_block::add_rz_p_to_end ( int  target_qbit)
inherited

Append a RZ_P gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1125 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_rz_to_end()

void Gates_block::add_rz_to_end ( int  target_qbit)
inherited

Append a RZ gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1096 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_sx()

void Gates_block::add_sx ( int  target_qbit)
inherited

Add a SX gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1323 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_sx_to_end()

void Gates_block::add_sx_to_end ( int  target_qbit)
inherited

Append a SX gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1310 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_syc()

void Gates_block::add_syc ( int  target_qbit,
int  control_qbit 
)
inherited

Add a Sycamore gate (i.e.

Add a Sycamore gate operation to the front of the list of gates.

controlled Hadamard gate) gate to the front of the list of gates

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1359 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_syc_to_end()

void Gates_block::add_syc_to_end ( int  target_qbit,
int  control_qbit 
)
inherited

Append a Sycamore gate (i.e.

Append a Sycamore gate operation to the list of gates.

controlled Hadamard gate) gate to the list of gates

Parameters
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)
control_qbitThe identification number of the control qubit. (0 <= target_qbit <= qbit_num-1)
target_qbitThe identification number of the target qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1342 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_u3()

void Gates_block::add_u3 ( int  target_qbit,
bool  Theta,
bool  Phi,
bool  Lambda 
)
inherited

Add a U3 gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
ThetaThe Theta parameter of the U3 gate
PhiThe Phi parameter of the U3 gate
LambdaThe Lambda parameter of the U3 gate
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
ThetaThe Theta parameter of the U3 operation
PhiThe Phi parameter of the U3 operation
LambdaThe Lambda parameter of the U3 operation

Definition at line 987 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_u3_to_end()

void Gates_block::add_u3_to_end ( int  target_qbit,
bool  Theta,
bool  Phi,
bool  Lambda 
)
inherited

Append a U3 gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
ThetaThe Theta parameter of the U3 gate
PhiThe Phi parameter of the U3 gate
LambdaThe Lambda parameter of the U3 gate
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)
ThetaThe Theta parameter of the U3 operation
PhiThe Phi parameter of the U3 operation
LambdaThe Lambda parameter of the U3 operation

Definition at line 971 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_un()

void Gates_block::add_un ( )
inherited

Add a UN gate to the front of the list of gates.

Definition at line 1447 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_un_to_end()

void Gates_block::add_un_to_end ( )
inherited

Append a UN gate to the list of gates.

Definition at line 1435 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_x()

void Gates_block::add_x ( int  target_qbit)
inherited

Add a X gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1235 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_x_to_end()

void Gates_block::add_x_to_end ( int  target_qbit)
inherited

Append a X gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1222 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_y()

void Gates_block::add_y ( int  target_qbit)
inherited

Add a Y gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1264 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_y_to_end()

void Gates_block::add_y_to_end ( int  target_qbit)
inherited

Append a Y gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1251 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_z()

void Gates_block::add_z ( int  target_qbit)
inherited

Add a Z gate to the front of the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1293 of file Gates_block.cpp.

Here is the call graph for this function:

◆ add_z_to_end()

void Gates_block::add_z_to_end ( int  target_qbit)
inherited

Append a Z gate to the list of gates.

Parameters
target_qbitThe identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1)

Definition at line 1280 of file Gates_block.cpp.

Here is the call graph for this function:

◆ apply_derivate_to()

std::vector< Matrix > Gates_block::apply_derivate_to ( Matrix_real parameters_mtx_in,
Matrix input 
)
virtualinherited

Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters.

Parameters
parametersAn array of the input parameters.
inputThe input array on which the gate is applied

Definition at line 695 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_from_right() [1/2]

void Gate::apply_from_right ( Matrix input)
virtualinherited

Call to apply the gate on the input array/matrix by input*Gate.

Parameters
inputThe input array on which the gate is applied

Reimplemented in SX, X, Y, Z, SYC, CH, CNOT, and CZ.

Definition at line 156 of file Gate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_from_right() [2/2]

void Gates_block::apply_from_right ( Matrix_real parameters_mtx,
Matrix input 
)
virtualinherited

Call to apply the gate on the input array/matrix by input*CNOT.

Call to apply the gate on the input array/matrix by input*Gate_block.

Parameters
inputThe input array on which the gate is applied

Reimplemented in Composite.

Definition at line 590 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_gate()

Matrix Decomposition_Base::apply_gate ( Matrix gate_mtx,
Matrix input_matrix 
)

Apply an gates on the input matrix.

Parameters
gate_mtxThe matrix of the gate.
input_matrixThe input matrix to be transformed.
Returns
Returns with the transformed matrix

Definition at line 1053 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_global_phase_factor() [1/2]

void Decomposition_Base::apply_global_phase_factor ( QGD_Complex16  global_phase_factor,
Matrix u3_gate 
)

Call to apply the global phase to a matrix.

Call to apply global phase of U3 matrices to matrix.

Returns
Returns with the minimum of the cost function
Parameters
global_phase_factorThe value of the phase

Definition at line 1636 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ apply_global_phase_factor() [2/2]

void Decomposition_Base::apply_global_phase_factor ( )

Call to apply the current global phase to the unitary matrix.

Parameters
global_phase_factorThe value of the phase

Definition at line 1645 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_kernel_from_right()

void Gate::apply_kernel_from_right ( Matrix u3_1qbit,
Matrix input 
)
protectedinherited

Call to apply the gate kernel on the input state or unitary from right (no AVX support)

Parameters
u3_1qbitThe 2x2 kernel of the gate operation
inputThe input matrix on which the transformation is applied
derivSet true to apply derivate transformation, false otherwise

Definition at line 359 of file Gate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_kernel_to()

void Gate::apply_kernel_to ( Matrix u3_1qbit,
Matrix input,
bool  deriv = false,
bool  parallel = false 
)
protectedinherited

Call to apply the gate kernel on the input state or unitary with optional AVX support.

Parameters
u3_1qbitThe 2x2 kernel of the gate operation
inputThe input matrix on which the transformation is applied
derivSet true to apply derivate transformation, false otherwise (optional)
parallelSet true to apply parallel kernels, false otherwise (optional)
u3_1qbitThe 2x2 kernel of the gate operation
inputThe input matrix on which the transformation is applied
derivSet true to apply derivate transformation, false otherwise (optional)
derivSet true to apply parallel kernels, false otherwise (optional)

Definition at line 292 of file Gate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_to() [1/2]

void Gate::apply_to ( Matrix input,
bool  parallel = false 
)
virtualinherited

Call to apply the gate on the input array/matrix.

Parameters
inputThe input array on which the gate is applied
parallelSet true to apply parallel kernels, false otherwise (optional)

Reimplemented in SX, X, Y, Z, CH, CZ, SYC, and CNOT.

Definition at line 143 of file Gate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_to() [2/2]

void Gates_block::apply_to ( Matrix_real parameters_mtx,
Matrix input,
bool  parallel = false 
)
virtualinherited

Call to apply the gate on the input array/matrix Gates_block*input.

Parameters
parametersAn array of the input parameters.
inputThe input array on which the gate is applied
parallelSet true to apply parallel kernels, false otherwise (optional)
parametersAn array of parameters to calculate the matrix of the U3 gate.
inputThe input array on which the gate is applied
parallelSet true to apply parallel kernels, false otherwise (optional)

Reimplemented in Composite.

Definition at line 215 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_to_list() [1/2]

void Gate::apply_to_list ( std::vector< Matrix > &  input)
inherited

Call to apply the gate on the input array/matrix by U3*input.

Parameters
parametersAn array of parameters to calculate the matrix of the U3 gate.
inputThe input array on which the gate is applied

Definition at line 127 of file Gate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_to_list() [2/2]

void Gates_block::apply_to_list ( Matrix_real parameters_mtx,
std::vector< Matrix input 
)
inherited

Call to apply the gate on the input array/matrix by U3*input.

Parameters
parametersAn array of parameters to calculate the matrix of the U3 gate.
inputThe input array on which the gate is applied

Definition at line 198 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_one_qubit_u3() [1/2]

Matrix Gate::calc_one_qubit_u3 ( double  ThetaOver2,
double  Phi,
double  Lambda 
)
inherited

Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space.

Parameters
ThetaReal parameter standing for the parameter theta.
PhiReal parameter standing for the parameter phi.
LambdaReal parameter standing for the parameter lambda.
Returns
Returns with the matrix of the one-qubit matrix.
Parameters
ThetaOver2Real parameter standing for the parameter theta.
PhiReal parameter standing for the parameter phi.
LambdaReal parameter standing for the parameter lambda.
Returns
Returns with the matrix of the one-qubit matrix.

Definition at line 439 of file Gate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_one_qubit_u3() [2/2]

Matrix Gate::calc_one_qubit_u3 ( )
virtualinherited

Calculate the matrix of the constans gates.

Returns
Returns with the matrix of the one-qubit matrix.

Reimplemented in SX, X, Y, Z, CH, CNOT, and CZ.

Definition at line 494 of file Gate.cpp.

Here is the caller graph for this function:

◆ calculate_new_global_phase_factor()

void Decomposition_Base::calculate_new_global_phase_factor ( QGD_Complex16  global_phase_factor_new)

Calculate the new global phase of the Unitary matrix after removing a trivial U3 matrix.

Call to calculate new global phase.

Parameters
global_phase_factor_newglobal phase calculated from the product of two U3 matrices
global_phase_factorThe value of the phase

Definition at line 1609 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ check_optimization_solution()

bool Decomposition_Base::check_optimization_solution ( )

check_optimization_solution

Checks the convergence of the optimization problem.

Returns
Returns with true if the target global minimum was reached during the optimization process, or false otherwise.

Definition at line 689 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ clone()

Gates_block * Gates_block::clone ( )
virtualinherited

Create a clone of the present class.

Returns
Return with a pointer pointing to the cloned object.

Reimplemented from Gate.

Reimplemented in Sub_Matrix_Decomposition, and Composite.

Definition at line 2289 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ combine()

void Gates_block::combine ( Gates_block op_block)
inherited

Call to append the gates of an gate block to the current block.

Call to append the gates of a gate block to the current block.

Parameters
op_blockA pointer to an instance of class Gate_block
op_blockA pointer to an instance of class Gates_block

Definition at line 2200 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains_adaptive_gate() [1/2]

bool Gates_block::contains_adaptive_gate ( )
inherited

Call to determine, whether the circuit contains daptive gate or not.

Returns
Return with true if the circuit contains an adaptive gate.

Definition at line 2347 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains_adaptive_gate() [2/2]

bool Gates_block::contains_adaptive_gate ( int  idx)
inherited

Call to determine, whether the sub-circuit at a given position in the circuit contains daptive gate or not.

Parameters
idxThe position of the gate to be checked.
Returns
Return with true if the circuit contains an adaptive gate.

Definition at line 2374 of file Gates_block.cpp.

Here is the call graph for this function:

◆ export_unitary()

void Decomposition_Base::export_unitary ( std::string &  filename)

exports unitary matrix to binary file

Call to export the unitary (with possible phase shift) into a binary file.

Parameters
filenamefile to be exported to
filenameThe path to the file where the unitary is expored

Definition at line 1656 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extract_gates()

int Gates_block::extract_gates ( Gates_block op_block)
inherited

Call to extract the gates stored in the class.

Parameters
op_blockAn instance of Gates_block class in which the gates will be stored. (The current gates will be erased)
Returns
Return with 0 on success.

Definition at line 2310 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalize_decomposition()

void Decomposition_Base::finalize_decomposition ( )

After the main optimization problem is solved, the indepent qubits can be rotated into state |0> by this def.

The constructed gates are added to the array of gates needed to the decomposition of the input unitary.

Definition at line 232 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fragment_circuit()

void Gates_block::fragment_circuit ( )
inherited

Definition at line 432 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_control_qbit()

int Gate::get_control_qbit ( )
inherited

Call to get the index of the control qubit.

Returns
Return with the index of the control qubit (return with -1 if control qubit was not set)

Definition at line 238 of file Gate.cpp.

Here is the caller graph for this function:

◆ get_current_minimum()

double Decomposition_Base::get_current_minimum ( )

Call to get the obtained minimum of the cost function.

Returns
Returns with the minimum of the cost function

Definition at line 1581 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ get_decomposed_matrix()

Matrix Decomposition_Base::get_decomposed_matrix ( )

Calculate the decomposed matrix resulted by the effect of the optimized gates on the unitary Umtx.

Returns
Returns with the decomposed matrix.

Definition at line 913 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ get_decomposition_error()

double Decomposition_Base::get_decomposition_error ( )

Call to get the error of the decomposition.

Returns
Returns with the error of the decomposition

Definition at line 1568 of file Decomposition_Base.cpp.

◆ get_finalizing_gates()

Matrix Decomposition_Base::get_finalizing_gates ( Matrix mtx,
Gates_block finalizing_gates,
double *  finalizing_parameters 
)

This method determine the gates needed to rotate the indepent qubits into the state |0>

Parameters
mtxThe unitary describing indepent qubits. The resulting matrix is returned by this pointer
finalizing_gatesPointer pointig to a block of gates containing the final gates.
finalizing_parametersParameters corresponding to the finalizing gates.
Returns
Returns with the finalized matrix

Definition at line 304 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_gate()

Gate * Decomposition_Base::get_gate ( int  n)

Call to prepare the optimized gates to export.

Parameters
nInteger labeling the n-th oepration (n>=0).
Returns
Returns with a pointer to the n-th Gate, or with MULL if the n-th gate cant be retrived.

Definition at line 1527 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ get_gate_num()

int Gates_block::get_gate_num ( )
inherited

Call to get the number of gates grouped in the class.

Returns
Return with the number of the gates grouped in the gate block.

Definition at line 1770 of file Gates_block.cpp.

Here is the caller graph for this function:

◆ get_gate_nums()

gates_num Gates_block::get_gate_nums ( )
inherited

Call to get the number of the individual gate types in the list of gates.

Returns
Returns with an instance gates_num describing the number of the individual gate types

Definition at line 1620 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_gate_products()

std::vector< Matrix, tbb::cache_aligned_allocator< Matrix > > Decomposition_Base::get_gate_products ( double *  parameters,
std::vector< Gate *>::iterator  gates_it,
int  num_of_gates 
)

Calculate the list of gate gate matrices such that the i>0-th element in the result list is the product of the gates of all 0<=n<i gates from the input list and the 0th element in the result list is the identity.

Parameters
parametersAn array containing the parameters of the U3 gates.
gates_itAn iterator pointing to the forst gate.
num_of_gatesThe number of gates involved in the calculations
Returns
Returns with a vector of the product matrices.
Parameters
parametersAn array containing the parameters of the gates.
gates_itAn iterator pointing to the first gate.
num_of_gatesThe number of gates involved in the calculations
Returns
Returns with a vector of the product matrices.

Definition at line 928 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_gates()

std::vector< Gate * > Gates_block::get_gates ( )
inherited

Call to get the gates stored in the class.

Returns
Return with a list of the gates.

Definition at line 2177 of file Gates_block.cpp.

Here is the caller graph for this function:

◆ get_global_phase_factor()

QGD_Complex16 Decomposition_Base::get_global_phase_factor ( )

Get the global phase of the Unitary matrix.

Call to get global phase.

Returns
The current global phase
Parameters
global_phase_factorThe value of the phase

Definition at line 1618 of file Decomposition_Base.cpp.

◆ get_involved_qubits()

std::vector< int > Gates_block::get_involved_qubits ( )
inherited

Call to get the qubits involved in the gates stored in the block of gates.

Returns
Return with a list of the invovled qubits

Definition at line 2145 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_matrix() [1/3]

Matrix Gate::get_matrix ( )
inherited

Call to retrieve the operation matrix.

Returns
Returns with a matrix of the operation

Definition at line 116 of file Gate.cpp.

Here is the caller graph for this function:

◆ get_matrix() [2/3]

Matrix Gates_block::get_matrix ( Matrix_real parameters)
inherited

Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block)

Call to retrieve the operation matrix (Which is the product of all the operation matrices stored in the operation block)

Parameters
parametersAn array pointing to the parameters of the gates
Returns
Returns with the gate matrix
Parameters
parametersAn array pointing to the parameters of the gates
Returns
Returns with the operation matrix

Definition at line 152 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_matrix() [3/3]

Matrix Gates_block::get_matrix ( Matrix_real parameters,
bool  parallel 
)
inherited

Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block)

Call to retrieve the operation matrix (Which is the product of all the operation matrices stored in the operation block)

Parameters
parametersAn array pointing to the parameters of the gates
parallelSet true to apply parallel kernels, false otherwise
Returns
Returns with the gate matrix
Parameters
parametersAn array pointing to the parameters of the gates
parallelSet true to apply parallel kernels, false otherwise
Returns
Returns with the operation matrix

Definition at line 168 of file Gates_block.cpp.

Here is the call graph for this function:

◆ get_optimized_parameters() [1/2]

Matrix_real Decomposition_Base::get_optimized_parameters ( )

Call to get the optimized parameters.

Returns
Return with the pointer pointing to the array storing the optimized parameters

Definition at line 725 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_optimized_parameters() [2/2]

void Decomposition_Base::get_optimized_parameters ( double *  ret)

Call to get the optimized parameters.

Parameters
retPreallocated array to store the optimized parameters.

Definition at line 735 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ get_parameter_max()

void Gates_block::get_parameter_max ( Matrix_real range_max)
inherited

Definition at line 525 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_parameter_num()

int Gates_block::get_parameter_num ( )
inherited

Call to get the number of free parameters.

Returns
Return with the number of parameters of the gates grouped in the gate block.

Definition at line 1759 of file Gates_block.cpp.

Here is the caller graph for this function:

◆ get_project_name()

std::string Decomposition_Base::get_project_name ( )

Call to get the current name of the project.

Returns
Returns the name of the project

Definition at line 1591 of file Decomposition_Base.cpp.

◆ get_qbit_num()

int Gate::get_qbit_num ( )
inherited

Call to get the number of qubits composing the unitary.

Returns
Return with the number of qubits composing the unitary

Definition at line 264 of file Gate.cpp.

Here is the caller graph for this function:

◆ get_reduced_density_matrix()

Matrix Gates_block::get_reduced_density_matrix ( Matrix_real parameters_mtx,
Matrix input_state,
matrix_base< int > &  qbit_list_subset 
)
inherited

Call to evaluate the reduced densiy matrix.

Parameters
parametersAn array of parameters to calculate the entropy
input_stateThe input state on which the gate structure is applied
qbit_listSubset of qubits for which the entropy should be calculated. (Should conatin unique elements) Returns with the reduced density matrix.

Definition at line 2401 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_second_Renyi_entropy()

double Gates_block::get_second_Renyi_entropy ( Matrix_real parameters_mtx,
Matrix input_state,
matrix_base< int > &  qbit_list_subset 
)
inherited

Call to evaluate the seconf Rényi entropy.

The quantum circuit is applied on an input state input. The entropy is evaluated for the transformed state.

Parameters
parametersAn array of parameters to calculate the entropy
input_stateThe input state on which the gate structure is applied
qbit_listSubset of qubits for which the entropy should be calculated. (Should conatin unique elements) Returns with the calculated entropy

Definition at line 2577 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_target_qbit()

int Gate::get_target_qbit ( )
inherited

Call to get the index of the target qubit.

Returns
Return with the index of the target qubit (return with -1 if target qubit was not set)

Definition at line 230 of file Gate.cpp.

Here is the caller graph for this function:

◆ get_transformed_matrix() [1/2]

Matrix Decomposition_Base::get_transformed_matrix ( Matrix_real parameters,
std::vector< Gate *>::iterator  gates_it,
int  num_of_gates 
)

Calculate the transformed matrix resulting by an array of gates on the matrix Umtx.

Parameters
parametersAn array containing the parameters of the U3 gates.
gates_itAn iterator pointing to the first gate to be applied on the initial matrix.
num_of_gatesThe number of gates to be applied on the initial matrix
Returns
Returns with the transformed matrix.

Definition at line 771 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ get_transformed_matrix() [2/2]

Matrix Decomposition_Base::get_transformed_matrix ( Matrix_real parameters,
std::vector< Gate *>::iterator  gates_it,
int  num_of_gates,
Matrix initial_matrix 
)

Calculate the transformed matrix resulting by an array of gates on a given initial matrix.

Parameters
parametersAn array containing the parameters of the U3 gates.
gates_itAn iterator pointing to the first gate to be applied on the initial matrix.
num_of_gatesThe number of gates to be applied on the initial matrix
initial_matrixThe initial matrix wich is transformed by the given gates.
Returns
Returns with the transformed matrix.
Parameters
parametersAn array containing the parameters of the U3 gates.
gates_itAn iterator pointing to the first gate to be applied on the initial matrix.
num_of_gatesThe number of gates to be applied on the initial matrix
initial_matrixThe initial matrix wich is transformed by the given gates. (by deafult it is set to the attribute Umtx)
Returns
Returns with the transformed matrix.

Definition at line 786 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ get_type()

gate_type Gate::get_type ( )
inherited

Call to get the type of the operation.

Returns
Return with the type of the operation (see gate_type for details)

Definition at line 255 of file Gate.cpp.

Here is the caller graph for this function:

◆ get_Umtx()

Matrix Decomposition_Base::get_Umtx ( )

Call to retrive a pointer to the unitary to be transformed.

Returns
Return with the unitary Umtx

Definition at line 708 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ get_Umtx_size()

int Decomposition_Base::get_Umtx_size ( )

Call to get the size of the unitary to be transformed.

Returns
Return with the size N of the unitary NxN

Definition at line 717 of file Decomposition_Base.cpp.

◆ import_unitary_from_binary()

Matrix Decomposition_Base::import_unitary_from_binary ( std::string &  filename)

Import a Unitary matrix from a file.

Call to import the unitary (with possible phase shift) into a binary file.

Parameters
filename.binary file to read
filenameThe path to the file from which the unitary is imported.

Definition at line 1682 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init_max_layer_num()

void Decomposition_Base::Init_max_layer_num ( )
static

Initializes default layer numbers.

Definition at line 1196 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ insert_gate()

void Gates_block::insert_gate ( Gate gate,
int  idx 
)
inherited

Call to insert a gate at a given position.

Parameters
gateA pointer to a class Gate describing a gate.
idxThe position where to insert the gate.

Definition at line 1595 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ list_gates() [1/2]

void Decomposition_Base::list_gates ( int  start_index)

Call to print the gates decomposing the initial unitary.

These gates brings the intial matrix into unity.

Parameters
start_indexThe index of the first gate

Definition at line 289 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ list_gates() [2/2]

void Gates_block::list_gates ( const Matrix_real parameters,
int  start_index 
)
inherited

Call to print the list of gates stored in the block of gates for a specific set of parameters.

Parameters
parametersThe parameters of the gates that should be printed.
start_indexThe ordinal number of the first gate.

Definition at line 1780 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optimization_problem()

double Decomposition_Base::optimization_problem ( const double *  parameters)
virtual

This is an abstact definition of function giving the cost functions measuring the entaglement of the qubits.

When the qubits are indepent, teh cost function should be zero.

Parameters
parametersAn array of the free parameters to be optimized. (The number of the free paramaters should be equal to the number of parameters in one sub-layer)

Definition at line 677 of file Decomposition_Base.cpp.

◆ parameters_for_calc_one_qubit()

void Gate::parameters_for_calc_one_qubit ( double &  ThetaOver2,
double &  Phi,
double &  Lambda 
)
virtualinherited

Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space.

Set static values for the angles and constans parameters for calculating the matrix of the gates.

Parameters
ThetaReal parameter standing for the parameter theta.
PhiReal parameter standing for the parameter phi.
LambdaReal parameter standing for the parameter lambda.
Returns
Returns with the matrix of the one-qubit matrix.
Parameters
ThetaOver2Real parameter standing for the parameter theta.
PhiReal parameter standing for the parameter phi.
LambdaReal parameter standing for the parameter lambda.

Reimplemented in RY, RX, RZ, and RZ_P.

Definition at line 508 of file Gate.cpp.

◆ prepare_gates_to_export() [1/3]

void Decomposition_Base::prepare_gates_to_export ( )

Call to prepare the optimized gates to export.

The gates are stored in the attribute gates

Definition at line 1213 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_gates_to_export() [2/3]

std::vector< Gate * > Decomposition_Base::prepare_gates_to_export ( std::vector< Gate *>  ops,
double *  parameters 
)

Call to prepare the optimized gates to export.

Parameters
opsA list of gates
parametersThe parameters of the gates
Returns
Returns with a list of gate gates.

Definition at line 1231 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ prepare_gates_to_export() [3/3]

std::vector< Gate * > Decomposition_Base::prepare_gates_to_export ( Gates_block block_op,
double *  parameters 
)

Call to prepare the gates of an gate block to export.

Parameters
block_opA pointer to a block of gates
parametersThe parameters of the gates
Returns
Returns with a list of gate gates.

Definition at line 1509 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ print()

void logging::print ( const std::stringstream &  sstream,
int  verbose_level = 1 
) const
inherited

Call to print output messages in the function of the verbosity level.

Parameters
sstreamThe stringstream input to store the output messages.
verbose_levelInteger input. High level means write more to the standart output, 0 means write nothing. The default value is set to 1.

Definition at line 55 of file logging.cpp.

◆ release_gate()

void Gates_block::release_gate ( int  idx)
inherited

Call to release one gate in the list.

Definition at line 134 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ release_gates()

void Gates_block::release_gates ( )
inherited

Call to release the stored gates.

Definition at line 98 of file Gates_block.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reorder_qubits()

void Decomposition_Base::reorder_qubits ( std::vector< int qbit_list)
virtual

Call to reorder the qubits in the matrix of the gate.

Parameters
qbit_listThe reordered list of qubits spanning the matrix

Reimplemented from Gates_block.

Definition at line 1102 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ set_control_qbit()

void Gate::set_control_qbit ( int  control_qbit_in)
inherited

Call to set the control qubit for the gate operation.

Parameters
control_qbit_inThe control qubit. Should be: 0 <= control_qbit_in < qbit_num

Definition at line 179 of file Gate.cpp.

Here is the caller graph for this function:

◆ set_convergence_threshold()

void Decomposition_Base::set_convergence_threshold ( double  convergence_threshold_in)

Call to set the threshold of convergence in the optimization processes.

Parameters
convergence_threshold_inThe value of the threshold.

Definition at line 1558 of file Decomposition_Base.cpp.

◆ set_debugfile()

void logging::set_debugfile ( std::string  debugfile)
inherited

Call to set the debugfile name.

Parameters
debugfileString variable. Set the debugfile name.

Definition at line 95 of file logging.cpp.

Here is the caller graph for this function:

◆ set_global_phase()

void Decomposition_Base::set_global_phase ( double  new_global_phase)

Call to set global phase.

Parameters
global_phase_factor_newThe value of the new phase

Definition at line 1626 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_iteration_loops() [1/2]

int Decomposition_Base::set_iteration_loops ( int  n,
int  iteration_loops_in 
)

Set the number of iteration loops during the subdecomposition of the n-th qubit.

Parameters
nThe number of qubits for which number of iteration loops should be used in the subdecomposition.,
iteration_loops_inThe number of iteration loops in each sted of the subdecomposition.
Returns
Returns with 0 if succeded.

Definition at line 1161 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_iteration_loops() [2/2]

int Decomposition_Base::set_iteration_loops ( std::map< int, int iteration_loops_in)

Set the number of iteration loops during the subdecomposition of the qbit-th qubit.

Parameters
iteration_loops_inAn <int,int> map containing the number of iteration loops for the individual subdecomposition processes
Returns
Returns with 0 if succeded.

Definition at line 1181 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ set_matrix()

void Gate::set_matrix ( Matrix  input)
inherited

Call to set the stored matrix in the operation.

Parameters
inputThe operation matrix to be stored. The matrix is stored by attribute matrix_alloc.
Returns
Returns with 0 on success.

Definition at line 170 of file Gate.cpp.

Here is the caller graph for this function:

◆ set_max_iteration()

void Decomposition_Base::set_max_iteration ( int  max_outer_iterations_in)

Call to set the maximal number of the iterations in the optimization process.

Parameters
max_outer_iterations_inmaximal number of iteartions in the optimization process

Definition at line 224 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_max_layer_num() [1/2]

int Decomposition_Base::set_max_layer_num ( int  n,
int  max_layer_num_in 
)

Set the maximal number of layers used in the subdecomposition of the n-th qubit.

Parameters
nThe number of qubits for which the maximal number of layers should be used in the subdecomposition.
max_layer_num_inThe maximal number of the gate layers used in the subdecomposition.
Returns
Returns with 0 if succeded.

Definition at line 1066 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_max_layer_num() [2/2]

int Decomposition_Base::set_max_layer_num ( std::map< int, int max_layer_num_in)

Set the maximal number of layers used in the subdecomposition of the n-th qubit.

Parameters
max_layer_num_inAn <int,int> map containing the maximal number of the gate layers used in the subdecomposition.
Returns
Returns with 0 if succeded.

Definition at line 1086 of file Decomposition_Base.cpp.

Here is the call graph for this function:

◆ set_optimization_blocks()

void Decomposition_Base::set_optimization_blocks ( int  optimization_block_in)

Call to set the number of gate blocks to be optimized in one shot.

Parameters
optimization_block_inThe number of gate blocks to be optimized in one shot

Definition at line 216 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_optimization_tolerance()

void Decomposition_Base::set_optimization_tolerance ( double  tolerance_in)

Call to set the tolerance of the optimization processes.

Parameters
tolerance_inThe value of the tolerance.
tolerance_inThe value of the tolerance. The error of the decomposition would scale with the square root of this value.

Definition at line 1546 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_optimized_parameters()

void Decomposition_Base::set_optimized_parameters ( double *  parameters,
int  num_of_parameters 
)

Call to set the optimized parameters for initial optimization.

Parameters
retPreallocated array to store the optimized parameters.

Definition at line 745 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_project_name()

void Decomposition_Base::set_project_name ( std::string &  project_name_new)

Call to set the name of the project.

Parameters
project_name_newpointer to the new project name

Definition at line 1599 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ set_qbit_num()

void Decomposition_Base::set_qbit_num ( int  qbit_num_in)
virtual

Set the number of qubits spanning the matrix of the gates stored in the block of gates.

Parameters
qbit_num_inThe number of qubits spanning the matrices.

Reimplemented from Gates_block.

Definition at line 1715 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_target_qbit()

void Gate::set_target_qbit ( int  target_qbit_in)
inherited

Call to set the target qubit for the gate operation.

Parameters
target_qbit_inThe target qubit on which the gate is applied. Should be: 0 <= target_qbit_in < qbit_num

Definition at line 188 of file Gate.cpp.

Here is the caller graph for this function:

◆ set_verbose()

void logging::set_verbose ( int  verbose_in)
inherited

Call to set the verbose attribute.

Parameters
verbose_inInteger variable. Set the number to specify the verbosity level for output messages.

Definition at line 85 of file logging.cpp.

Here is the caller graph for this function:

◆ solve_layer_optimization_problem()

void Decomposition_Base::solve_layer_optimization_problem ( int  num_of_parameters,
Matrix_real  solution_guess 
)
virtual

Abstarct function to be used to solve a single sub-layer optimization problem.

The optimalized parameters are stored in attribute optimized_parameters.

Parameters
'num_of_parameters'The number of free parameters to be optimized
solution_guess_gslArray containing the free parameters to be optimized.

The optimalized parameters are stored in attribute optimized_parameters.

Parameters
'num_of_parameters'The number of free parameters to be optimized
solution_guessArray containing the free parameters to be optimized.

Reimplemented in Optimization_Interface, and Sub_Matrix_Decomposition.

Definition at line 666 of file Decomposition_Base.cpp.

Here is the caller graph for this function:

◆ solve_optimization_problem()

void Decomposition_Base::solve_optimization_problem ( double *  solution_guess,
int  solution_guess_num 
)

This method can be used to solve the main optimization problem which is devidid into sub-layer optimization processes.

This method can be used to solve the main optimization problem which is divided into sub-layer optimization processes.

(The aim of the optimization problem is to disentangle one or more qubits) The optimalized parameters are stored in attribute optimized_parameters.

Parameters
solution_guessAn array of the guessed parameters
solution_guess_numThe number of guessed parameters. (not necessarily equal to the number of free parameters)

Definition at line 384 of file Decomposition_Base.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ block_end

std::vector<int> Gates_block::block_end
protectedinherited

Definition at line 57 of file Gates_block.h.

◆ block_type

std::vector<int> Gates_block::block_type
protectedinherited

Definition at line 58 of file Gates_block.h.

◆ config

std::map<std::string, Config_Element> Decomposition_Base::config

config metadata utilized during the optimization

Definition at line 104 of file Decomposition_Base.h.

◆ control_qbit

int Gate::control_qbit
protectedinherited

The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations.

Definition at line 53 of file Gate.h.

◆ convergence_threshold

double Decomposition_Base::convergence_threshold
protected

The convergence threshold in the optimization process.

Definition at line 155 of file Decomposition_Base.h.

◆ current_minimum

double Decomposition_Base::current_minimum
protected

The current minimum of the optimization problem.

Definition at line 137 of file Decomposition_Base.h.

◆ debug

bool logging::debug
inherited

Logical variable. Set true to write output messages to the 'debug.txt' file.

Definition at line 53 of file logging.h.

◆ debugfile_name

std::string logging::debugfile_name
inherited

String variable. Set the debug file name.

Definition at line 56 of file logging.h.

◆ decomposition_error

double Decomposition_Base::decomposition_error
protected

error of the final decomposition

Definition at line 128 of file Decomposition_Base.h.

◆ decomposition_finalized

bool Decomposition_Base::decomposition_finalized
protected

The optimized parameters for the gates.

logical value describing whether the decomposition was finalized or not (i.e. whether the decomposed qubits were rotated into the state |0> or not)

Definition at line 125 of file Decomposition_Base.h.

◆ finalizing_gates_num

int Decomposition_Base::finalizing_gates_num
protected

number of finalizing (deterministic) opertaions rotating the disentangled qubits into state |0>.

Definition at line 131 of file Decomposition_Base.h.

◆ finalizing_parameter_num

int Decomposition_Base::finalizing_parameter_num
protected

the number of the finalizing (deterministic) parameters of gates rotating the disentangled qubits into state |0>.

Definition at line 134 of file Decomposition_Base.h.

◆ fragmentation_type

int Gates_block::fragmentation_type
protectedinherited

Definition at line 53 of file Gates_block.h.

◆ fragmented

bool Gates_block::fragmented
protectedinherited

boolean variable indicating whether the circuit was already partitioned or not

Definition at line 52 of file Gates_block.h.

◆ gates

std::vector<Gate*> Gates_block::gates
protectedinherited

The list of stored gates.

Definition at line 44 of file Gates_block.h.

◆ gen

std::mt19937 Decomposition_Base::gen
protected

Standard mersenne_twister_engine seeded with rd()

Definition at line 159 of file Decomposition_Base.h.

◆ global_phase_factor

QGD_Complex16 Decomposition_Base::global_phase_factor

The global phase.

Definition at line 98 of file Decomposition_Base.h.

◆ global_target_minimum

double Decomposition_Base::global_target_minimum
protected

The global target minimum of the optimization problem.

Definition at line 140 of file Decomposition_Base.h.

◆ initial_guess

guess_type Decomposition_Base::initial_guess
protected

type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2

Definition at line 149 of file Decomposition_Base.h.

◆ involved_qbits

std::vector< std::vector<int> > Gates_block::involved_qbits
protectedinherited

Definition at line 56 of file Gates_block.h.

◆ iteration_loops

std::map<int,int> Decomposition_Base::iteration_loops
protected

A map of <int n: int num> indicating the number of iteration in each step of the decomposition.

Definition at line 113 of file Decomposition_Base.h.

◆ layer_num

int Gates_block::layer_num
protectedinherited

number of gate layers

Definition at line 46 of file Gates_block.h.

◆ matrix_size

int Gate::matrix_size
protectedinherited

The size N of the NxN matrix associated with the operations.

Definition at line 55 of file Gate.h.

◆ max_fusion

int Gates_block::max_fusion
protectedinherited

maximal number of qubits in partitions

Definition at line 55 of file Gates_block.h.

◆ max_layer_num

std::map<int,int> Decomposition_Base::max_layer_num
protected

A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process for the subdecomposing of the nth qubits.

Definition at line 110 of file Decomposition_Base.h.

◆ max_layer_num_def

std::map< int, int > Decomposition_Base::max_layer_num_def
static

A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process by default for the subdecomposing of the nth qubits.

Definition at line 92 of file Decomposition_Base.h.

◆ max_outer_iterations

int Decomposition_Base::max_outer_iterations
protected

Maximal number of iterations allowed in the optimization process.

Definition at line 146 of file Decomposition_Base.h.

◆ num_threads

int Decomposition_Base::num_threads
protected

Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.)

Definition at line 152 of file Decomposition_Base.h.

◆ optimization_block

int Decomposition_Base::optimization_block

number of gate blocks used in one shot of the optimization process

Definition at line 89 of file Decomposition_Base.h.

◆ optimization_problem_solved

bool Decomposition_Base::optimization_problem_solved
protected

logical value describing whether the optimization problem was solved or not

Definition at line 143 of file Decomposition_Base.h.

◆ optimization_tolerance

double Decomposition_Base::optimization_tolerance

The maximal allowed error of the optimization problem (The error of the decomposition would scale with the square root of this value)

Definition at line 95 of file Decomposition_Base.h.

◆ optimized_parameters_mtx

Matrix_real Decomposition_Base::optimized_parameters_mtx
protected

The optimized parameters for the gates.

Definition at line 119 of file Decomposition_Base.h.

◆ parameter_num

int Gate::parameter_num
protectedinherited

the number of free parameters of the operation

Definition at line 57 of file Gate.h.

◆ project_name

std::string Decomposition_Base::project_name

the name of the project

Definition at line 101 of file Decomposition_Base.h.

◆ qbit_num

int Gate::qbit_num
protectedinherited

number of qubits spanning the matrix of the operation

Definition at line 47 of file Gate.h.

◆ target_qbit

int Gate::target_qbit
protectedinherited

The index of the qubit on which the operation acts (target_qbit >= 0)

Definition at line 51 of file Gate.h.

◆ type

gate_type Gate::type
protectedinherited

The type of the operation (see enumeration gate_type)

Definition at line 49 of file Gate.h.

◆ Umtx

Matrix Decomposition_Base::Umtx
protected

The unitary to be decomposed.

Definition at line 116 of file Decomposition_Base.h.

◆ verbose

int logging::verbose
inherited

Set the verbosity level of the output messages.

Definition at line 50 of file logging.h.


The documentation for this class was generated from the following files: