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
functor_submtx_cost_fnc Class Reference

Function operator class to calculate the partial cost function derived from the individual products of the submatrices. More...

#include <Sub_Matrix_Decomposition_Cost_Function.h>

Inheritance diagram for functor_submtx_cost_fnc:
Inheritance graph
[legend]

Public Member Functions

 functor_submtx_cost_fnc (std::vector< Matrix, tbb::cache_aligned_allocator< Matrix >> *submatrices_in, tbb::combinable< double > *prod_cost_functions_in, int prod_num_in)
 Constructor of the class. More...
 
void operator() (int product_idx) const
 Operator to calculate the partial cost function labeled by product_idx. More...
 
void print (const std::stringstream &sstream, int verbose_level=1) const
 Call to print output messages in the function of the verbosity level. More...
 
void set_debugfile (std::string debugfile)
 Call to set the debugfile name. More...
 
void set_verbose (int verbose_in)
 Call to set the verbose attribute. More...
 

Public Attributes

bool debug
 Logical variable. Set true to write output messages to the 'debug.txt' file. More...
 
std::string debugfile_name
 String variable. Set the debug file name. More...
 
int verbose
 Set the verbosity level of the output messages. More...
 

Protected Attributes

tbb::combinable< double > * prod_cost_functions
 
int prod_num
 number of distinct submatix products More...
 
std::vector< Matrix, tbb::cache_aligned_allocator< Matrix > > * submatrices
 container storing the submatrices More...
 

Detailed Description

Function operator class to calculate the partial cost function derived from the individual products of the submatrices.

Definition at line 79 of file Sub_Matrix_Decomposition_Cost_Function.h.

Constructor & Destructor Documentation

◆ functor_submtx_cost_fnc()

functor_submtx_cost_fnc::functor_submtx_cost_fnc ( std::vector< Matrix, tbb::cache_aligned_allocator< Matrix >> *  submatrices_in,
tbb::combinable< double > *  prod_cost_functions_in,
int  prod_num_in 
)

Constructor of the class.

Parameters
submatrices_inThe array of the submatrices.
prod_cost_functions_inPreallocated array storing the calculated partial cost functions.
prod_num_inThe number of partial cost function values (equal to the number of distinct submatrix products.)
Returns
Returns with the instance of the class.

Definition at line 163 of file Sub_Matrix_Decomposition_Cost_Function.cpp.

Member Function Documentation

◆ operator()()

void functor_submtx_cost_fnc::operator() ( int  product_idx) const

Operator to calculate the partial cost function labeled by product_idx.

Parameters
product_idxThe index labeling the partial cost function to be calculated.

Definition at line 174 of file Sub_Matrix_Decomposition_Cost_Function.cpp.

Here is the call graph for this function:

◆ print()

void logging::print ( const std::stringstream &  sstream,
int  verbose_level = 1 
) const
inherited

Call to print output messages in the function of the verbosity level.

Parameters
sstreamThe stringstream input to store the output messages.
verbose_levelInteger input. High level means write more to the standart output, 0 means write nothing. The default value is set to 1.

Definition at line 55 of file logging.cpp.

◆ set_debugfile()

void logging::set_debugfile ( std::string  debugfile)
inherited

Call to set the debugfile name.

Parameters
debugfileString variable. Set the debugfile name.

Definition at line 95 of file logging.cpp.

Here is the caller graph for this function:

◆ set_verbose()

void logging::set_verbose ( int  verbose_in)
inherited

Call to set the verbose attribute.

Parameters
verbose_inInteger variable. Set the number to specify the verbosity level for output messages.

Definition at line 85 of file logging.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ debug

bool logging::debug
inherited

Logical variable. Set true to write output messages to the 'debug.txt' file.

Definition at line 53 of file logging.h.

◆ debugfile_name

std::string logging::debugfile_name
inherited

String variable. Set the debug file name.

Definition at line 56 of file logging.h.

◆ prod_cost_functions

tbb::combinable<double>* functor_submtx_cost_fnc::prod_cost_functions
protected

Definition at line 88 of file Sub_Matrix_Decomposition_Cost_Function.h.

◆ prod_num

int functor_submtx_cost_fnc::prod_num
protected

number of distinct submatix products

Definition at line 84 of file Sub_Matrix_Decomposition_Cost_Function.h.

◆ submatrices

std::vector<Matrix, tbb::cache_aligned_allocator<Matrix> >* functor_submtx_cost_fnc::submatrices
protected

container storing the submatrices

Definition at line 86 of file Sub_Matrix_Decomposition_Cost_Function.h.

◆ verbose

int logging::verbose
inherited

Set the verbosity level of the output messages.

Definition at line 50 of file logging.h.


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