Quantum Gate Decomposer
v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
|
A class containing basic methods for the decomposition process. More...
#include <Decomposition_Base.h>
Public Member Functions | |
void | add_cnot_to_end (int control_qbit, int target_qbit) |
Append a C_NOT gate operation to the list of operations. More... | |
void | add_cnot_to_front (int control_qbit, int target_qbit) |
Add a C_NOT gate operation to the front of the list of operations. More... | |
void | add_operation_to_end (Operation *operation) |
Append a general operation to the list of operations. More... | |
void | add_operation_to_front (Operation *operation) |
Add an operation to the front of the list of operations. More... | |
void | add_operations_to_end (std::vector< Operation * > operations_in) |
Append a list of operations to the list of operations. More... | |
void | add_operations_to_front (std::vector< Operation * > operations_in) |
Add an array of operations to the front of the list of operations. More... | |
void | add_u3_to_end (int target_qbit, bool Theta, bool Phi, bool Lambda) |
Append a U3 gate to the list of operations. More... | |
void | add_u3_to_front (int target_qbit, bool Theta, bool Phi, bool Lambda) |
Add a U3 gate to the front of the list of operations. More... | |
Matrix | apply_operation (Matrix &operation_mtx, Matrix &input_matrix) |
Apply an operations on the input matrix. More... | |
bool | check_optimization_solution () |
check_optimization_solution More... | |
Operation_block * | clone () |
Create a clone of the present class. More... | |
void | combine (Operation_block *op_block) |
Call to append the operations of an operation block to the current block. More... | |
Decomposition_Base (Matrix Umtx_in, int qbit_num_in, guess_type initial_guess_in) | |
Contructor of the class. More... | |
int | extract_operations (Operation_block *op_block) |
Call to extract the operations 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... | |
int | get_control_qbit () |
Call to get the index of the control qubit. More... | |
Matrix | get_decomposed_matrix () |
Calculate the decomposed matrix resulted by the effect of the optimized operations on the unitary Umtx. More... | |
double | get_decomposition_error () |
Call to get the error of the decomposition. More... | |
Matrix | get_finalizing_operations (Matrix &mtx, Operation_block *finalizing_operations, double *finalizing_parameters) |
This method determine the operations needed to rotate the indepent qubits into the state |0> More... | |
gates_num | get_gate_nums () |
Call to get the number of the individual gate types in the list of operations. More... | |
std::vector< int > | get_involved_qubits () |
Call to get the qubits involved in the operations stored in the block of operations. More... | |
std::vector< Matrix > | get_matrices (const double *parameters) |
Call to get the list of matrix representation of the operations grouped in the block. More... | |
Matrix | get_matrix (const double *parameters) |
Call to retrieve the operation matrix (Which is the product of all the operation matrices stored in the operation block) More... | |
Matrix | get_matrix () |
Call to retrieve the operation matrix. More... | |
int | get_operation (unsigned int n, operation_type &type, int &target_qbit, int &control_qbit, double *parameters) |
Call to prepare the optimized operations to export. More... | |
int | get_operation_num () |
Call to get the number of operations grouped in the class. More... | |
std::vector< Matrix, tbb::cache_aligned_allocator< Matrix > > | get_operation_products (double *parameters, std::vector< Operation * >::iterator operations_it, int num_of_operations) |
Calculate the list of gate operation matrices such that the i>0-th element in the result list is the product of the operations of all 0<=n<i operations from the input list and the 0th element in the result list is the identity. More... | |
std::vector< Operation * > | get_operations () |
Call to get the operations stored in the class. More... | |
double * | get_optimized_parameters () |
Call to get the optimized parameters. More... | |
void | get_optimized_parameters (double *ret) |
Call to get the optimized parameters. More... | |
int | get_parameter_num () |
Call to get the number of free parameters. More... | |
int | get_qbit_num () |
Call to get the number of qubits composing the unitary. More... | |
int | get_target_qbit () |
Call to get the index of the target qubit. More... | |
Matrix | get_transformed_matrix (const double *parameters, std::vector< Operation * >::iterator operations_it, int num_of_operations) |
Calculate the transformed matrix resulting by an array of operations on the matrix Umtx. More... | |
Matrix | get_transformed_matrix (const double *parameters, std::vector< Operation * >::iterator operations_it, int num_of_operations, Matrix &initial_matrix) |
Calculate the transformed matrix resulting by an array of operations on a given initial matrix. More... | |
operation_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... | |
void | list_operations (int start_index) |
Call to print the operations decomposing the initial unitary. More... | |
void | list_operations (const double *parameters, int start_index) |
Call to print the list of operations stored in the block of operations 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... | |
void | prepare_operations_to_export () |
Call to prepare the optimized operations to export. More... | |
std::vector< Operation * > | prepare_operations_to_export (std::vector< Operation * > ops, const double *parameters) |
Call to prepare the optimized operations to export. More... | |
std::vector< Operation * > | prepare_operations_to_export (Operation_block *block_op, const double *parameters) |
Call to prepare the operations of an operation block to export. More... | |
void | release_operations () |
Call to release the stored operations. More... | |
void | reorder_qubits (std::vector< int > qbit_list) |
Call to reorder the qubits in the matrix of the operation. 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_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 operation blocks to be optimized in one shot. More... | |
void | set_qbit_num (int qbit_num_in) |
Set the number of qubits spanning the matrix of the operations stored in the block of operations. More... | |
void | set_verbose (bool verbose_in) |
Call to set the verbose attribute to true or false. More... | |
virtual void | solve_layer_optimization_problem (int num_of_parameters, gsl_vector *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 | |
int | optimization_block |
number of operation blocks used in one shot of the optimization process More... | |
double | optimization_tolerance |
The maximal allowed error of the optimization problem. More... | |
bool | verbose |
Logical variable. Set true for verbose mode, or to false to suppress output messages. More... | |
Static Public Attributes | |
static std::map< int, int > | max_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 Attributes | |
int | control_qbit |
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations. More... | |
double | current_minimum |
The current minimum of the optimization problem. More... | |
double | decomposition_error |
error of the unitarity of the final decomposition More... | |
bool | decomposition_finalized |
logical value describing whether the decomposition was finalized or not (i.e. whether the decomposed qubits were rotated into the state |0> or not) More... | |
int | finalizing_operations_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 operations rotating the disentangled qubits into state |0>. 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::map< int, int > | iteration_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 operation layers More... | |
int | matrix_size |
The size N of the NxN matrix associated with the operations. More... | |
int | max_iterations |
Maximal number of iterations allowed in the optimization process. More... | |
std::map< int, int > | max_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 | num_threads |
Number of outer OpenMP threads. (During the calculations OpenMP multithreading is turned off.) More... | |
std::vector< Operation * > | operations |
The list of stored operations. More... | |
bool | optimization_problem_solved |
logical value describing whether the optimization problem was solved or not More... | |
double * | optimized_parameters |
The optimized parameters for the operations. More... | |
unsigned 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... | |
operation_type | type |
The type of the operation (see enumeration operation_type) More... | |
Matrix | Umtx |
The unitary to be decomposed. More... | |
A class containing basic methods for the decomposition process.
Definition at line 47 of file Decomposition_Base.h.
Decomposition_Base::Decomposition_Base | ( | Matrix | Umtx_in, |
int | qbit_num_in, | ||
guess_type | initial_guess_in = CLOSE_TO_ZERO |
||
) |
Contructor of the class.
Constructor of the class.
Umtx_in | The unitary matrix to be decomposed |
qbit_num_in | The number of qubits spanning the unitary to be decomposed. |
initial_guess_in | Type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2 |
Definition at line 38 of file Decomposition_Base.cpp.
|
virtual |
Destructor of the class.
Definition at line 102 of file Decomposition_Base.cpp.
|
inherited |
Append a C_NOT gate operation to the list of operations.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 264 of file Operation_block (copy).cpp.
|
inherited |
Add a C_NOT gate operation to the front of the list of operations.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 281 of file Operation_block (copy).cpp.
|
inherited |
Append a general operation to the list of operations.
operation | A pointer to a class Operation describing an operation. |
Definition at line 322 of file Operation_block (copy).cpp.
|
inherited |
Add an operation to the front of the list of operations.
operation | A pointer to a class Operation describing an operation. |
Definition at line 345 of file Operation_block (copy).cpp.
|
inherited |
Append a list of operations to the list of operations.
operations_in | A list of operation class instances. |
Definition at line 295 of file Operation_block (copy).cpp.
|
inherited |
Add an array of operations to the front of the list of operations.
operations_in | A list of operation class instances. |
Definition at line 308 of file Operation_block (copy).cpp.
|
inherited |
Append a U3 gate to the list of operations.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Theta | The Theta parameter of the U3 operation |
Phi | The Phi parameter of the U3 operation |
Lambda | The Lambda parameter of the U3 operation |
Definition at line 233 of file Operation_block (copy).cpp.
|
inherited |
Add a U3 gate to the front of the list of operations.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Theta | The Theta parameter of the U3 operation |
Phi | The Phi parameter of the U3 operation |
Lambda | The Lambda parameter of the U3 operation |
Definition at line 249 of file Operation_block (copy).cpp.
Apply an operations on the input matrix.
operation_mtx | The matrix of the operation. |
input_matrix | The input matrix to be transformed. |
Definition at line 711 of file Decomposition_Base.cpp.
bool Decomposition_Base::check_optimization_solution | ( | ) |
check_optimization_solution
Checks the convergence of the optimization problem.
Definition at line 568 of file Decomposition_Base.cpp.
|
inherited |
Create a clone of the present class.
Definition at line 665 of file Operation_block (copy).cpp.
|
inherited |
Call to append the operations of an operation block to the current block.
op_block | A pointer to an instance of class Operation_block |
Definition at line 593 of file Operation_block (copy).cpp.
|
inherited |
Call to extract the operations stored in the class.
op_block | An instance of Operation_block class in which the operations will be stored. (The current operations will be erased) |
Definition at line 686 of file Operation_block (copy).cpp.
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 operations are added to the array of operations needed to the decomposition of the input unitary.
Definition at line 132 of file Decomposition_Base.cpp.
|
inherited |
Call to get the index of the control qubit.
Definition at line 157 of file Operation.cpp.
Matrix Decomposition_Base::get_decomposed_matrix | ( | ) |
Calculate the decomposed matrix resulted by the effect of the optimized operations on the unitary Umtx.
Definition at line 699 of file Decomposition_Base.cpp.
double Decomposition_Base::get_decomposition_error | ( | ) |
Call to get the error of the decomposition.
Definition at line 1059 of file Decomposition_Base.cpp.
Matrix Decomposition_Base::get_finalizing_operations | ( | Matrix & | mtx, |
Operation_block * | finalizing_operations, | ||
double * | finalizing_parameters | ||
) |
This method determine the operations needed to rotate the indepent qubits into the state |0>
mtx | The unitary describing indepent qubits. The resulting matrix is returned by this pointer |
finalizing_operations | Pointer pointig to a block of operations containing the final operations. |
finalizing_parameters | Parameters corresponding to the finalizing operations. |
Definition at line 203 of file Decomposition_Base.cpp.
|
inherited |
Call to get the number of the individual gate types in the list of operations.
Definition at line 369 of file Operation_block (copy).cpp.
|
inherited |
Call to get the qubits involved in the operations stored in the block of operations.
Definition at line 552 of file Operation_block (copy).cpp.
|
inherited |
Call to get the list of matrix representation of the operations grouped in the block.
parameters | Array of parameters to calculate the matrix of the operation block |
Definition at line 174 of file Operation_block (copy).cpp.
|
inherited |
Call to retrieve the operation matrix (Which is the product of all the operation matrices stored in the operation block)
parameters | An array pointing to the parameters of the operations |
Definition at line 106 of file Operation_block (copy).cpp.
|
inherited |
Call to retrieve the operation matrix.
Definition at line 97 of file Operation.cpp.
int Decomposition_Base::get_operation | ( | unsigned int | n, |
operation_type & | type, | ||
int & | target_qbit, | ||
int & | control_qbit, | ||
double * | parameters | ||
) |
Call to prepare the optimized operations to export.
n | Integer labeling the n-th oepration (n>=0). |
type | The type of the operation from enumeration operation_type is returned via this parameter. |
target_qbit | The ID of the target qubit is returned via this input parameter. |
control_qbit | The ID of the control qubit is returned via this input parameter. |
parameters | The parameters of the operations |
Definition at line 1009 of file Decomposition_Base.cpp.
|
inherited |
Call to get the number of operations grouped in the class.
Definition at line 418 of file Operation_block (copy).cpp.
std::vector< Matrix, tbb::cache_aligned_allocator< Matrix > > Decomposition_Base::get_operation_products | ( | double * | parameters, |
std::vector< Operation * >::iterator | operations_it, | ||
int | num_of_operations | ||
) |
Calculate the list of gate operation matrices such that the i>0-th element in the result list is the product of the operations of all 0<=n<i operations from the input list and the 0th element in the result list is the identity.
parameters | An array containing the parameters of the U3 operations. |
operations_it | An iterator pointing to the forst operation. |
num_of_operations | The number of operations involved in the calculations |
parameters | An array containing the parameters of the operations. |
operations_it | An iterator pointing to the first operation. |
num_of_operations | The number of operations involved in the calculations |
Definition at line 35 of file Functor_Get_Operation_Products.cpp.
|
inherited |
Call to get the operations stored in the class.
Definition at line 584 of file Operation_block (copy).cpp.
double * Decomposition_Base::get_optimized_parameters | ( | ) |
Call to get the optimized parameters.
Definition at line 596 of file Decomposition_Base.cpp.
void Decomposition_Base::get_optimized_parameters | ( | double * | ret | ) |
Call to get the optimized parameters.
ret | Preallocated array to store the optimized parameters. |
Definition at line 606 of file Decomposition_Base.cpp.
|
inherited |
Call to get the number of free parameters.
Definition at line 409 of file Operation_block (copy).cpp.
|
inherited |
Call to get the number of qubits composing the unitary.
Definition at line 183 of file Operation.cpp.
|
inherited |
Call to get the index of the target qubit.
Definition at line 149 of file Operation.cpp.
Matrix Decomposition_Base::get_transformed_matrix | ( | const double * | parameters, |
std::vector< Operation * >::iterator | operations_it, | ||
int | num_of_operations | ||
) |
Calculate the transformed matrix resulting by an array of operations on the matrix Umtx.
parameters | An array containing the parameters of the U3 operations. |
operations_it | An iterator pointing to the first operation to be applied on the initial matrix. |
num_of_operations | The number of operations to be applied on the initial matrix |
Definition at line 619 of file Decomposition_Base.cpp.
Matrix Decomposition_Base::get_transformed_matrix | ( | const double * | parameters, |
std::vector< Operation * >::iterator | operations_it, | ||
int | num_of_operations, | ||
Matrix & | initial_matrix | ||
) |
Calculate the transformed matrix resulting by an array of operations on a given initial matrix.
parameters | An array containing the parameters of the U3 operations. |
operations_it | An iterator pointing to the first operation to be applied on the initial matrix. |
num_of_operations | The number of operations to be applied on the initial matrix |
initial_matrix | The initial matrix wich is transformed by the given operations. |
parameters | An array containing the parameters of the U3 operations. |
operations_it | An iterator pointing to the first operation to be applied on the initial matrix. |
num_of_operations | The number of operations to be applied on the initial matrix |
initial_matrix | The initial matrix wich is transformed by the given operations. (by deafult it is set to the attribute Umtx) |
Definition at line 634 of file Decomposition_Base.cpp.
|
inherited |
Call to get the type of the operation.
Definition at line 174 of file Operation.cpp.
Matrix Decomposition_Base::get_Umtx | ( | ) |
Call to retrive a pointer to the unitary to be transformed.
Definition at line 579 of file Decomposition_Base.cpp.
int Decomposition_Base::get_Umtx_size | ( | ) |
Call to get the size of the unitary to be transformed.
Definition at line 588 of file Decomposition_Base.cpp.
|
static |
Initializes default layer numbers.
Definition at line 853 of file Decomposition_Base.cpp.
void Decomposition_Base::list_operations | ( | int | start_index | ) |
Call to print the operations decomposing the initial unitary.
These operations brings the intial matrix into unity.
start_index | The index of the first operation |
Definition at line 188 of file Decomposition_Base.cpp.
|
inherited |
Call to print the list of operations stored in the block of operations for a specific set of parameters.
parameters | The parameters of the operations that should be printed. |
start_index | The ordinal number of the first operation. |
Definition at line 428 of file Operation_block (copy).cpp.
|
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 | An 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) |
Reimplemented in N_Qubit_Decomposition, and Sub_Matrix_Decomposition.
Definition at line 556 of file Decomposition_Base.cpp.
void Decomposition_Base::prepare_operations_to_export | ( | ) |
Call to prepare the optimized operations to export.
The operations are stored in the attribute operations
Definition at line 870 of file Decomposition_Base.cpp.
std::vector< Operation * > Decomposition_Base::prepare_operations_to_export | ( | std::vector< Operation * > | ops, |
const double * | parameters | ||
) |
Call to prepare the optimized operations to export.
ops | A list of operations |
parameters | The parameters of the operations |
Definition at line 888 of file Decomposition_Base.cpp.
std::vector< Operation * > Decomposition_Base::prepare_operations_to_export | ( | Operation_block * | block_op, |
const double * | parameters | ||
) |
Call to prepare the operations of an operation block to export.
block_op | A pointer to a block of operations |
parameters | The parameters of the operations |
Definition at line 990 of file Decomposition_Base.cpp.
|
inherited |
Call to release the stored operations.
Definition at line 68 of file Operation_block (copy).cpp.
|
virtual |
Call to reorder the qubits in the matrix of the operation.
qbit_list | The reordered list of qubits spanning the matrix |
Reimplemented from Operation.
Definition at line 760 of file Decomposition_Base.cpp.
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.
n | The number of qubits for which number of iteration loops should be used in the subdecomposition., |
iteration_loops_in | The number of iteration loops in each sted of the subdecomposition. |
Definition at line 818 of file Decomposition_Base.cpp.
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.
iteration_loops_in | An <int,int> map containing the number of iteration loops for the individual subdecomposition processes |
Definition at line 838 of file Decomposition_Base.cpp.
|
inherited |
Call to set the stored matrix in the operation.
input | The operation matrix to be stored. The matrix is stored by attribute matrix_alloc. |
Definition at line 109 of file Operation.cpp.
void Decomposition_Base::set_max_iteration | ( | int | max_iterations_in | ) |
Call to set the maximal number of the iterations in the optimization process.
max_iterations_in | maximal number of iteartions in the optimization process |
Definition at line 124 of file Decomposition_Base.cpp.
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.
n | The number of qubits for which the maximal number of layers should be used in the subdecomposition. |
max_layer_num_in | The maximal number of the operation layers used in the subdecomposition. |
Definition at line 724 of file Decomposition_Base.cpp.
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.
max_layer_num_in | An <int,int> map containing the maximal number of the operation layers used in the subdecomposition. |
Definition at line 744 of file Decomposition_Base.cpp.
void Decomposition_Base::set_optimization_blocks | ( | int | optimization_block_in | ) |
Call to set the number of operation blocks to be optimized in one shot.
optimization_block_in | The number of operation blocks to be optimized in one shot |
Definition at line 116 of file Decomposition_Base.cpp.
|
virtualinherited |
Set the number of qubits spanning the matrix of the operations stored in the block of operations.
qbit_num_in | The number of qubits spanning the matrices. |
Reimplemented from Operation.
Definition at line 633 of file Operation_block (copy).cpp.
void Decomposition_Base::set_verbose | ( | bool | verbose_in | ) |
Call to set the verbose attribute to true or false.
verbose_in | Logical variable. Set true for verbose mode, or to false to suppress output messages. |
Definition at line 1048 of file Decomposition_Base.cpp.
|
virtual |
Abstarct function to be used to solve a single sub-layer optimization problem.
The optimalized parameters are stored in attribute optimized_parameters.
'num_of_parameters' | The number of free parameters to be optimized |
solution_guess_gsl | A GNU Scientific Libarary vector containing the free parameters to be optimized. |
Reimplemented in N_Qubit_Decomposition, and Sub_Matrix_Decomposition.
Definition at line 545 of file Decomposition_Base.cpp.
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.
(The aim of the optimization problem is to disentangle one or more qubits) The optimalized parameters are stored in attribute optimized_parameters.
solution_guess | An array of the guessed parameters |
solution_guess_num | The number of guessed parameters. (not necessarily equal to the number of free parameters) |
Definition at line 283 of file Decomposition_Base.cpp.
|
protectedinherited |
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations.
Definition at line 52 of file Operation.h.
|
protected |
The current minimum of the optimization problem.
Definition at line 90 of file Decomposition_Base.h.
|
protected |
error of the unitarity of the final decomposition
Definition at line 81 of file Decomposition_Base.h.
|
protected |
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 78 of file Decomposition_Base.h.
|
protected |
number of finalizing (deterministic) opertaions rotating the disentangled qubits into state |0>.
Definition at line 84 of file Decomposition_Base.h.
|
protected |
the number of the finalizing (deterministic) parameters of operations rotating the disentangled qubits into state |0>.
Definition at line 87 of file Decomposition_Base.h.
|
protected |
The global target minimum of the optimization problem.
Definition at line 93 of file Decomposition_Base.h.
|
protected |
type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2
Definition at line 102 of file Decomposition_Base.h.
|
protected |
A map of <int n: int num> indicating the number of iteration in each step of the decomposition.
Definition at line 69 of file Decomposition_Base.h.
|
protectedinherited |
number of operation layers
Definition at line 43 of file Operation_block.h.
|
protectedinherited |
The size N of the NxN matrix associated with the operations.
Definition at line 54 of file Operation.h.
|
protected |
Maximal number of iterations allowed in the optimization process.
Definition at line 99 of file Decomposition_Base.h.
|
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 66 of file Decomposition_Base.h.
|
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 58 of file Decomposition_Base.h.
|
protected |
Number of outer OpenMP threads. (During the calculations OpenMP multithreading is turned off.)
Definition at line 105 of file Decomposition_Base.h.
|
protectedinherited |
The list of stored operations.
Definition at line 41 of file Operation_block.h.
int Decomposition_Base::optimization_block |
number of operation blocks used in one shot of the optimization process
Definition at line 55 of file Decomposition_Base.h.
|
protected |
logical value describing whether the optimization problem was solved or not
Definition at line 96 of file Decomposition_Base.h.
double Decomposition_Base::optimization_tolerance |
The maximal allowed error of the optimization problem.
Definition at line 61 of file Decomposition_Base.h.
|
protected |
The optimized parameters for the operations.
Definition at line 75 of file Decomposition_Base.h.
|
protectedinherited |
the number of free parameters of the operation
Definition at line 56 of file Operation.h.
|
protectedinherited |
number of qubits spanning the matrix of the operation
Definition at line 46 of file Operation.h.
|
protectedinherited |
The index of the qubit on which the operation acts (target_qbit >= 0)
Definition at line 50 of file Operation.h.
|
protectedinherited |
The type of the operation (see enumeration operation_type)
Definition at line 48 of file Operation.h.
|
protected |
The unitary to be decomposed.
Definition at line 72 of file Decomposition_Base.h.
bool Decomposition_Base::verbose |
Logical variable. Set true for verbose mode, or to false to suppress output messages.
Definition at line 52 of file Decomposition_Base.h.