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 | Protected Attributes
n_aryGrayCodeCounter Class Reference

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< intcounter_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< intn_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ n_aryGrayCodeCounter() [1/3]

n_aryGrayCodeCounter::n_aryGrayCodeCounter ( )

Default constructor of the class.

Copyright 2021 Budapest Quantum Computing Group.

Returns
Returns with the instance of the class.

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.

Returns
Returns with the instance of the class.

Definition at line 27 of file n_aryGrayCodeCounter.cpp.

◆ n_aryGrayCodeCounter() [2/3]

n_aryGrayCodeCounter::n_aryGrayCodeCounter ( matrix_base< int > &  n_ary_limits_in)

Constructor of the class.

Parameters
n_ary_limits_inThe maximal value of the individual gray code elements

Definition at line 40 of file n_aryGrayCodeCounter.cpp.

Here is the call graph for this function:

◆ n_aryGrayCodeCounter() [3/3]

n_aryGrayCodeCounter::n_aryGrayCodeCounter ( matrix_base< int > &  n_ary_limits_in,
int64_t  initial_offset 
)

Constructor of the class.

Parameters
n_ary_limits_inThe maximal value of the individual gray code elements
initial_offsetThe initial offset of the counter 0<=initial_offset<=offset_max

Definition at line 69 of file n_aryGrayCodeCounter.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ get()

GrayCode n_aryGrayCodeCounter::get ( )

Get the current gray code counter value.

Returns
Returns with the current gray code associated with the current offset.

Definition at line 145 of file n_aryGrayCodeCounter.cpp.

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

◆ initialize() [1/2]

void n_aryGrayCodeCounter::initialize ( )

Initialize the gray counter by zero offset.

Definition at line 99 of file n_aryGrayCodeCounter.cpp.

Here is the caller graph for this function:

◆ initialize() [2/2]

void n_aryGrayCodeCounter::initialize ( int64_t  initial_offset)

Initialize the gray counter to specific initial offset.

Parameters
initial_offsetThe initial offset of the counter 0<= initial_offset <= offset_max

Definition at line 111 of file n_aryGrayCodeCounter.cpp.

Here is the call graph for this function:

◆ next() [1/3]

int n_aryGrayCodeCounter::next ( )

Iterate the counter to the next value.

Definition at line 157 of file n_aryGrayCodeCounter.cpp.

Here is the caller graph for this function:

◆ next() [2/3]

int n_aryGrayCodeCounter::next ( int changed_index)

Iterate the counter to the next value.

Parameters
changed_indexThe index of the gray code element where change occured.

Definition at line 172 of file n_aryGrayCodeCounter.cpp.

Here is the call graph for this function:

◆ next() [3/3]

int n_aryGrayCodeCounter::next ( int changed_index,
int value_prev,
int value 
)

Iterate the counter to the next value.

Parameters
changed_indexThe index of the gray code element where change occured.
value_prevThe previous value of the gray code element that changed.
valueThe new value of the gray code element.

Definition at line 188 of file n_aryGrayCodeCounter.cpp.

Here is the call graph for this function:

◆ set_offset_max()

void n_aryGrayCodeCounter::set_offset_max ( const int64_t &  value)

Definition at line 241 of file n_aryGrayCodeCounter.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ counter_chain

matrix_base<int> n_aryGrayCodeCounter::counter_chain
protected

The incremental counter chain associated to the gray code.

Definition at line 36 of file n_aryGrayCodeCounter.h.

◆ gray_code

GrayCode n_aryGrayCodeCounter::gray_code
protected

the current gray code associated to the offset value

Definition at line 32 of file n_aryGrayCodeCounter.h.

◆ n_ary_limits

matrix_base<int> n_aryGrayCodeCounter::n_ary_limits
protected

The maximal value of the individual gray code elements.

Definition at line 34 of file n_aryGrayCodeCounter.h.

◆ offset

int64_t n_aryGrayCodeCounter::offset
protected

the current offset in the counter 0<= offset <= offset_max

Definition at line 40 of file n_aryGrayCodeCounter.h.

◆ offset_max

int64_t n_aryGrayCodeCounter::offset_max
protected

the maximal offset in the counter offset = prod( n_ary_limits[i] )

Definition at line 38 of file n_aryGrayCodeCounter.h.


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