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

Single-precision complex matrix (float32). More...

#include <matrix_float.h>

Inheritance diagram for Matrix_float:
Inheritance graph
[legend]

Public Member Functions

void conjugate ()
 Call to conjugate (or un-conjugate) the matrix for CBLAS functions. More...
 
Matrix_float copy () const
 Call to create a copy of the matrix. More...
 
void copy_to (matrix_base< QGD_Complex8 > &target) const
 Copy the current matrix storage into a reusable target matrix. More...
 
void ensure_aligned ()
 
QGD_Complex8get_data () const
 Call to get the pointer to the stored data. More...
 
bool is_conjugated () const
 Call to get whether the matrix should be conjugated in CBLAS functions or not. More...
 
bool is_transposed () const
 Call to get whether the matrix should be conjugated in CBLAS functions or not. More...
 
bool isnan ()
 
 Matrix_float ()=default
 
 Matrix_float (Matrix_T< QGD_Complex8 > &&base) noexcept
 
 Matrix_float (const Matrix_float &)=default
 
 Matrix_float (Matrix_float &&) noexcept=default
 
bool operator< (const matrix_base< QGD_Complex8 > &other) const
 
Matrix_floatoperator= (const Matrix_float &)=default
 
Matrix_floatoperator= (Matrix_float &&) noexcept=default
 
QGD_Complex8operator[] (int idx) const
 Operator [] to access elements in array style (does not check the boundaries of the stored array) More...
 
void print_matrix () const
 
void release_data ()
 Call to release the data stored by the matrix. More...
 
void replace_data (QGD_Complex8 *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...
 
Matrix to_float64 () const
 Convert to double precision. More...
 
void transpose ()
 Call to transpose (or un-transpose) the matrix for CBLAS functions. More...
 
 ~Matrix_float ()=default
 

Public Attributes

int cols
 The number of columns. More...
 
QGD_Complex8data
 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...
 
std::atomic< 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...
 

Detailed Description

Single-precision complex matrix (float32).

Class to store data of single-precision complex arrays and its properties.

Note
BLAS operations NOT supported. Convert to Matrix for multiplication
Conversions only between complex types (Matrix <-> Matrix_float)
Python bindings NOT yet implemented

Definition at line 41 of file matrix_float.h.

Constructor & Destructor Documentation

◆ Matrix_float() [1/4]

Matrix_float::Matrix_float ( )
default

◆ Matrix_float() [2/4]

Matrix_float::Matrix_float ( Matrix_T< QGD_Complex8 > &&  base)
inlineexplicitnoexcept

Definition at line 47 of file matrix_float.h.

◆ Matrix_float() [3/4]

Matrix_float::Matrix_float ( const Matrix_float )
default

◆ Matrix_float() [4/4]

Matrix_float::Matrix_float ( Matrix_float &&  )
defaultnoexcept

◆ ~Matrix_float()

Matrix_float::~Matrix_float ( )
default

Member Function Documentation

◆ conjugate()

void matrix_base< QGD_Complex8 >::conjugate ( )
inlineinherited

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

Definition at line 252 of file matrix_base.hpp.

◆ copy()

Matrix_float Matrix_float::copy ( ) const
inline

Call to create a copy of the matrix.

Returns
Returns with the instance of the class.

Definition at line 60 of file matrix_float.h.

Here is the caller graph for this function:

◆ copy_to()

void matrix_base< QGD_Complex8 >::copy_to ( matrix_base< QGD_Complex8 > &  target) const
inlineinherited

Copy the current matrix storage into a reusable target matrix.

The target is reallocated when dimensions or stride differ; otherwise its existing allocation is reused.

Parameters
targetThe matrix receiving a deep copy of the current storage.

Definition at line 433 of file matrix_base.hpp.

◆ ensure_aligned()

void matrix_base< QGD_Complex8 >::ensure_aligned ( )
inlineinherited

Definition at line 448 of file matrix_base.hpp.

◆ get_data()

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

Call to get the pointer to the stored data.

Definition at line 285 of file matrix_base.hpp.

◆ is_conjugated()

bool matrix_base< QGD_Complex8 >::is_conjugated ( ) const
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 245 of file matrix_base.hpp.

◆ is_transposed()

bool matrix_base< QGD_Complex8 >::is_transposed ( ) const
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 263 of file matrix_base.hpp.

◆ isnan()

bool Matrix_T< QGD_Complex8 >::isnan ( )
inherited

Definition at line 60 of file matrix_template.cpp.

◆ operator<()

bool matrix_base< QGD_Complex8 >::operator< ( const matrix_base< QGD_Complex8 > &  other) const
inlineinherited

Definition at line 394 of file matrix_base.hpp.

◆ operator=() [1/2]

Matrix_float& Matrix_float::operator= ( const Matrix_float )
default

◆ operator=() [2/2]

Matrix_float& Matrix_float::operator= ( Matrix_float &&  )
defaultnoexcept

◆ operator[]()

QGD_Complex8 & matrix_base< QGD_Complex8 >::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 382 of file matrix_base.hpp.

◆ print_matrix()

void Matrix_T< QGD_Complex8 >::print_matrix ( ) const
inherited

Definition at line 70 of file matrix_template.cpp.

◆ release_data()

void matrix_base< QGD_Complex8 >::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 311 of file matrix_base.hpp.

◆ replace_data()

void matrix_base< QGD_Complex8 >::replace_data ( QGD_Complex8 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 297 of file matrix_base.hpp.

◆ set_owner()

void matrix_base< QGD_Complex8 >::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 337 of file matrix_base.hpp.

◆ size()

int matrix_base< QGD_Complex8 >::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 461 of file matrix_base.hpp.

◆ to_float64()

Matrix Matrix_float::to_float64 ( ) const

Convert to double precision.

Returns
Matrix with converted data
Exceptions
std::bad_allocif memory allocation fails
Note
Values outside [-FLT_MAX, FLT_MAX] saturate to infinity per IEEE 754
Returns
Matrix with converted data

Definition at line 8 of file matrix_float.cpp.

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

◆ transpose()

void matrix_base< QGD_Complex8 >::transpose ( )
inlineinherited

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

Definition at line 273 of file matrix_base.hpp.

Member Data Documentation

◆ cols

int matrix_base< QGD_Complex8 >::cols
inherited

The number of columns.

Definition at line 44 of file matrix_base.hpp.

◆ conjugated

bool matrix_base< QGD_Complex8 >::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

QGD_Complex8 * matrix_base< QGD_Complex8 >::data
inherited

pointer to the stored data

Definition at line 48 of file matrix_base.hpp.

◆ owner

bool matrix_base< QGD_Complex8 >::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.

◆ references

std::atomic<int64_t>* matrix_base< QGD_Complex8 >::references
protectedinherited

the number of the current references of the present object

Definition at line 59 of file matrix_base.hpp.

◆ rows

int matrix_base< QGD_Complex8 >::rows
inherited

The number of rows.

Definition at line 42 of file matrix_base.hpp.

◆ stride

int matrix_base< QGD_Complex8 >::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< QGD_Complex8 >::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: