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 "numpy_interface.h"
Go to the source code of this file.
Classes | |
struct | CH_Wrapper_Type |
struct | CNOT_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 174 of file gates_Wrapper.cpp.
Gate* create_controlled_gate | ( | int | qbit_num, |
int | target_qbit, | ||
int | control_qbit | ||
) |
Definition at line 77 of file gates_Wrapper.cpp.
Definition at line 70 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 91 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 646 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 555 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 409 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 226 of file gates_Wrapper.cpp.
|
static |
Extract the optimized parameters.
start_index | The index of the first inverse gate |
Definition at line 719 of file gates_Wrapper.cpp.
|
static |
Call to get the number of free parameters in the gate.
Definition at line 471 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 500 of file gates_Wrapper.cpp.
|
static |
Call to get the target qbit.
Definition at line 529 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 744 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 207 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 141 of file gates_Wrapper.cpp.
|
static |
Call to set the target qbit.
Definition at line 612 of file gates_Wrapper.cpp.
|
static |
Call to set the target qbit.
Definition at line 582 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 784 of file gates_Wrapper.cpp.
|
static |
Call to apply the gate operation on an input state or matrix.
Definition at line 306 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 107 of file gates_Wrapper.cpp.
PyMODINIT_FUNC PyInit_gates_Wrapper | ( | void | ) |
Method called when the Python module is initialized.
Definition at line 1297 of file gates_Wrapper.cpp.
|
static |
Definition at line 1254 of file gates_Wrapper.cpp.
|
static |
Definition at line 1255 of file gates_Wrapper.cpp.
|
static |
Definition at line 1257 of file gates_Wrapper.cpp.
|
static |
Definition at line 1256 of file gates_Wrapper.cpp.
|
static |
Structure containing metadata about the members of class qgd_CH_Wrapper.
Definition at line 1029 of file gates_Wrapper.cpp.
|
static |
Structure containing metadata about the methods of class qgd_U3.
Definition at line 982 of file gates_Wrapper.cpp.
|
static |
Definition at line 1057 of file gates_Wrapper.cpp.
|
static |
Structure containing metadata about the module.
Definition at line 1285 of file gates_Wrapper.cpp.
|
static |
Definition at line 1258 of file gates_Wrapper.cpp.
|
static |
Definition at line 1272 of file gates_Wrapper.cpp.
|
static |
Definition at line 1259 of file gates_Wrapper.cpp.
|
static |
Definition at line 1260 of file gates_Wrapper.cpp.
|
static |
Definition at line 1261 of file gates_Wrapper.cpp.
|
static |
Definition at line 1262 of file gates_Wrapper.cpp.
|
static |
Definition at line 1263 of file gates_Wrapper.cpp.
|
static |
Definition at line 1270 of file gates_Wrapper.cpp.
|
static |
Definition at line 1271 of file gates_Wrapper.cpp.
|
static |
Definition at line 1264 of file gates_Wrapper.cpp.
|
static |
Definition at line 1265 of file gates_Wrapper.cpp.
|
static |
Definition at line 1266 of file gates_Wrapper.cpp.
|
static |
Definition at line 1267 of file gates_Wrapper.cpp.
|
static |
Definition at line 1268 of file gates_Wrapper.cpp.
|
static |
Definition at line 1269 of file gates_Wrapper.cpp.