Sequential Quantum Gate Decomposer
v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
#include <Python.h>
#include "structmember.h"
#include "Gate.h"
#include "CH.h"
#include "CNOT.h"
#include "CZ.h"
#include "CRY.h"
#include "H.h"
#include "RX.h"
#include "RY.h"
#include "RZ.h"
#include "SX.h"
#include "SYC.h"
#include "U1.h"
#include "U2.h"
#include "U3.h"
#include "X.h"
#include "Y.h"
#include "Z.h"
#include "T.h"
#include "Tdg.h"
#include "R.h"
#include "CR.h"
#include "CROT.h"
#include "numpy_interface.h"
Go to the source code of this file.
Classes | |
struct | CH_Wrapper_Type |
struct | CNOT_Wrapper_Type |
struct | CR_Wrapper_Type |
struct | CROT_Wrapper_Type |
struct | CRY_Wrapper_Type |
struct | CZ_Wrapper_Type |
struct | Gate_Wrapper |
Type definition of the Gate_Wrapper Python class of the gates module. More... | |
struct | Gate_Wrapper_Type_tmp |
struct | H_Wrapper_Type |
struct | R_Wrapper_Type |
struct | RX_Wrapper_Type |
struct | RY_Wrapper_Type |
struct | RZ_Wrapper_Type |
struct | SX_Wrapper_Type |
struct | SYC_Wrapper_Type |
struct | T_Wrapper_Type |
struct | Tdg_Wrapper_Type |
struct | U1_Wrapper_Type |
struct | U2_Wrapper_Type |
struct | U3_Wrapper_Type |
struct | X_Wrapper_Type |
struct | Y_Wrapper_Type |
struct | Z_Wrapper_Type |
Macros | |
#define | PY_SSIZE_T_CLEAN |
Functions | |
template<typename GateT > | |
static PyObject * | controlled_gate_Wrapper_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
Method called when a python instance of a controlled gate class is initialized. More... | |
template<typename GateT > | |
Gate * | create_controlled_gate (int qbit_num, int target_qbit, int control_qbit) |
template<typename GateT > | |
Gate * | create_gate (int qbit_num, int target_qbit) |
static void | Gate_Wrapper_dealloc (Gate_Wrapper *self) |
Method called when a python instance of the class Gate_Wrapper is destroyed. More... | |
static PyObject * | Gate_Wrapper_Extract_Parameters (Gate_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 * | Gate_Wrapper_get_Control_Qbit (Gate_Wrapper *self) |
Call to get the control qbit (returns with -1 if no control qbit is used in the gate) More... | |
static PyObject * | Gate_Wrapper_get_Gate_Kernel (Gate_Wrapper *self, PyObject *args, PyObject *kwds) |
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space. More... | |
static PyObject * | Gate_Wrapper_get_Matrix (Gate_Wrapper *self, PyObject *args, PyObject *kwds) |
Call te extract t he matric representation of the gate. More... | |
static PyObject * | Gate_Wrapper_get_Name (Gate_Wrapper *self) |
Extract the optimized parameters. More... | |
static PyObject * | Gate_Wrapper_get_Parameter_Num (Gate_Wrapper *self) |
Call to get the number of free parameters in the gate. More... | |
static PyObject * | Gate_Wrapper_get_Parameter_Start_Index (Gate_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 * | Gate_Wrapper_get_Target_Qbit (Gate_Wrapper *self) |
Call to get the target qbit. More... | |
static PyObject * | Gate_Wrapper_getstate (Gate_Wrapper *self) |
Method to extract the stored quantum gate in a human-readable data serialized and pickle-able format. More... | |
static int | Gate_Wrapper_init (Gate_Wrapper *self, PyObject *args, PyObject *kwds) |
Method called when a python instance of a non-controlled gate class is initialized. More... | |
template<typename GateT > | |
static PyObject * | Gate_Wrapper_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
Method called when a python instance of a non-controlled gate class is initialized. More... | |
static PyObject * | Gate_Wrapper_set_Control_Qbit (Gate_Wrapper *self, PyObject *args) |
Call to set the target qbit. More... | |
static PyObject * | Gate_Wrapper_set_Target_Qbit (Gate_Wrapper *self, PyObject *args) |
Call to set the target qbit. More... | |
static PyObject * | Gate_Wrapper_setstate (Gate_Wrapper *self, PyObject *args) |
Call to set the state of quantum gate from a human-readable data serialized and pickle-able format. More... | |
static PyObject * | Gate_Wrapper_Wrapper_apply_to (Gate_Wrapper *self, PyObject *args, PyObject *kwds) |
Call to apply the gate operation on an input state or matrix. More... | |
static PyObject * | generic_Gate_Wrapper_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
Method called when a python instance of the class qgd_CH_Wrapper is allocated. More... | |
PyMODINIT_FUNC | PyInit_gates_Wrapper (void) |
Method called when the Python module is initialized. More... | |
#define PY_SSIZE_T_CLEAN |
Definition at line 27 of file gates_Wrapper.cpp.
|
static |
Method called when a python instance of a controlled gate class is initialized.
self | A pointer pointing to an instance of the class Gate_Wrapper. |
args | A tuple of the input arguments: qbit_num (int), target_qbit (int), control_qbit (int) |
kwds | A tuple of keywords |
Definition at line 176 of file gates_Wrapper.cpp.
Gate* create_controlled_gate | ( | int | qbit_num, |
int | target_qbit, | ||
int | control_qbit | ||
) |
Definition at line 79 of file gates_Wrapper.cpp.
Definition at line 72 of file gates_Wrapper.cpp.
|
static |
Method called when a python instance of the class Gate_Wrapper is destroyed.
self | A pointer pointing to an instance of class Gate_Wrapper. |
Definition at line 93 of file gates_Wrapper.cpp.
|
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 648 of file gates_Wrapper.cpp.
|
static |
Call to get the control qbit (returns with -1 if no control qbit is used in the gate)
Definition at line 557 of file gates_Wrapper.cpp.
|
static |
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space.
ThetaOver2 | Real parameter standing for the parameter theta (optional). |
Phi | Real parameter standing for the parameter phi (optional). |
Lambda | Real parameter standing for the parameter lambda (optional). |
Definition at line 411 of file gates_Wrapper.cpp.
|
static |
Call te extract t he matric representation of the gate.
start_index | The index of the first inverse gate |
Definition at line 228 of file gates_Wrapper.cpp.
|
static |
Extract the optimized parameters.
start_index | The index of the first inverse gate |
Definition at line 721 of file gates_Wrapper.cpp.
|
static |
Call to get the number of free parameters in the gate.
Definition at line 473 of file gates_Wrapper.cpp.
|
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.
Definition at line 502 of file gates_Wrapper.cpp.
|
static |
Call to get the target qbit.
Definition at line 531 of file gates_Wrapper.cpp.
|
static |
Method to extract the stored quantum gate in a human-readable data serialized and pickle-able format.
Definition at line 746 of file gates_Wrapper.cpp.
|
static |
Method called when a python instance of a non-controlled gate class is initialized.
self | A pointer pointing to an instance of the class Gate_Wrapper. |
args | A tuple of the input arguments: qbit_num (int), target_qbit (int) |
kwds | A tuple of keywords |
Definition at line 209 of file gates_Wrapper.cpp.
|
static |
Method called when a python instance of a non-controlled gate class is initialized.
self | A pointer pointing to an instance of the class Gate_Wrapper. |
args | A tuple of the input arguments: qbit_num (int), target_qbit (int) |
kwds | A tuple of keywords |
Definition at line 143 of file gates_Wrapper.cpp.
|
static |
Call to set the target qbit.
Definition at line 614 of file gates_Wrapper.cpp.
|
static |
Call to set the target qbit.
Definition at line 584 of file gates_Wrapper.cpp.
|
static |
Call to set the state of quantum gate from a human-readable data serialized and pickle-able format.
Definition at line 786 of file gates_Wrapper.cpp.
|
static |
Call to apply the gate operation on an input state or matrix.
Definition at line 308 of file gates_Wrapper.cpp.
|
static |
Method called when a python instance of the class qgd_CH_Wrapper is allocated.
type | A pointer pointing to a structure describing the type of the class qgd_CH_Wrapper. |
Definition at line 109 of file gates_Wrapper.cpp.
PyMODINIT_FUNC PyInit_gates_Wrapper | ( | void | ) |
Method called when the Python module is initialized.
Definition at line 1330 of file gates_Wrapper.cpp.
|
static |
Definition at line 1285 of file gates_Wrapper.cpp.
|
static |
Definition at line 1286 of file gates_Wrapper.cpp.
|
static |
Definition at line 1304 of file gates_Wrapper.cpp.
|
static |
Definition at line 1305 of file gates_Wrapper.cpp.
|
static |
Definition at line 1288 of file gates_Wrapper.cpp.
|
static |
Definition at line 1287 of file gates_Wrapper.cpp.
|
static |
Structure containing metadata about the members of class qgd_CH_Wrapper.
Definition at line 1040 of file gates_Wrapper.cpp.
|
static |
Structure containing metadata about the methods of class qgd_U3.
Definition at line 993 of file gates_Wrapper.cpp.
|
static |
Definition at line 1068 of file gates_Wrapper.cpp.
|
static |
Structure containing metadata about the module.
Definition at line 1318 of file gates_Wrapper.cpp.
|
static |
Definition at line 1289 of file gates_Wrapper.cpp.
|
static |
Definition at line 1303 of file gates_Wrapper.cpp.
|
static |
Definition at line 1290 of file gates_Wrapper.cpp.
|
static |
Definition at line 1291 of file gates_Wrapper.cpp.
|
static |
Definition at line 1292 of file gates_Wrapper.cpp.
|
static |
Definition at line 1293 of file gates_Wrapper.cpp.
|
static |
Definition at line 1294 of file gates_Wrapper.cpp.
|
static |
Definition at line 1301 of file gates_Wrapper.cpp.
|
static |
Definition at line 1302 of file gates_Wrapper.cpp.
|
static |
Definition at line 1295 of file gates_Wrapper.cpp.
|
static |
Definition at line 1296 of file gates_Wrapper.cpp.
|
static |
Definition at line 1297 of file gates_Wrapper.cpp.
|
static |
Definition at line 1298 of file gates_Wrapper.cpp.
|
static |
Definition at line 1299 of file gates_Wrapper.cpp.
|
static |
Definition at line 1300 of file gates_Wrapper.cpp.