26 #ifndef N_Qubit_Decomposition_adaptive_H 27 #define N_Qubit_Decomposition_adaptive_H virtual unsigned int get_panelty(Gates_block *gate_structure, Matrix_real &optimized_parameters)
Call to get the panelty derived from the number of CRY and CNOT gates in the circuit.
Gates_block * optimize_imported_gate_structure(Matrix_real &optimized_parameters_mtx_loc)
Call to optimize an imported gate structure.
void add_adaptive_layers()
Call to add adaptive layers to the gate structure stored by the class.
void add_finalyzing_layer()
Call to add finalyzing layer (single qubit rotations on all of the qubits) to the gate structure stor...
Gates_block * compress_gate_structure(Gates_block *gate_structure, int uncompressed_iter_num)
Call to run compression iterations on the circuit.
bool randomized_adaptive_layers
Boolean variable to determine whether randomized adaptive layers are used or not. ...
int level_limit
The maximal number of adaptive layers used in the decomposition.
int LAPACKE_zggev(int matrix_layout, char jobvl, char jobvr, int n, QGD_Complex16 *a, int lda, QGD_Complex16 *b, int ldb, QGD_Complex16 *alpha, QGD_Complex16 *beta, QGD_Complex16 *vl, int ldvl, QGD_Complex16 *vr, int ldvr)
Definition of the zggev function from Lapacke to calculate the eigenvalues of a complex matrix...
std::vector< matrix_base< int > > topology
A vector of index pairs encoding the connectivity between the qubits.
virtual ~N_Qubit_Decomposition_adaptive()
Destructor of the class.
Matrix_real create_reduced_parameters(Gates_block *gate_structure, Matrix_real &optimized_parameters, int layer_idx)
Call to remove those parameters from the array, which correspond to gates that are about to be remove...
N_Qubit_Decomposition_adaptive()
Nullary constructor of the class.
int accelerator_num
number of utilized accelerators
int level_limit_min
The minimal number of adaptive layers used in the decomposition.
void apply_imported_gate_structure()
Call to apply the imported gate structure on the unitary.
void set_unitary_from_file(std::string filename)
Set unitary matrix from file.
void set_adaptive_gate_structure(std::string filename)
Call to set custom layers to the gate structure that are intended to be used in the decomposition...
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
virtual Gates_block * remove_trivial_gates(Gates_block *gate_structure, Matrix_real &optimized_parameters, double &currnt_minimum_loc)
Call to remove those blocks from the circuit that contain a trivial CRY gate (i.e.
virtual void compress_circuit()
Compress the circuit.
Structure type representing complex numbers in the SQUANDER package.
void add_adaptive_gate_structure(std::string filename)
Call to append custom layers to the gate structure that are intended to be used in the decomposition...
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
virtual void get_initial_circuit()
get initial circuit
Gates_block * construct_adaptive_gate_layers()
Call to construct adaptive layers.
Class to store data of complex arrays and its properties.
A class responsible for grouping two-qubit (CNOT,CZ,CH) and one-qubit gates into layers.
virtual void finalize_circuit()
Finalize the circuit.
void add_layer_to_imported_gate_structure()
Call to add an adaptive layer to the gate structure previously imported gate structure.
std::map< std::string, Config_Element > config
config metadata utilized during the optimization
dictionary gate_structure
double extract_theta_from_layer(Gates_block *gate_structure, int layer_idx, Matrix_real &optimized_parameters)
virtual void start_decomposition()
Start the disentanglig process of the unitary.
void set_unitary(Matrix &Umtx_new)
Set unitary matrix.
Gates_block * determine_initial_gate_structure(Matrix_real &optimized_parameters_mtx)
Call determine the gate structrue of the decomposing circuit.
Matrix_real optimized_parameters_mtx
The optimized parameters for the gates.
Gates_block * replace_trivial_CRY_gates(Gates_block *gate_structure, Matrix_real &optimized_parameters)
Call to replace CRY gates in the circuit that are close to either an identity or to a CNOT gate...
Class to store data of complex arrays and its properties.