Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Classes | Macros | Functions | Variables
qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp File Reference
#include <Python.h>
#include <numpy/arrayobject.h>
#include "structmember.h"
#include <stdio.h>
#include "N_Qubit_Decomposition_Tabu_Search.h"
#include "Gates_block.h"
#include "numpy_interface.h"
Include dependency graph for qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp:

Go to the source code of this file.

Classes

struct  qgd_Circuit_Wrapper
 Type definition of the qgd_Circuit_Wrapper Python class of the qgd_Circuit_Wrapper module. More...
 
struct  qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper
 Type definition of the qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper Python class of the qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper module. More...
 

Macros

#define PY_SSIZE_T_CLEAN
 

Functions

N_Qubit_Decomposition_Tabu_Searchcreate_N_Qubit_Decomposition_Tabu_Search (Matrix &Umtx, int qbit_num, int level_limit, std::vector< matrix_base< int >> topology_in, std::map< std::string, Config_Element > &config, int accelerator_num)
 Constructor of the class. More...
 
PyMODINIT_FUNC PyInit_qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper (void)
 Method called when the Python module is initialized. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_apply_Global_Phase_Factor (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 applies the global phase to the Unitary matrix More...
 
static void qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_dealloc (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Method called when a python instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper is destroyed. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_export_Unitary (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 export unitary to binary file More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_circuit (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Wrapper function to retrieve the circuit (Squander format) incorporated in the instance. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Decomposition_Error (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Cll to get the error of the decomposition (i.e. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_gate_num (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Wrapper function to get the number of decomposing gates. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Global_Phase (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 returns the angle of the global phase (the radius us always sqrt(2)) More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Matrix (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Retrieve the unified unitary operation of the circuit. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Num_of_Iters (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Get the number of free parameters in the gate structure used for the decomposition. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Optimized_Parameters (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Extract the optimized parameters. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Parameter_Num (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Get the number of free parameters in the gate structure used for the decomposition. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Project_Name (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 get project name More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Qbit_Num (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Call to retrieve the number of qubits in the circuit. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Second_Renyi_Entropy (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper function to evaluate the second Rényi entropy of a quantum circuit at a specific parameter set. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Trace_Offset (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Wrapper function to get the trace offset used in the cost function. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Unitary (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 get Unitary More...
 
static int qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_init (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args, PyObject *kwds)
 Method called when a python instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper is initialized. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_List_Gates (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Lists the gates decomposing the initial unitary. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 Method called when a python instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper is allocated. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper function to evaluate the cost function. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Batch (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper function to evaluate the cost function an dthe gradient components. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Combined (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper function to evaluate the cost function an dthe gradient components. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Combined_Unitary (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper function to evaluate the unitary function and the unitary derivates. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Grad (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper function to evaluate the cost function an dthe gradient components. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Reorder_Qubits (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper method to reorder the qubits in the decomposition class. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Convergence_Threshold (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper method to set the threshold of convergence in the optimization processes. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Cost_Function_Variant (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to set a variant for the cost function. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Debugfile (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Set the debugfile name of the N_Qubit_Decomposition class. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Global_Phase (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 sets the global phase to the new angle given More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Iteration_Loops (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Set the number of iteration loops during the subdecomposition of the qbit-th qubit. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Max_Iterations (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Set the number of maximum iterations. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Max_Layer_Num (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Set the maximal number of layers used in the subdecomposition of the qbit-th qubit. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimization_Blocks (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper method to to set the number of gate blocks to be optimized in one shot. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimization_Tolerance (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Wrapper method to set the optimization tolerance of the optimization process during the decomposition. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimized_Parameters (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Extract the optimized parameters. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimizer (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to set custom gate structure for the decomposition. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Project_Name (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 set project name More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Trace_Offset (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to set the trace offset used in the cost function. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Unitary (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Verbose (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args)
 Set the verbosity of the N_Qubit_Decomposition class. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Start_Decomposition (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition. More...
 
static PyObject * qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Upload_Umtx_to_DFE (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper *self)
 Call to upload the unitary to the DFE. More...
 
void release_N_Qubit_Decomposition_Tabu_Search (N_Qubit_Decomposition_Tabu_Search *instance)
 Call to deallocate an instance of N_Qubit_Decomposition_Tabu_Search class. More...
 

Variables

static PyMemberDef qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_members []
 Structure containing metadata about the members of class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper. More...
 
static PyMethodDef qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_methods []
 Structure containing metadata about the methods of class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper. More...
 
static PyModuleDef qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Module
 Structure containing metadata about the module. More...
 
static PyTypeObject qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Type
 A structure describing the type of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper. More...
 

Macro Definition Documentation

◆ PY_SSIZE_T_CLEAN

#define PY_SSIZE_T_CLEAN

Function Documentation

◆ create_N_Qubit_Decomposition_Tabu_Search()

N_Qubit_Decomposition_Tabu_Search* create_N_Qubit_Decomposition_Tabu_Search ( Matrix Umtx,
int  qbit_num,
int  level_limit,
std::vector< matrix_base< int >>  topology_in,
std::map< std::string, Config_Element > &  config,
int  accelerator_num 
)

Constructor of the class.

Parameters
Umtx_inThe unitary matrix to be decomposed
qbit_num_inThe number of qubits spanning the unitary Umtx
level_limit_inThe maximal number of two-qubit gates in the decomposition
topology_inA list of <target_qubit, control_qubit> pairs describing the connectivity between qubits.
configstd::map conatining custom config parameters
accelerator_numThe number of DFE accelerators used in the calculations
Returns
Return with a pointer pointing to an instance of N_Qubit_Decomposition_Tabu_Search class.

Definition at line 76 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the caller graph for this function:

◆ PyInit_qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper()

PyMODINIT_FUNC PyInit_qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper ( void  )

Method called when the Python module is initialized.

Definition at line 1963 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_apply_Global_Phase_Factor()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_apply_Global_Phase_Factor ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

applies the global phase to the Unitary matrix

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 380 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_dealloc()

static void qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_dealloc ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Method called when a python instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper is destroyed.

Parameters
selfA pointer pointing to an instance of class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 111 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_export_Unitary()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_export_Unitary ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

export unitary to binary file

Parameters
filenamefile to be exported to

Definition at line 859 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_circuit()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_circuit ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Wrapper function to retrieve the circuit (Squander format) incorporated in the instance.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_custom_Wrapper.

Definition at line 395 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Decomposition_Error()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Decomposition_Error ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Cll to get the error of the decomposition (i.e.

the final value of the cost function)

Returns
The error of the decomposition

Definition at line 845 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_gate_num()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_gate_num ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Wrapper function to get the number of decomposing gates.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
Returns
Returns with the number of gates

Definition at line 332 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Global_Phase()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Global_Phase ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

returns the angle of the global phase (the radius us always sqrt(2))

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 352 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Matrix()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Matrix ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Retrieve the unified unitary operation of the circuit.

Parameters
start_indexThe index of the first inverse gate

Definition at line 1327 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Num_of_Iters()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Num_of_Iters ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Get the number of free parameters in the gate structure used for the decomposition.

Definition at line 488 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Optimized_Parameters()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Optimized_Parameters ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Extract the optimized parameters.

Parameters
start_indexThe index of the first inverse gate

Definition at line 455 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Parameter_Num()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Parameter_Num ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Get the number of free parameters in the gate structure used for the decomposition.

Definition at line 477 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Project_Name()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Project_Name ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

get project name

Returns
string name of the project

Definition at line 801 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Qbit_Num()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Qbit_Num ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Call to retrieve the number of qubits in the circuit.

Definition at line 1720 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Second_Renyi_Entropy()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Second_Renyi_Entropy ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper function to evaluate the second Rényi entropy of a quantum circuit at a specific parameter set.

Definition at line 1626 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Trace_Offset()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Trace_Offset ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Wrapper function to get the trace offset used in the cost function.

In this case Tr(A) = sum_(i-offset=j) A_{ij}

Returns
Returns with the trace offset

Definition at line 1562 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Unitary()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_get_Unitary ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

get Unitary

Returns
Unitarty numpy matrix

Definition at line 883 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_init()

static int qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_init ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Method called when a python instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper is initialized.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: Umtx (numpy array), qbit_num (integer), optimize_layer_num (bool), initial_guess (string PyObject
kwdsA tuple of keywords

Definition at line 158 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_List_Gates()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_List_Gates ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Lists the gates decomposing the initial unitary.

(These gates are the inverse gates of the gates bringing the intial matrix into unity.)

Parameters
start_indexThe index of the first inverse gate

Definition at line 440 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_new()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_new ( PyTypeObject type,
PyObject *  args,
PyObject *  kwds 
)
static

Method called when a python instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper is allocated.

Parameters
typeA pointer pointing to a structure describing the type of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 136 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper function to evaluate the cost function.

Returns
teh value of the cost function

Definition at line 915 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Batch()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Batch ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper function to evaluate the cost function an dthe gradient components.

Returns
Unitarty numpy matrix

Definition at line 1167 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Combined()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Combined ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper function to evaluate the cost function an dthe gradient components.

Returns
Unitarty numpy matrix

Definition at line 1034 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Combined_Unitary()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Combined_Unitary ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper function to evaluate the unitary function and the unitary derivates.

Returns
Unitarty numpy matrix

Definition at line 1098 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Grad()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Optimization_Problem_Grad ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper function to evaluate the cost function an dthe gradient components.

Returns
Unitarty numpy matrix

Definition at line 973 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Reorder_Qubits()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Reorder_Qubits ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper method to reorder the qubits in the decomposition class.

Parameters

Definition at line 1267 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Convergence_Threshold()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Convergence_Threshold ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper method to set the threshold of convergence in the optimization processes.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Wrapper.
argsA tuple of the input arguments: tolerance (double) tolerance: The maximal allowed error of the optimization problem

Definition at line 753 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Cost_Function_Variant()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Cost_Function_Variant ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to set a variant for the cost function.

Input argument 0 stands for FROBENIUS_NORM, 1 for FROBENIUS_NORM_CORRECTION1, 2 for FROBENIUS_NORM_CORRECTION2, 3 for FROBENIUS_NORM_CORRECTION2_EXACT_DERIVATE

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
Returns
Returns with zero on success.

Definition at line 1467 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Debugfile()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Debugfile ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Set the debugfile name of the N_Qubit_Decomposition class.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: debugfile_name (string) debug: Set True to suppress the output messages of the decompostion into a file named debugfile_name, or False (deafult) otherwise.

Definition at line 691 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Global_Phase()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Global_Phase ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

sets the global phase to the new angle given

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argglobal_phase_factor_new_angle the angle to be set

Definition at line 366 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Iteration_Loops()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Iteration_Loops ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

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

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: identical_blocks (PyDict) identical_blocks: A dictionary {'n': iteration_loops} labeling the number of successive identical layers used in the subdecomposition at the disentangling of the n-th qubit.

Definition at line 600 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Max_Iterations()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Max_Iterations ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Set the number of maximum iterations.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
args(int) number of max iters.

Definition at line 644 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Max_Layer_Num()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Max_Layer_Num ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

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

Parameters
max_layer_numA dictionary {'n': max_layer_num} labeling the maximal number of the gate layers used in the subdecomposition.

Definition at line 550 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimization_Blocks()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimization_Blocks ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

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

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: tolerance (double) optimization_block: number of operators in one sub-layer of the optimization process

Definition at line 776 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimization_Tolerance()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimization_Tolerance ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Wrapper method to set the optimization tolerance of the optimization process during the decomposition.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: tolerance (double) tolerance: The maximal allowed error of the optimization problem

Definition at line 728 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimized_Parameters()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimized_Parameters ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Extract the optimized parameters.

Parameters
start_indexThe index of the first inverse gate

Definition at line 501 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimizer()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Optimizer ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to set custom gate structure for the decomposition.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
Returns
Returns with zero on success.

Definition at line 1372 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Project_Name()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Project_Name ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

set project name

Parameters
project_name_newnew string to be set as project name

Definition at line 820 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Trace_Offset()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Trace_Offset ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to set the trace offset used in the cost function.

In this case Tr(A) = sum_(i-offset=j) A_{ij}

Returns
Returns with zero on success.

Definition at line 1517 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Unitary()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Unitary ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Definition at line 1229 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Verbose()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_set_Verbose ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args 
)
static

Set the verbosity of the N_Qubit_Decomposition class.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: verbose (int) verbose: Set False to suppress the output messages of the decompostion, or True (deafult) otherwise.

Definition at line 667 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Start_Decomposition()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Start_Decomposition ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition.

Parameters
selfA pointer pointing to an instance of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.
argsA tuple of the input arguments: finalize_decomp (bool), prepare_export (bool)
kwdsA tuple of keywords

Definition at line 293 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Upload_Umtx_to_DFE()

static PyObject* qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Upload_Umtx_to_DFE ( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper self)
static

Call to upload the unitary to the DFE.

(Has no effect for non-DFE builds)

Definition at line 1593 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ release_N_Qubit_Decomposition_Tabu_Search()

void release_N_Qubit_Decomposition_Tabu_Search ( N_Qubit_Decomposition_Tabu_Search instance)

Call to deallocate an instance of N_Qubit_Decomposition_Tabu_Search class.

Parameters
ptrA pointer pointing to an instance of N_Qubit_Decomposition class.

Definition at line 89 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_members

PyMemberDef qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_members[]
static
Initial value:
= {
{NULL}
}

Structure containing metadata about the members of class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 1748 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_methods

PyMethodDef qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_methods[]
static

Structure containing metadata about the methods of class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 1755 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Module

PyModuleDef qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Module
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
"qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper",
"Python binding for QGD N_Qubit_Decomposition class",
-1,
}

Structure containing metadata about the module.

Definition at line 1951 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.

◆ qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Type

PyTypeObject qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper_Type
static

A structure describing the type of the class qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.

Definition at line 1879 of file qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp.