Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Classes | Macros | Functions | Variables
qgd_Circuit_Wrapper.cpp File Reference
#include <Python.h>
#include "structmember.h"
#include "Gates_block.h"
#include "CZ.h"
#include "CH.h"
#include "CNOT.h"
#include "U1.h"
#include "U2.h"
#include "U3.h"
#include "RX.h"
#include "R.h"
#include "RY.h"
#include "CRY.h"
#include "CROT.h"
#include "CR.h"
#include "RZ.h"
#include "H.h"
#include "X.h"
#include "Y.h"
#include "Z.h"
#include "SX.h"
#include "SYC.h"
#include "UN.h"
#include "ON.h"
#include "Adaptive.h"
#include "Composite.h"
#include "numpy_interface.h"
Include dependency graph for qgd_Circuit_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_Gate
 Type definition of the qgd_Gate Python class of the qgd_Gate module. More...
 

Macros

#define PY_SSIZE_T_CLEAN
 

Functions

Gates_blockcreate_Circuit (int qbit_num)
 Creates an instance of class N_Qubit_Decomposition and return with a pointer pointing to the class instance (C++ linking is needed) More...
 
static PyObject * get_gate (Gates_block *circuit, int &idx)
 Call to get the metadata organised into Python dictionary of the idx-th gate. More...
 
PyMODINIT_FUNC PyInit_qgd_Circuit_Wrapper (void)
 Method called when the Python module is initialized. More...
 
