Quantum Gate Decomposer
v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
|
Base Class to store data of arrays and its properties. More...
#include <matrix_base.h>
Public Member Functions | |
void | conjugate () |
Call to conjugate (or un-conjugate) the matrix for CBLAS functions. More... | |
matrix_base< scalar > | copy () |
Call to create a copy of the matrix. More... | |
scalar * | get_data () |
Call to get the pointer to the stored data. More... | |
bool | is_conjugated () |
Call to get whether the matrix should be conjugated in CBLAS functions or not. More... | |
bool | is_transposed () |
Call to get whether the matrix should be conjugated in CBLAS functions or not. More... | |
matrix_base () | |
Default constructor of the class. More... | |
matrix_base (scalar *data_in, size_t rows_in, size_t cols_in) | |
Constructor of the class. More... | |
matrix_base (size_t rows_in, size_t cols_in) | |
Constructor of the class. More... | |
matrix_base (const matrix_base< scalar > &in) | |
Copy constructor of the class. More... | |
void | operator= (const matrix_base &mtx) |
Assignment operator. More... | |
scalar & | operator[] (size_t idx) |
Operator [] to access elements in array style (does not check the boundaries of the stored array) More... | |
void | print_matrix () |
Call to prints the stored matrix on the standard output. More... | |
void | release_data () |
Call to release the data stored by the matrix. More... | |
void | replace_data (scalar *data_in, bool owner_in) |
Call to replace the stored data by an another data array. More... | |
void | set_owner (bool owner_in) |
Call to set the current class instance to be (or not to be) the owner of the stored data array. More... | |
size_t | size () |
Call to get the number of the allocated elements. More... | |
void | transpose () |
Call to transpose (or un-transpose) the matrix for CBLAS functions. More... | |
~matrix_base () | |
Destructor of the class. More... | |
Public Attributes | |
size_t | cols |
The number of columns. More... | |
scalar * | data |
pointer to the stored data More... | |
size_t | rows |
The number of rows. More... | |
Protected Attributes | |
bool | conjugated |
logical variable indicating whether the matrix needs to be conjugated in CBLAS operations More... | |
bool | owner |
logical value indicating whether the class instance is the owner of the stored data or not. (If true, the data array is released in the destructor) More... | |
tbb::spin_mutex * | reference_mutex |
mutual exclusion to count the references for class instances referring to the same data. More... | |
int64_t * | references |
the number of the current references of the present object More... | |
bool | transposed |
logical variable indicating whether the matrix needs to be transposed in CBLAS operations More... | |
Base Class to store data of arrays and its properties.
Definition at line 19 of file matrix_base.h.
|
inline |
Default constructor of the class.
Definition at line 50 of file matrix_base.h.
|
inline |
Constructor of the class.
By default the created class instance would not be owner of the stored data.
data_in | The pointer pointing to the data |
rows_in | The number of rows in the stored matrix |
cols_in | The number of columns in the stored matrix |
Definition at line 82 of file matrix_base.h.
|
inline |
Constructor of the class.
Allocates data for matrix rows_in times cols_in. By default the created instance would be the owner of the stored data.
rows_in | The number of rows in the stored matrix |
cols_in | The number of columns in the stored matrix |
Definition at line 114 of file matrix_base.h.
|
inline |
Copy constructor of the class.
The new instance shares the stored memory with the input matrix. (Needed for TBB calls)
An | instance of class matrix to be copied. |
Definition at line 147 of file matrix_base.h.
|
inline |
Destructor of the class.
Definition at line 173 of file matrix_base.h.
|
inline |
Call to conjugate (or un-conjugate) the matrix for CBLAS functions.
Definition at line 188 of file matrix_base.h.
|
inline |
Call to create a copy of the matrix.
Definition at line 351 of file matrix_base.h.
|
inline |
Call to get the pointer to the stored data.
Definition at line 221 of file matrix_base.h.
|
inline |
Call to get whether the matrix should be conjugated in CBLAS functions or not.
Definition at line 181 of file matrix_base.h.
|
inline |
Call to get whether the matrix should be conjugated in CBLAS functions or not.
Definition at line 199 of file matrix_base.h.
|
inline |
Assignment operator.
mtx | An instance of class matrix_base |
Definition at line 306 of file matrix_base.h.
|
inline |
Operator [] to access elements in array style (does not check the boundaries of the stored array)
idx | the index of the element |
Definition at line 340 of file matrix_base.h.
|
inline |
Call to prints the stored matrix on the standard output.
Definition at line 384 of file matrix_base.h.
|
inline |
Call to release the data stored by the matrix.
(If the class instance was not the owner of the data, then the data pointer is simply set to NULL pointer.)
Definition at line 252 of file matrix_base.h.
|
inline |
Call to replace the stored data by an another data array.
If the class was the owner of the original data array, then it is released.
data_in | The data array to be set as a new storage. |
owner_in | Set true to set the current class instance to be the owner of the data array, or false otherwise. |
Definition at line 233 of file matrix_base.h.
|
inline |
Call to set the current class instance to be (or not to be) the owner of the stored data array.
owner_in | Set true to set the current class instance to be the owner of the data array, or false otherwise. |
Definition at line 295 of file matrix_base.h.
|
inline |
Call to get the number of the allocated elements.
Definition at line 374 of file matrix_base.h.
|
inline |
Call to transpose (or un-transpose) the matrix for CBLAS functions.
Definition at line 209 of file matrix_base.h.
size_t matrix_base< scalar >::cols |
The number of columns.
Definition at line 25 of file matrix_base.h.
|
protected |
logical variable indicating whether the matrix needs to be conjugated in CBLAS operations
Definition at line 32 of file matrix_base.h.
scalar* matrix_base< scalar >::data |
pointer to the stored data
Definition at line 27 of file matrix_base.h.
|
protected |
logical value indicating whether the class instance is the owner of the stored data or not. (If true, the data array is released in the destructor)
Definition at line 36 of file matrix_base.h.
|
protected |
mutual exclusion to count the references for class instances referring to the same data.
Definition at line 38 of file matrix_base.h.
|
protected |
the number of the current references of the present object
Definition at line 40 of file matrix_base.h.
size_t matrix_base< scalar >::rows |
The number of rows.
Definition at line 23 of file matrix_base.h.
|
protected |
logical variable indicating whether the matrix needs to be transposed in CBLAS operations
Definition at line 34 of file matrix_base.h.