Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Classes | Functions
Gates_block.h File Reference

Header file for a class responsible for grouping gates into subcircuits. (Subcircuits can be nested) More...

#include <vector>
#include <map>
#include <tbb/spin_mutex.h>
#include "common.h"
#include "matrix_real.h"
#include "matrix_real_any.h"
#include "matrix_any.h"
#include "CROT.h"
#include "Gate.h"
#include "utils.hpp"
Include dependency graph for Gates_block.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Gates_block
 A class responsible for grouping two-qubit (CNOT,CZ,CH) and one-qubit gates into layers. More...
 

Functions

void export_gate_list_to_binary (Matrix_real &parameters, Gates_block *gates_block, const std::string &filename, int verbosity=3)
 ????????? More...
 
void export_gate_list_to_binary (Matrix_real &parameters, Gates_block *gates_block, FILE *pFile, int verbosity=3)
 ????????? More...
 
Gates_blockimport_gate_list_from_binary (Matrix_real &parameters, const std::string &filename, int verbosity=3)
 ????????? More...
 
Gates_blockimport_gate_list_from_binary (Matrix_real &parameters, FILE *pFile, int verbosity=3)
 ????????? More...
 
Matrix_real inverse_reverse_parameters (const Matrix_real &v_in, std::vector< Gate *>::iterator gates_it, int num_of_gates)
 Call to inverse-reverse the order of the parameters in an array. More...
 
bool is_qbit_present (std::vector< int > involved_qbits, int new_qbit, int num_of_qbits)
 Call to check whether the given qubit is involved in the sub-circuit or not. More...
 
Matrix_real reverse_parameters (const Matrix_real &v_in, std::vector< Gate *>::iterator gates_it, int num_of_gates)
 Call to reverse the order of the parameters in an array. More...
 

Detailed Description

Header file for a class responsible for grouping gates into subcircuits. (Subcircuits can be nested)

Definition in file Gates_block.h.

Function Documentation

◆ export_gate_list_to_binary() [1/2]

void export_gate_list_to_binary ( Matrix_real parameters,
Gates_block gates_block,
const std::string &  filename,
int  verbosity 
)

?????????

Returns
Return with ?????????

?????????

Parameters
parametersParameters of corresponding to the circuit
gates_blockThe Squander circuit.
filenameFilename into which export the circuit
verbosityThe verbosity parameter

Definition at line 4807 of file Gates_block.cpp.

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

◆ export_gate_list_to_binary() [2/2]

void export_gate_list_to_binary ( Matrix_real parameters,
Gates_block gates_block,
FILE *  pFile,
int  verbosity 
)

?????????

Returns
Return with ?????????

?????????

Parameters
parametersParameters of corresponding to the circuit
gates_blockThe Squander circuit.
pFilePointer to the opened file.
verbosityThe verbosity parameter

Definition at line 4845 of file Gates_block.cpp.

Here is the call graph for this function:

◆ import_gate_list_from_binary() [1/2]

Gates_block* import_gate_list_from_binary ( Matrix_real parameters,
const std::string &  filename,
int  verbosity 
)

?????????

Returns
Return with ?????????

?????????

Parameters
parametersParameters of corresponding to the circuit (the loaded parameters are returned via this argument)
filenameThe file containing the binary file.
verbosityThe verbosity parameter

Definition at line 4934 of file Gates_block.cpp.

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

◆ import_gate_list_from_binary() [2/2]

Gates_block* import_gate_list_from_binary ( Matrix_real parameters,
FILE *  pFile,
int  verbosity 
)

?????????

Returns
Return with ?????????

?????????

Parameters
parametersParameters of corresponding to the circuit (the loaded parameters are returned via this argument)
pFilePointer to the binary file.
verbosityThe verbosity parameter

Definition at line 4970 of file Gates_block.cpp.

Here is the call graph for this function:

◆ inverse_reverse_parameters()

Matrix_real inverse_reverse_parameters ( const Matrix_real parameters_in,
std::vector< Gate *>::iterator  gates_it,
int  num_of_gates 
)

Call to inverse-reverse the order of the parameters in an array.

Parameters
v_inThe real input vector.
gatesThe associated list of gates. (does not get reversed)
Returns
Return with the reversed array
Parameters
parameters_inThe real input vector.
gates_itIterator over the gates. (does not get reversed)
Returns
Return with the reversed array

Definition at line 5455 of file Gates_block.cpp.

Here is the call graph for this function:

◆ is_qbit_present()

bool is_qbit_present ( std::vector< int involved_qubits,
int  new_qbit,
int  num_of_qbits 
)

Call to check whether the given qubit is involved in the sub-circuit or not.

Parameters
involved_qubitsA list of qubits
new_qbitThe qubit to be checked
num_of_qbitsThe number of qubits.

Definition at line 864 of file Gates_block.cpp.

◆ reverse_parameters()

Matrix_real reverse_parameters ( const Matrix_real parameters_in,
std::vector< Gate *>::iterator  gates_it,
int  num_of_gates 
)

Call to reverse the order of the parameters in an array.

Parameters
v_inThe real input vector.
gatesThe associated list of gates. (does not get reversed)
Returns
Return with the reversed array
Parameters
parameters_inThe real input vector.
gates_itIterator over the gates. (does not get reversed)
Returns
Return with the reversed array

Definition at line 5357 of file Gates_block.cpp.

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