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

Go to the source code of this file.

Classes

struct  qgd_nn_Wrapper
 Type definition of the qgd_nn_Wrapper Python class of the qgd_nn_Wrapper module. More...
 

Macros

#define PY_SSIZE_T_CLEAN
 

Functions

NNcreate_NN ()
 Creates an instance of class NN and return with a pointer pointing to the class instance (C++ linking is needed) More...
 
PyMODINIT_FUNC PyInit_qgd_nn_Wrapper (void)
 Method called when the Python module is initialized. More...
 
static void qgd_nn_Wrapper_dealloc (qgd_nn_Wrapper *self)
 Method called when a python instance of the class qgd_nn_Wrapper is destroyed. More...
 
static PyObject * qgd_nn_Wrapper_get_nn_chanels (qgd_nn_Wrapper *self, PyObject *args, PyObject *kwds)
 Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition. More...
 
static int qgd_nn_Wrapper_init (qgd_nn_Wrapper *self, PyObject *args, PyObject *kwds)
 Method called when a python instance of the class qgd_nn_Wrapper is initialized. More...
 
static PyObject * qgd_nn_Wrapper_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 Method called when a python instance of the class qgd_nn_Wrapper is allocated. More...
 
void release_NN (NN *instance)
 Call to deallocate an instance of N_Qubit_Decomposition_adaptive class. More...
 

Variables

static PyMemberDef qgd_nn_Wrapper_members []
 Structure containing metadata about the members of class qgd_nn_Wrapper. More...
 
static PyMethodDef qgd_nn_Wrapper_methods []
 Structure containing metadata about the methods of class qgd_nn_Wrapper. More...
 
static PyModuleDef qgd_nn_Wrapper_Module
 Structure containing metadata about the module. More...
 
static PyTypeObject qgd_nn_Wrapper_Type
 A structure describing the type of the class qgd_nn_Wrapper. More...
 

Macro Definition Documentation

◆ PY_SSIZE_T_CLEAN

#define PY_SSIZE_T_CLEAN

Definition at line 27 of file qgd_nn_Wrapper.cpp.

Function Documentation

◆ create_NN()

NN* create_NN ( )

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

Returns
Return with a void pointer pointing to an instance of NN class.

Definition at line 59 of file qgd_nn_Wrapper.cpp.

Here is the caller graph for this function:

◆ PyInit_qgd_nn_Wrapper()

PyMODINIT_FUNC PyInit_qgd_nn_Wrapper ( void  )

Method called when the Python module is initialized.

Definition at line 361 of file qgd_nn_Wrapper.cpp.

◆ qgd_nn_Wrapper_dealloc()

static void qgd_nn_Wrapper_dealloc ( qgd_nn_Wrapper self)
static

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

Parameters
selfA pointer pointing to an instance of class qgd_nn_Wrapper.

Definition at line 90 of file qgd_nn_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_nn_Wrapper_get_nn_chanels()

static PyObject* qgd_nn_Wrapper_get_nn_chanels ( qgd_nn_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_nn_Wrapper.
argsA tuple of the input arguments: finalize_decomp (bool), prepare_export (bool)
kwdsA tuple of keywords

Definition at line 163 of file qgd_nn_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_nn_Wrapper_init()

static int qgd_nn_Wrapper_init ( qgd_nn_Wrapper self,
PyObject *  args,
PyObject *  kwds 
)
static

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

Parameters
selfA pointer pointing to an instance of the class qgd_nn_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 131 of file qgd_nn_Wrapper.cpp.

Here is the call graph for this function:

◆ qgd_nn_Wrapper_new()

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

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

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

Definition at line 109 of file qgd_nn_Wrapper.cpp.

◆ release_NN()

void release_NN ( NN instance)

Call to deallocate an instance of N_Qubit_Decomposition_adaptive class.

Parameters
ptrA pointer pointing to an instance of N_Qubit_Decomposition class.

Definition at line 72 of file qgd_nn_Wrapper.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ qgd_nn_Wrapper_members

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

Structure containing metadata about the members of class qgd_nn_Wrapper.

Definition at line 260 of file qgd_nn_Wrapper.cpp.

◆ qgd_nn_Wrapper_methods

PyMethodDef qgd_nn_Wrapper_methods[]
static
Initial value:
= {
{"get_NN_Chanels", (PyCFunction) qgd_nn_Wrapper_get_nn_chanels, METH_VARARGS | METH_KEYWORDS,
"Method to retrieve the data chanels for the neural network."
},
{NULL}
}
static PyObject * qgd_nn_Wrapper_get_nn_chanels(qgd_nn_Wrapper *self, PyObject *args, PyObject *kwds)
Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition.

Structure containing metadata about the methods of class qgd_nn_Wrapper.

Definition at line 267 of file qgd_nn_Wrapper.cpp.

◆ qgd_nn_Wrapper_Module

PyModuleDef qgd_nn_Wrapper_Module
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
"qgd_nn_Wrapper",
"Python binding for the neural network component of SQUANDER",
-1,
}

Structure containing metadata about the module.

Definition at line 349 of file qgd_nn_Wrapper.cpp.

◆ qgd_nn_Wrapper_Type

PyTypeObject qgd_nn_Wrapper_Type
static

A structure describing the type of the class qgd_nn_Wrapper.

Definition at line 277 of file qgd_nn_Wrapper.cpp.