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 | Private Attributes
Matrix_real Class Reference

Class to store data of complex arrays and its properties. More...

#include <matrix_real.h>

Inheritance diagram for Matrix_real:
Inheritance graph
[legend]

Public Member Functions

void conjugate ()
 Call to conjugate (or un-conjugate) the matrix for CBLAS functions. More...
 
Matrix_real copy () const
 Call to create a copy of the matrix. More...
 
void ensure_aligned ()
 
double * get_data () const
 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...
 
bool isnan ()
 Call to check the array for NaN entries. More...
 
 Matrix_real ()
 Default constructor of the class. More...
 
 Matrix_real (double *data_in, int rows_in, int cols_in)
 Constructor of the class. More...
 
 Matrix_real (double *data_in, int rows_in, int cols_in, int stride_in)
 Constructor of the class. More...
 
 Matrix_real (int rows_in, int cols_in)
 Constructor of the class. More...
 
 Matrix_real (int rows_in, int cols_in, int stride_in)
 Constructor of the class. More...
 
 Matrix_real (const Matrix_real &in)
 Copy constructor of the class. More...
 
double & operator[] (int idx) const
 Operator [] to access elements in array style (does not check the boundaries of the stored array) More...
 
void print_matrix () const
 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 (double *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...
 
int size () const
 Call to get the number of the allocated elements. More...
 
void transpose ()
 Call to transpose (or un-transpose) the matrix for CBLAS functions. More...
 

Public Attributes

int cols
 The number of columns. More...
 
double * data
 pointer to the stored data More...
 
int rows
 The number of rows. More...
 
int stride
 The column stride of the array. (The array elements in one row are a_0, a_1, ... a_{cols-1}, 0, 0, 0, 0. The number of zeros is stride-cols) 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...
 

Private Attributes

char padding [CACHELINE-48]
 padding class object to cache line borders More...
 

Detailed Description

Class to store data of complex arrays and its properties.

Compatible with the Picasso numpy interface.

Definition at line 39 of file matrix_real.h.

Constructor & Destructor Documentation

◆ Matrix_real() [1/6]

Matrix_real::Matrix_real ( )

Default constructor of the class.

Returns
Returns with the instance of the class.

Definition at line 35 of file matrix_real.cpp.

Here is the caller graph for this function:

◆ Matrix_real() [2/6]

Matrix_real::Matrix_real ( double *  data_in,
int  rows_in,
int  cols_in 
)

Constructor of the class.

By default the created class instance would not be owner of the stored data.

Parameters
data_inThe pointer pointing to the data
rows_inThe number of rows in the stored matrix
cols_inThe number of columns in the stored matrix
Returns
Returns with the instance of the class.

Definition at line 46 of file matrix_real.cpp.

◆ Matrix_real() [3/6]

Matrix_real::Matrix_real ( double *  data_in,
int  rows_in,
int  cols_in,
int  stride_in 
)

Constructor of the class.

By default the created class instance would not be owner of the stored data.

Parameters
data_inThe pointer pointing to the data
rows_inThe number of rows in the stored matrix
cols_inThe number of columns in the stored matrix
stride_inThe column stride of the matrix array (The array elements in one row are a_0, a_1, ... a_{cols-1}, 0, 0, 0, 0. The number of zeros is stride-cols)
Returns
Returns with the instance of the class.

Definition at line 59 of file matrix_real.cpp.

◆ Matrix_real() [4/6]

Matrix_real::Matrix_real ( int  rows_in,
int  cols_in 
)

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.

Parameters
rows_inThe number of rows in the stored matrix
cols_inThe number of columns in the stored matrix
Returns
Returns with the instance of the class.

Definition at line 70 of file matrix_real.cpp.

◆ Matrix_real() [5/6]

Matrix_real::Matrix_real ( int  rows_in,
int  cols_in,
int  stride_in 
)

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.

Parameters
rows_inThe number of rows in the stored matrix
cols_inThe number of columns in the stored matrix
stride_inThe column stride of the matrix array (The array elements in one row are a_0, a_1, ... a_{cols-1}, 0, 0, 0, 0. The number of zeros is stride-cols)
Returns
Returns with the instance of the class.

Definition at line 83 of file matrix_real.cpp.

◆ Matrix_real() [6/6]

Matrix_real::Matrix_real ( const Matrix_real in)

Copy constructor of the class.

The new instance shares the stored memory with the input matrix. (Needed for TBB calls)

Parameters
Aninstance of class matrix to be copied.

Definition at line 93 of file matrix_real.cpp.

Member Function Documentation

◆ conjugate()

void matrix_base< double >::conjugate ( )
inlineinherited

Call to conjugate (or un-conjugate) the matrix for CBLAS functions.

Definition at line 271 of file matrix_base.hpp.

◆ copy()

Matrix_real Matrix_real::copy ( ) const

Call to create a copy of the matrix.

Returns
Returns with the instance of the class.

Definition at line 104 of file matrix_real.cpp.

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

◆ ensure_aligned()

void matrix_base< double >::ensure_aligned ( )
inlineinherited

Definition at line 457 of file matrix_base.hpp.

◆ get_data()

double * matrix_base< double >::get_data ( ) const
inlineinherited

Call to get the pointer to the stored data.

Definition at line 304 of file matrix_base.hpp.

◆ is_conjugated()

bool matrix_base< double >::is_conjugated ( )
inlineinherited

Call to get whether the matrix should be conjugated in CBLAS functions or not.

Returns
Returns with true if the matrix should be conjugated in CBLAS functions or false otherwise.

Definition at line 264 of file matrix_base.hpp.

◆ is_transposed()

bool matrix_base< double >::is_transposed ( )
inlineinherited

Call to get whether the matrix should be conjugated in CBLAS functions or not.

Returns
Returns with true if the matrix should be conjugated in CBLAS functions or false otherwise.

Definition at line 282 of file matrix_base.hpp.

◆ isnan()

bool Matrix_real::isnan ( )

Call to check the array for NaN entries.

Returns
Returns with true if the array has at least one NaN entry.

Definition at line 127 of file matrix_real.cpp.

◆ operator[]()

double & matrix_base< double >::operator[] ( int  idx) const
inlineinherited

Operator [] to access elements in array style (does not check the boundaries of the stored array)

Parameters
idxthe index of the element
Returns
Returns with a reference to the idx-th element.

Definition at line 423 of file matrix_base.hpp.

◆ print_matrix()

void matrix_base< double >::print_matrix ( ) const
inlineinherited

Call to prints the stored matrix on the standard output.

Definition at line 480 of file matrix_base.hpp.

◆ release_data()

void matrix_base< double >::release_data ( )
inlineinherited

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 333 of file matrix_base.hpp.

◆ replace_data()

void matrix_base< double >::replace_data ( double *  data_in,
bool  owner_in 
)
inlineinherited

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.

Parameters
data_inThe data array to be set as a new storage.
owner_inSet true to set the current class instance to be the owner of the data array, or false otherwise.

Definition at line 316 of file matrix_base.hpp.

◆ set_owner()

void matrix_base< double >::set_owner ( bool  owner_in)
inlineinherited

Call to set the current class instance to be (or not to be) the owner of the stored data array.

Parameters
owner_inSet true to set the current class instance to be the owner of the data array, or false otherwise.

Definition at line 376 of file matrix_base.hpp.

◆ size()

int matrix_base< double >::size ( ) const
inlineinherited

Call to get the number of the allocated elements.

Returns
Returns with the number of the allocated elements (rows*cols)

Definition at line 470 of file matrix_base.hpp.

◆ transpose()

void matrix_base< double >::transpose ( )
inlineinherited

Call to transpose (or un-transpose) the matrix for CBLAS functions.

Definition at line 292 of file matrix_base.hpp.

Member Data Documentation

◆ cols

int matrix_base< double >::cols
inherited

The number of columns.

Definition at line 44 of file matrix_base.hpp.

◆ conjugated

bool matrix_base< double >::conjugated
protectedinherited

logical variable indicating whether the matrix needs to be conjugated in CBLAS operations

Definition at line 53 of file matrix_base.hpp.

◆ data

double * matrix_base< double >::data
inherited

pointer to the stored data

Definition at line 48 of file matrix_base.hpp.

◆ owner

bool matrix_base< double >::owner
protectedinherited

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 57 of file matrix_base.hpp.

◆ padding

char Matrix_real::padding[CACHELINE-48]
private

padding class object to cache line borders

Definition at line 42 of file matrix_real.h.

◆ reference_mutex

tbb::spin_mutex* matrix_base< double >::reference_mutex
protectedinherited

mutual exclusion to count the references for class instances referring to the same data.

Definition at line 59 of file matrix_base.hpp.

◆ references

int64_t* matrix_base< double >::references
protectedinherited

the number of the current references of the present object

Definition at line 61 of file matrix_base.hpp.

◆ rows

int matrix_base< double >::rows
inherited

The number of rows.

Definition at line 42 of file matrix_base.hpp.

◆ stride

int matrix_base< double >::stride
inherited

The column stride of the array. (The array elements in one row are a_0, a_1, ... a_{cols-1}, 0, 0, 0, 0. The number of zeros is stride-cols)

Definition at line 46 of file matrix_base.hpp.

◆ transposed

bool matrix_base< double >::transposed
protectedinherited

logical variable indicating whether the matrix needs to be transposed in CBLAS operations

Definition at line 55 of file matrix_base.hpp.


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