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 <n_aryGrayCodeCounter.h>
Public Member Functions | |
GrayCode | get () |
Get the current gray code counter value. More... | |
void | initialize () |
Initialize the gray counter by zero offset. More... | |
void | initialize (int64_t initial_offset) |
Initialize the gray counter to specific initial offset. More... | |
n_aryGrayCodeCounter () | |
Default constructor of the class. More... | |
n_aryGrayCodeCounter (matrix_base< int > &n_ary_limits_in) | |
Constructor of the class. More... | |
n_aryGrayCodeCounter (matrix_base< int > &n_ary_limits_in, int64_t initial_offset) | |
Constructor of the class. More... | |
int | next () |
Iterate the counter to the next value. More... | |
int | next (int &changed_index) |
Iterate the counter to the next value. More... | |
int | next (int &changed_index, int &value_prev, int &value) |
Iterate the counter to the next value. More... | |
void | set_offset_max (const int64_t &value) |
Protected Attributes | |
matrix_base< int > | counter_chain |
The incremental counter chain associated to the gray code. More... | |
GrayCode | gray_code |
the current gray code associated to the offset value More... | |
matrix_base< int > | n_ary_limits |
The maximal value of the individual gray code elements. More... | |
int64_t | offset |
the current offset in the counter 0<= offset <= offset_max More... | |
int64_t | offset_max |
the maximal offset in the counter offset = prod( n_ary_limits[i] ) 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 iterate over n-ary reflected gray codes
Definition at line 26 of file n_aryGrayCodeCounter.h.
n_aryGrayCodeCounter::n_aryGrayCodeCounter | ( | ) |
Default constructor of the class.
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. Default constructor of the class.
Definition at line 27 of file n_aryGrayCodeCounter.cpp.
n_aryGrayCodeCounter::n_aryGrayCodeCounter | ( | matrix_base< int > & | n_ary_limits_in | ) |
Constructor of the class.
n_ary_limits_in | The maximal value of the individual gray code elements |
Definition at line 40 of file n_aryGrayCodeCounter.cpp.
n_aryGrayCodeCounter::n_aryGrayCodeCounter | ( | matrix_base< int > & | n_ary_limits_in, |
int64_t | initial_offset | ||
) |
Constructor of the class.
n_ary_limits_in | The maximal value of the individual gray code elements |
initial_offset | The initial offset of the counter 0<=initial_offset<=offset_max |
Definition at line 69 of file n_aryGrayCodeCounter.cpp.
GrayCode n_aryGrayCodeCounter::get | ( | ) |
Get the current gray code counter value.
Definition at line 145 of file n_aryGrayCodeCounter.cpp.
void n_aryGrayCodeCounter::initialize | ( | ) |
Initialize the gray counter by zero offset.
Definition at line 99 of file n_aryGrayCodeCounter.cpp.
void n_aryGrayCodeCounter::initialize | ( | int64_t | initial_offset | ) |
Initialize the gray counter to specific initial offset.
initial_offset | The initial offset of the counter 0<= initial_offset <= offset_max |
Definition at line 111 of file n_aryGrayCodeCounter.cpp.
int n_aryGrayCodeCounter::next | ( | ) |
Iterate the counter to the next value.
Definition at line 157 of file n_aryGrayCodeCounter.cpp.
Iterate the counter to the next value.
changed_index | The index of the gray code element where change occured. |
Definition at line 172 of file n_aryGrayCodeCounter.cpp.
Iterate the counter to the next value.
changed_index | The index of the gray code element where change occured. |
value_prev | The previous value of the gray code element that changed. |
value | The new value of the gray code element. |
Definition at line 188 of file n_aryGrayCodeCounter.cpp.
void n_aryGrayCodeCounter::set_offset_max | ( | const int64_t & | value | ) |
Definition at line 241 of file n_aryGrayCodeCounter.cpp.
|
protected |
The incremental counter chain associated to the gray code.
Definition at line 36 of file n_aryGrayCodeCounter.h.
|
protected |
the current gray code associated to the offset value
Definition at line 32 of file n_aryGrayCodeCounter.h.
|
protected |
The maximal value of the individual gray code elements.
Definition at line 34 of file n_aryGrayCodeCounter.h.
|
protected |
the current offset in the counter 0<= offset <= offset_max
Definition at line 40 of file n_aryGrayCodeCounter.h.
|
protected |
the maximal offset in the counter offset = prod( n_ary_limits[i] )
Definition at line 38 of file n_aryGrayCodeCounter.h.