Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
List of all members | Public Member Functions | Public Attributes | Protected Attributes
NN Class Reference

A class containing basic methods for the decomposition process. More...

#include <NN.h>

Public Member Functions

void create_randomized_parameters (int num_of_parameters, int qbit_num, int levels, Matrix_real &parameters, matrix_base< int8_t > &nontrivial_adaptive_layers)
 Call to construct random parameter, with limited number of non-trivial adaptive layers. More...
 
void get_nn_chanels (const Matrix &Umtx, const int &target_qbit, Matrix_real &chanels)
 call retrieve the channels for the neural network associated with a single unitary More...
 
void get_nn_chanels (int qbit_num, const Matrix &Umtx, Matrix_real &chanels)
 call retrieve the channels for the neural network associated with a single unitary More...
 
void get_nn_chanels (int qbit_num, int levels, Matrix_real &chanels, matrix_base< int8_t > &nontrivial_adaptive_layers)
 call retrieve the channels for the neural network associated with a single, randomly generated unitary More...
 
void get_nn_chanels (int qbit_num, int levels, int samples_num, Matrix_real &chanels, matrix_base< int8_t > &nontrivial_adaptive_layers)
 call retrieve the channels for the neural network associated with a single, randomly generated unitary More...
 
void get_nn_chanels_from_kernel (Matrix &kernel_up, Matrix &kernel_down, Matrix_real &chanels)
 call retrieve the channels for the neural network associated with a single 2x2 kernel More...
 
 NN ()
 Nullary constructor of the class. More...
 
 NN (std::vector< matrix_base< int >> topology_in)
 Constructor of the class. More...
 

Public Attributes

int tt
 number of gate blocks used in one shot of the optimization process More...
 

Protected Attributes

std::mt19937 gen
 Standard mersenne_twister_engine seeded with rd() More...
 
int num_threads
 Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.) More...
 
std::random_device rd
 Will be used to obtain a seed for the random number engine. More...
 
std::vector< matrix_base< int > > topology
 connectivity between the wubits More...
 

Detailed Description

A class containing basic methods for the decomposition process.

Definition at line 61 of file NN.h.

Constructor & Destructor Documentation

◆ NN() [1/2]

NN::NN ( )

Nullary constructor of the class.

Returns
An instance of the class

Definition at line 34 of file NN.cpp.

◆ NN() [2/2]

NN::NN ( std::vector< matrix_base< int >>  topology_in)

Constructor of the class.

Parameters
Thelist of conenctions between the qubits
Returns
An instance of the class

Definition at line 56 of file NN.cpp.

Member Function Documentation

◆ create_randomized_parameters()

void NN::create_randomized_parameters ( int  num_of_parameters,
int  qbit_num,
int  levels,
Matrix_real parameters,
matrix_base< int8_t > &  nontrivial_adaptive_layers 
)

Call to construct random parameter, with limited number of non-trivial adaptive layers.

Parameters
num_of_parametersThe number of parameters

Definition at line 82 of file NN.cpp.

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

◆ get_nn_chanels() [1/4]

void NN::get_nn_chanels ( const Matrix Umtx,
const int target_qbit,
Matrix_real chanels 
)

call retrieve the channels for the neural network associated with a single unitary

Parameters
UmtxA unitary of dimension dim x dim, where dim is a power of 2.
target_qbitThe target qubit for which the chanels are calculated
chanelsoutput array containing the chanels prepared for th eneural network. The array has dimensions [ dim/2, dim/2, 4 ] (dimension "4" stands for theta_up, phi, theta_down , lambda)

Definition at line 222 of file NN.cpp.

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

◆ get_nn_chanels() [2/4]

void NN::get_nn_chanels ( int  qbit_num,
const Matrix Umtx,
Matrix_real chanels 
)

call retrieve the channels for the neural network associated with a single unitary

Parameters
UmtxA unitary of dimension dim x dim, where dim is a power of 2.
chanelsoutput array containing the chanels prepared for th eneural network. The array has dimensions [ dim/2, dim/2, 4 ] (dimension "4" stands for theta_up, phi, theta_down , lambda)
qbit_numTh number of qubites
UmtxA unitary of dimension dim x dim, where dim is a power of 2.
chanelsoutput array containing the chanels prepared for th eneural network. The array has dimensions [ dim/2, dim/2, 4 ] (dimension "4" stands for theta_up, phi, theta_down , lambda)

Definition at line 306 of file NN.cpp.

Here is the call graph for this function:

◆ get_nn_chanels() [3/4]

void NN::get_nn_chanels ( int  qbit_num,
int  levels,
Matrix_real chanels,
matrix_base< int8_t > &  nontrivial_adaptive_layers 
)

call retrieve the channels for the neural network associated with a single, randomly generated unitary

Parameters
qbit_numThe number of qubits
levelsThe number of adaptive levels to be randomly constructed
chanlesoutput argument to return with an array containing the chanels prepared for the neural network. The array has dimensions [ dim/2, dim/2, 4 ] (dimension "4" stands for theta_up, phi, theta_down , lambda)
parametersoutput argument of the randomly created parameters

Definition at line 402 of file NN.cpp.

Here is the call graph for this function:

◆ get_nn_chanels() [4/4]

void NN::get_nn_chanels ( int  qbit_num,
int  levels,
int  samples_num,
Matrix_real chanels,
matrix_base< int8_t > &  nontrivial_adaptive_layers 
)

call retrieve the channels for the neural network associated with a single, randomly generated unitary

Parameters
qbit_numThe number of qubits
levelsThe number of adaptive levels to be randomly constructed
samples_numThe number of samples
chanlesoutput argument to return with an array containing the chanels prepared for the neural network. The array has dimensions [ samples_num, dim/2, dim/2, 4 ] (dimension "4" stands for theta_up, phi, theta_down , lambda)
parametersoutput argument of the randomly created parameters

Definition at line 463 of file NN.cpp.

Here is the call graph for this function:

◆ get_nn_chanels_from_kernel()

void NN::get_nn_chanels_from_kernel ( Matrix kernel_up,
Matrix kernel_down,
Matrix_real chanels 
)

call retrieve the channels for the neural network associated with a single 2x2 kernel

Returns
return with an 1x4 array containing the chanels prepared for the neural network. (dimension 4 stands for theta_up, phi, theta_down , lambda)

Definition at line 160 of file NN.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ gen

std::mt19937 NN::gen
protected

Standard mersenne_twister_engine seeded with rd()

Definition at line 75 of file NN.h.

◆ num_threads

int NN::num_threads
protected

Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.)

Definition at line 79 of file NN.h.

◆ rd

std::random_device NN::rd
protected

Will be used to obtain a seed for the random number engine.

Definition at line 73 of file NN.h.

◆ topology

std::vector<matrix_base<int> > NN::topology
protected

connectivity between the wubits

Definition at line 77 of file NN.h.

◆ tt

int NN::tt

number of gate blocks used in one shot of the optimization process

Definition at line 67 of file NN.h.


The documentation for this class was generated from the following files: