Quantum Gate Decomposer
v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
|
Header file for a methods of the QGD Python Interface. More...
#include "qgd/Operation.h"
Go to the source code of this file.
Functions | |
int | iface_delete_N_Qubit_Decomposition (void *ptr) |
Call to deallocate the N_Qubit_Decomposition class. More... | |
int | iface_get_operation (void *ptr, int n, int &op_type, int &target_qbit, int &control_qbit, double *parameters) |
Call to get the n-th optimized operation. More... | |
int | iface_get_operation_num (void *ptr) |
Call to get the number of decomposing operations. More... | |
void | iface_list_operations (void *ptr, int start_index) |
Call to list the operations giving the decomposition of the unitary. More... | |
void * | iface_new_N_Qubit_Decomposition (double *mtx_real, double *mtx_imag, int qbit_num, bool optimize_layer_num, int initial_guess_num) |
Creates an instance of class N_Qubit_Decomposition and return with a void pointer pointing to the class instance. More... | |
int | iface_set_identical_blocks (void *ptr, int qbit, int identical_blocks) |
Set the number of identical successive blocks during the subdecomposition of the qbit-th qubit. More... | |
int | iface_set_iteration_loops (void *ptr, int qbit, int iteration_loops) |
Set the number of iteration loops during the subdecomposition of the qbit-th qubit. More... | |
int | iface_set_max_layer_num (void *ptr, int qbit, int max_layer_num) |
Set the maximal number of layers used in the subdecomposition of the qbit-th qubit. More... | |
int | iface_set_optimalization_block (void *ptr, int optimalization_block) |
Call to set the number of blocks to be optimized in one shot. More... | |
int | iface_set_verbose (void *ptr, bool verbose) |
Call to set the verbosity of the N_Qubit_Decomposition class. More... | |
int | iface_start_decomposition (void *ptr) |
Starts the decomposition of the unitary. More... | |
Header file for a methods of the QGD Python Interface.
Definition in file python_interface.h.
int iface_delete_N_Qubit_Decomposition | ( | void * | ptr | ) |
Call to deallocate the N_Qubit_Decomposition class.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
Definition at line 99 of file python_interface.cpp.
int iface_get_operation | ( | void * | ptr, |
int | n, | ||
int & | op_type, | ||
int & | target_qbit, | ||
int & | control_qbit, | ||
double * | parameters | ||
) |
Call to get the n-th optimized operation.
The values are returned via the input parameter references, and pointers
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
n | Integer labeling the n-th oepration (n>=0). |
op_type | The type of operation. (Possible values: CNOT_OPERATION=2, U3_OPERATION=3) |
target_qbit | The id of the target qubit. |
control_qbit | The id of the control qubit. |
parameters | A pointer pointing to the 3-component array conatining the parameters of the U3 operation. |
Definition at line 186 of file python_interface.cpp.
int iface_get_operation_num | ( | void * | ptr | ) |
Call to get the number of decomposing operations.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
Definition at line 167 of file python_interface.cpp.
void iface_list_operations | ( | void * | ptr, |
int | start_index | ||
) |
Call to list the operations giving the decomposition of the unitary.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
start_index | The starting number of the operations to be listed. |
Definition at line 156 of file python_interface.cpp.
void* iface_new_N_Qubit_Decomposition | ( | double * | mtx_real, |
double * | mtx_imag, | ||
int | qbit_num, | ||
bool | optimize_layer_num, | ||
int | initial_guess_num | ||
) |
Creates an instance of class N_Qubit_Decomposition and return with a void pointer pointing to the class instance.
mtx_real | Pointer to the real part of the unitary to be decomposed |
mtx_imag | Pointer to the imaginary part of the unitary to be decomposed |
qbit_num | Number of qubits spanning the unitary |
optimize_layer_num | Logical value. Set true to optimize the number of decomposing layers during the decomposition procedure, or false otherwise. |
initial_guess_num | Integer encoding the method to guess initial values for the optimalization. Possible values: 'zeros=0','random=1', 'close_to_zero=2' |
mtx_real | Pointer to the real part of the unitary to be decomposed |
mtx_imag | Pointer to the imaginary part of the unitary to be decomposed |
qbit_num | Number of qubits spanning the unitary |
optimize_layer_num | Logical value. Set true to optimize the number of decomposing layers during the decomposition procedure, or false otherwise. |
initial_guess_num | Integer encoding the method to guess initial values for the optimization. Possible values: 'zeros=0','random=1', 'close_to_zero=2' |
Definition at line 41 of file python_interface.cpp.
int iface_set_identical_blocks | ( | void * | ptr, |
int | qbit, | ||
int | identical_blocks | ||
) |
Set the number of identical successive blocks during the subdecomposition of the qbit-th qubit.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
qbit | The number of qubits for which the subdecomposition should contain identical_blocks successive identical blocks. |
identical_blocks | Number of successive identical blocks in the decomposition. |
Definition at line 118 of file python_interface.cpp.
int iface_set_iteration_loops | ( | void * | ptr, |
int | qbit, | ||
int | iteration_loops | ||
) |
Set the number of iteration loops during the subdecomposition of the qbit-th qubit.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
qbit | The number of qubits for which the subdecomposition should run iteration_loops number of iterations in each step of the optimization. |
iteration_loops | Number of iteration in each step of the subdecomposition. |
Definition at line 131 of file python_interface.cpp.
int iface_set_max_layer_num | ( | void * | ptr, |
int | qbit, | ||
int | max_layer_num | ||
) |
Set the maximal number of layers used in the subdecomposition of the qbit-th qubit.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
qbit | The number of qubits for which the subdecomposition should contain maximum max_layer_num layers of operation blocks. |
max_layer_num | The number of maximal number of layers used in the subdecomposition. |
Definition at line 144 of file python_interface.cpp.
int iface_set_optimalization_block | ( | void * | ptr, |
int | optimalization_block | ||
) |
Call to set the number of blocks to be optimized in one shot.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
optimalization_block | The number of blocks to be optimized in one shot |
Definition at line 223 of file python_interface.cpp.
int iface_set_verbose | ( | void * | ptr, |
bool | verbose | ||
) |
Call to set the verbosity of the N_Qubit_Decomposition class.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
verbose | Set False to suppress the output messages of the decompostion, or True (deafult) otherwise. |
Definition at line 207 of file python_interface.cpp.
int iface_start_decomposition | ( | void * | ptr | ) |
Starts the decomposition of the unitary.
ptr | A void pointer pointing to an instance of N_Qubit_Decomposition class. |
Definition at line 85 of file python_interface.cpp.