Sequential Quantum Gate Decomposer
v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Copyright 2021 Budapest Quantum Computing Group. More...
#include <GrayCode_base.hpp>
Public Member Functions | |
GrayCode_base | add_Digit (const intType n_ary_limit) const |
Call to add a new digit to the Gray code. More... | |
void | conjugate () |
Call to conjugate (or un-conjugate) the matrix for CBLAS functions. More... | |
GrayCode_base | copy () const |
Call to create a copy of the state. More... | |
void | ensure_aligned () |
intType * | get_data () const |
Call to get the pointer to the stored data. More... | |
matrix_base< intType > | get_Limits () const |
Call to get the n-ary limits of the Gray code. More... | |
GrayCode_base () | |
Default constructor of the class. More... | |
GrayCode_base (intType *data_in, matrix_base< intType > n_ary_limits_) | |
Constructor of the class. More... | |
GrayCode_base (matrix_base< intType > n_ary_limits_) | |
Constructor of the class. More... | |
GrayCode_base (intType value, matrix_base< intType > &n_ary_limits_) | |
Constructor of the class. More... | |
GrayCode_base (const GrayCode_base &in) | |
Copy constructor of the class. 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... | |
void | operator= (const GrayCode_base &gcode) |
Overloaded assignment operator to create a copy of the state. More... | |
bool | operator== (const GrayCode_base &gcode) const |
Operator to compare two keys made of PicState_base class instances. More... | |
intType & | operator[] (size_t idx) |
Operator [] to access elements in array style. More... | |
const intType & | operator[] (size_t idx) const |
Operator [] to access a constant element in array style of constant instance. More... | |
intType & | 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... | |
GrayCode_base | remove_Digit (const int idx) const |
Call to add a new digit to the Gray code. More... | |
void | replace_data (intType *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... | |
intType * | 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 | |
matrix_base< intType > | n_ary_limits |
the limits of the gray code digits More... | |
uint8_t | padding [CACHELINE-sizeof(matrix_base< intType >) -sizeof(intType)] |
padding class object to cache line borders More... | |
Copyright 2021 Budapest Quantum Computing Group.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Class to store one-dimensional state vectors and their additional properties.
Definition at line 29 of file GrayCode_base.hpp.
|
inline |
Default constructor of the class.
Definition at line 49 of file GrayCode_base.hpp.
|
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 |
cols_in | The number of columns in the stored matrix |
Definition at line 62 of file GrayCode_base.hpp.
|
inline |
Constructor of the class.
Allocates data for the state of elements cols. By default the created instance would be the owner of the stored data.
cols_in | The number of columns in the stored matrix |
Definition at line 74 of file GrayCode_base.hpp.
|
inline |
Constructor of the class.
Allocates data for the state of elements cols and set the values to value. By default the created instance would be the owner of the stored data.
cols_in | The number of columns in the stored matrix |
Definition at line 86 of file GrayCode_base.hpp.
|
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 106 of file GrayCode_base.hpp.
|
inline |
Call to add a new digit to the Gray code.
n_ary_limit | The limit of the new digit |
Definition at line 224 of file GrayCode_base.hpp.
|
inlineinherited |
Call to conjugate (or un-conjugate) the matrix for CBLAS functions.
Definition at line 271 of file matrix_base.hpp.
|
inline |
Call to create a copy of the state.
By default the created instance would be the owner of the stored array.
Definition at line 182 of file GrayCode_base.hpp.
|
inlineinherited |
Definition at line 457 of file matrix_base.hpp.
|
inlineinherited |
Call to get the pointer to the stored data.
Definition at line 304 of file matrix_base.hpp.
|
inline |
Call to get the n-ary limits of the Gray code.
Definition at line 210 of file GrayCode_base.hpp.
|
inlineinherited |
Call to get whether the matrix should be conjugated in CBLAS functions or not.
Definition at line 264 of file matrix_base.hpp.
|
inlineinherited |
Call to get whether the matrix should be conjugated in CBLAS functions or not.
Definition at line 282 of file matrix_base.hpp.
|
inline |
Overloaded assignment operator to create a copy of the state.
state | An instance of PicState_base |
Definition at line 168 of file GrayCode_base.hpp.
|
inline |
Operator to compare two keys made of PicState_base class instances.
state | An instance of an implemented class of PicState_base |
Definition at line 118 of file GrayCode_base.hpp.
|
inline |
Operator [] to access elements in array style.
idx | the index of the element |
Definition at line 146 of file GrayCode_base.hpp.
|
inline |
Operator [] to access a constant element in array style of constant instance.
idx | the index of the element |
Definition at line 156 of file GrayCode_base.hpp.
|
inlineinherited |
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 423 of file matrix_base.hpp.
|
inlineinherited |
Call to prints the stored matrix on the standard output.
Definition at line 480 of file matrix_base.hpp.
|
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.
|
inline |
Call to add a new digit to the Gray code.
idx | the index of the digit to be removed |
Definition at line 249 of file GrayCode_base.hpp.
|
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.
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 316 of file matrix_base.hpp.
|
inlineinherited |
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 376 of file matrix_base.hpp.
|
inlineinherited |
Call to get the number of the allocated elements.
Definition at line 470 of file matrix_base.hpp.
|
inlineinherited |
Call to transpose (or un-transpose) the matrix for CBLAS functions.
Definition at line 292 of file matrix_base.hpp.
|
inherited |
The number of columns.
Definition at line 44 of file matrix_base.hpp.
|
protectedinherited |
logical variable indicating whether the matrix needs to be conjugated in CBLAS operations
Definition at line 53 of file matrix_base.hpp.
|
inherited |
pointer to the stored data
Definition at line 48 of file matrix_base.hpp.
|
private |
the limits of the gray code digits
Definition at line 40 of file GrayCode_base.hpp.
|
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.
|
private |
padding class object to cache line borders
Definition at line 36 of file GrayCode_base.hpp.
|
protectedinherited |
mutual exclusion to count the references for class instances referring to the same data.
Definition at line 59 of file matrix_base.hpp.
|
protectedinherited |
the number of the current references of the present object
Definition at line 61 of file matrix_base.hpp.
|
inherited |
The number of rows.
Definition at line 42 of file matrix_base.hpp.
|
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.
|
protectedinherited |
logical variable indicating whether the matrix needs to be transposed in CBLAS operations
Definition at line 55 of file matrix_base.hpp.