|
Sequential Quantum Gate Decomposer
v1.9.6
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 | |
| int64_t | advance (int counter_pos) |
| Advance the n-ary Gray code counter by incrementing the digit at a specified position. More... | |
| 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.

| int64_t n_aryGrayCodeCounter::advance | ( | int | counter_pos | ) |
Advance the n-ary Gray code counter by incrementing the digit at a specified position.
| counter_pos | The index of the digit to attempt to increment (least-significant digit = 0). |
This method advances the counter by trying to increment the digit at counter_pos. If that digit is already at its maximum, a carry is propagated rightward until a higher digit can be incremented. When no further forward state exists within the current lexicographic slab, the method returns 0.
After a successful advance, the mixed-radix offset is recomputed and the internal state (counter chain and Gray code) is reinitialized to match the new offset.
Definition at line 254 of file n_aryGrayCodeCounter.cpp.

| GrayCode n_aryGrayCodeCounter::get | ( | ) |
Get the current gray code counter value.
Definition at line 147 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 159 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 174 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 190 of file n_aryGrayCodeCounter.cpp.

| void n_aryGrayCodeCounter::set_offset_max | ( | const int64_t & | value | ) |
Definition at line 298 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.
1.8.13