static PyObject * qgd_Circuit_Wrapper_add_adaptive (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add an adaptive gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_CH (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a CH gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_Circuit (qgd_Circuit_Wrapper *self, PyObject *args)
 Wrapper function to add a block of operations to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_CNOT (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a CNOT gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_CR (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add an adaptive gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_CROT (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add an adaptive gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_CRY (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add an adaptive gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_CZ (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a CZ gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_H (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a Hadamard gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_R (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a R gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_RX (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a RX gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_RY (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a RY gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_RZ (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a RZ gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_SX (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a SX gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_SYC (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a Sycamore gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_T (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a T gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_Tdg (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a Tdg gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_U1 (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a U1 gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_U2 (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a U2 gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_U3 (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a U3 gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_X (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a X gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_Y (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a X gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_add_Z (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to add a X gate to the front of the gate structure. More...
 
static PyObject * qgd_Circuit_Wrapper_apply_to (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Call to apply the gate operation on the inut matrix. More...
 
static void qgd_Circuit_Wrapper_dealloc (qgd_Circuit_Wrapper *self)
 Method called when a python instance of the class qgd_Circuit_Wrapper is destroyed. More...
 
static PyObject * qgd_Circuit_Wrapper_Extract_Parameters (qgd_Circuit_Wrapper *self, PyObject *args)
 Call to extract the paramaters corresponding to the gate, from a parameter array associated to the circuit in which the gate is embedded. More...
 
static PyObject * qgd_Circuit_Wrapper_get_children (qgd_Circuit_Wrapper *self, PyObject *args)
 Wrapper function to get the indices of children gates. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Flat_Circuit (qgd_Circuit_Wrapper *self)
 Method to generate a flat circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_get_gate (qgd_Circuit_Wrapper *self, PyObject *args)
 Wrapper function to get a gate from the circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Gate_Nums (qgd_Circuit_Wrapper *self)
 Call to get the counts on the individual gates in the circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_get_gates (qgd_Circuit_Wrapper *self)
 Call to get the incorporated gates in a python list. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Matrix (qgd_Circuit_Wrapper *self, PyObject *args)
 Extract the optimized parameters. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Parameter_Num (qgd_Circuit_Wrapper *self)
 Get the number of free parameters in the gate structure used for the decomposition. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Parameter_Start_Index (qgd_Circuit_Wrapper *self)
 Call to get the starting index of the parameters in the parameter array corresponding to the circuit in which the current gate is incorporated. More...
 
static PyObject * qgd_Circuit_Wrapper_get_parents (qgd_Circuit_Wrapper *self, PyObject *args)
 Wrapper function to get the indices of parent gates. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Qbit_Num (qgd_Circuit_Wrapper *self)
 Call to retrieve the number of qubits in the circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Qbits (qgd_Circuit_Wrapper *self)
 Call to retrieve the list of qubits involved in the circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_get_Second_Renyi_Entropy (qgd_Circuit_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_Circuit_Wrapper_getstate (qgd_Circuit_Wrapper *self)
 Method to extract the stored quantum circuit in a human-readable data serialized and pickle-able format. More...
 
static int qgd_Circuit_Wrapper_init (qgd_Circuit_Wrapper *self, PyObject *args, PyObject *kwds)
 Method called when a python instance of the class qgd_Circuit_Wrapper is initialized. More...
 
static PyObject * qgd_Circuit_Wrapper_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 Method called when a python instance of the class qgd_Circuit_Wrapper is allocated. More...
 
static PyObject * qgd_Circuit_Wrapper_Remap_Qbits (qgd_Circuit_Wrapper *self, PyObject *args)
 Call to remap the qubits in the circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_set_Qbit_Num (qgd_Circuit_Wrapper *self, PyObject *args)
 Call to set the number of qubits in the circuit. More...
 
static PyObject * qgd_Circuit_Wrapper_setstate (qgd_Circuit_Wrapper *self, PyObject *args)
 Call to set the state of a quantum circuit from a human-readable data serialized and pickle-able format. More...
 
void release_Circuit (Gates_block *instance)
 Call to deallocate an instance of N_Qubit_Decomposition class. More...
 

Variables

static PyMemberDef qgd_Circuit_Wrapper_Members []
 Structure containing metadata about the members of class qgd_Circuit_Wrapper. More...
 
static PyMethodDef qgd_Circuit_Wrapper_Methods []
 
static PyModuleDef qgd_Circuit_Wrapper_Module
 Structure containing metadata about the module. More...
 
static PyTypeObject qgd_Circuit_Wrapper_Type
 A structure describing the type of the class Circuit. More...
 

Macro Definition Documentation

◆ PY_SSIZE_T_CLEAN

#define PY_SSIZE_T_CLEAN

Definition at line 27 of file qgd_Circuit_Wrapper.cpp.

Function Documentation

◆ create_Circuit()

Gates_block* create_Circuit ( int  qbit_num)

Creates an instance of class N_Qubit_Decomposition and return with a pointer pointing to the class instance (C++ linking is needed)

Parameters
qbit_numNumber of qubits spanning the unitary
Returns
Return with a void pointer pointing to an instance of N_Qubit_Decomposition class.

Definition at line 87 of file qgd_Circuit_Wrapper.cpp.

Here is the caller graph for this function:

◆ get_gate()

static PyObject* get_gate ( Gates_block circuit,
int idx 
)
static

Call to get the metadata organised into Python dictionary of the idx-th gate.

Parameters
circuitA pointer pointing to an instance of the class Gates_block.
idxLabels the idx-th gate.
Returns
Returns with a python dictionary containing the metadata of the idx-th gate

Definition at line 1519 of file qgd_Circuit_Wrapper.cpp.

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

◆ PyInit_qgd_Circuit_Wrapper()

PyMODINIT_FUNC PyInit_qgd_Circuit_Wrapper ( void  )

Method called when the Python module is initialized.

Definition at line 2815 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_adaptive()

static PyObject* qgd_Circuit_Wrapper_add_adaptive ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add an adaptive gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 865 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_CH()

static PyObject* qgd_Circuit_Wrapper_add_CH ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a CH gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: control_qbit (int), target_qbit (int)
kwdsA tuple of keywords

Definition at line 471 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_Circuit()

static PyObject* qgd_Circuit_Wrapper_add_Circuit ( qgd_Circuit_Wrapper self,
PyObject *  args 
)
static

Wrapper function to add a block of operations to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: Py_qgd_Circuit_Wrapper (PyObject) Py_qgd_Circuit_Wrapper: an instance of qgd_Circuit_Wrapper containing the custom gate structure

Definition at line 898 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_add_CNOT()

static PyObject* qgd_Circuit_Wrapper_add_CNOT ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a CNOT gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: control_qbit (int), target_qbit (int)
kwdsA tuple of keywords

Definition at line 403 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_CR()

static PyObject* qgd_Circuit_Wrapper_add_CR ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add an adaptive gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 802 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_CROT()

static PyObject* qgd_Circuit_Wrapper_add_CROT ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add an adaptive gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 833 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_CRY()

static PyObject* qgd_Circuit_Wrapper_add_CRY ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add an adaptive gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 770 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_CZ()

static PyObject* qgd_Circuit_Wrapper_add_CZ ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a CZ gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: control_qbit (int), target_qbit (int)
kwdsA tuple of keywords

Definition at line 437 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_H()

static PyObject* qgd_Circuit_Wrapper_add_H ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a Hadamard gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 539 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_R()

static PyObject* qgd_Circuit_Wrapper_add_R ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a R gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 307 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_RX()

static PyObject* qgd_Circuit_Wrapper_add_RX ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a RX gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 275 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_RY()

static PyObject* qgd_Circuit_Wrapper_add_RY ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a RY gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 339 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_RZ()

static PyObject* qgd_Circuit_Wrapper_add_RZ ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a RZ gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 371 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_SX()

static PyObject* qgd_Circuit_Wrapper_add_SX ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a SX gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 671 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_SYC()

static PyObject* qgd_Circuit_Wrapper_add_SYC ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a Sycamore gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: control_qbit (int), target_qbit (int)
kwdsA tuple of keywords

Definition at line 505 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_T()

static PyObject* qgd_Circuit_Wrapper_add_T ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a T gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 704 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_Tdg()

static PyObject* qgd_Circuit_Wrapper_add_Tdg ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a Tdg gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 737 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_U1()

static PyObject* qgd_Circuit_Wrapper_add_U1 ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a U1 gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 184 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_U2()

static PyObject* qgd_Circuit_Wrapper_add_U2 ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a U2 gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 214 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_U3()

static PyObject* qgd_Circuit_Wrapper_add_U3 ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a U3 gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 244 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_X()

static PyObject* qgd_Circuit_Wrapper_add_X ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a X gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 572 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_Y()

static PyObject* qgd_Circuit_Wrapper_add_Y ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a X gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 605 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_add_Z()

static PyObject* qgd_Circuit_Wrapper_add_Z ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Wrapper function to add a X gate to the front of the gate structure.

Parameters
selfA pointer pointing to an instance of the class Circuit.
argsA tuple of the input arguments: target_qbit (int)
kwdsA tuple of keywords

Definition at line 638 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_apply_to()

static PyObject* qgd_Circuit_Wrapper_apply_to ( qgd_Circuit_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

Call to apply the gate operation on the inut matrix.

Definition at line 1115 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_dealloc()

static void qgd_Circuit_Wrapper_dealloc ( qgd_Circuit_Wrapper self)
static

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

Parameters
selfA pointer pointing to an instance of class qgd_Circuit_Wrapper.

Definition at line 113 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_Extract_Parameters()

static PyObject* qgd_Circuit_Wrapper_Extract_Parameters ( qgd_Circuit_Wrapper self,
PyObject *  args 
)
static

Call to extract the paramaters corresponding to the gate, from a parameter array associated to the circuit in which the gate is embedded.

Definition at line 2263 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_children()

static PyObject* qgd_Circuit_Wrapper_get_children ( qgd_Circuit_Wrapper self,
PyObject *  args 
)
static

Wrapper function to get the indices of children gates.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: gate: the gate for which we are retriving the children

Definition at line 2199 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_Flat_Circuit()

static PyObject* qgd_Circuit_Wrapper_get_Flat_Circuit ( qgd_Circuit_Wrapper self)
static

Method to generate a flat circuit.

A flat circuit is a circuit does not containing subcircuits: there are no Gates_block instances (containing subcircuits) in the resulting circuit. If the original circuit contains subcircuits, the gates in the subcircuits are directly incorporated in the resulting flat circuit.

Definition at line 2315 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_gate()

static PyObject* qgd_Circuit_Wrapper_get_gate ( qgd_Circuit_Wrapper self,
PyObject *  args 
)
static

Wrapper function to get a gate from the circuit.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: idx (int) idx: labels the idx-th gate.

Definition at line 2030 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_Gate_Nums()

static PyObject* qgd_Circuit_Wrapper_get_Gate_Nums ( qgd_Circuit_Wrapper self)
static

Call to get the counts on the individual gates in the circuit.

Definition at line 2049 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_get_gates()

static PyObject* qgd_Circuit_Wrapper_get_gates ( qgd_Circuit_Wrapper self)
static

Call to get the incorporated gates in a python list.

Definition at line 2093 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_Matrix()

static PyObject* qgd_Circuit_Wrapper_get_Matrix ( qgd_Circuit_Wrapper self,
PyObject *  args 
)
static

Extract the optimized parameters.

Parameters
start_indexThe index of the first inverse gate

Definition at line 1062 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_Parameter_Num()

static PyObject* qgd_Circuit_Wrapper_get_Parameter_Num ( qgd_Circuit_Wrapper self)
static

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

Definition at line 1102 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_get_Parameter_Start_Index()

static PyObject* qgd_Circuit_Wrapper_get_Parameter_Start_Index ( qgd_Circuit_Wrapper self)
static

Call to get the starting index of the parameters in the parameter array corresponding to the circuit in which the current gate is incorporated.

Returns
Returns with the starting index

Definition at line 2574 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_get_parents()

static PyObject* qgd_Circuit_Wrapper_get_parents ( qgd_Circuit_Wrapper self,
PyObject *  args 
)
static

Wrapper function to get the indices of parent gates.

Parameters
selfA pointer pointing to an instance of the class qgd_Circuit_Wrapper.
argsA tuple of the input arguments: gate: the gate for which we are retriving the parents

Definition at line 2131 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_get_Qbit_Num()

static PyObject* qgd_Circuit_Wrapper_get_Qbit_Num ( qgd_Circuit_Wrapper self)
static

Call to retrieve the number of qubits in the circuit.

Definition at line 1315 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_get_Qbits()

static PyObject* qgd_Circuit_Wrapper_get_Qbits ( qgd_Circuit_Wrapper self)
static

Call to retrieve the list of qubits involved in the circuit.

Definition at line 1382 of file qgd_Circuit_Wrapper.cpp.

◆ qgd_Circuit_Wrapper_get_Second_Renyi_Entropy()

static PyObject* qgd_Circuit_Wrapper_get_Second_Renyi_Entropy ( qgd_Circuit_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 1219 of file qgd_Circuit_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_Circuit_Wrapper_getstate()

static PyObject* qgd_Circuit_Wrapper_getstate ( static

A structure describing the type of the class Circuit.

Definition at line 2732 of file qgd_Circuit_Wrapper.cpp.