Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
N_Qubit_Decomposition_Tree_Search.h
Go to the documentation of this file.
1 /*
2 Created on Fri Jun 26 14:13:26 2020
3 Copyright 2020 Peter Rakyta, Ph.D.
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see http://www.gnu.org/licenses/.
19 
20 @author: Peter Rakyta, Ph.D.
21 */
26 #ifndef N_Qubit_Decomposition_Tree_Search_H
27 #define N_Qubit_Decomposition_Tree_Search_H
28 
30 #include "GrayCode.h"
31 
32 
33 
34 
40 
41 
42 public:
43 
44 protected:
45 
46 
52  std::vector<matrix_base<int>> topology;
53 
58 
59 
60 
61 public:
62 
68 
69 
79 N_Qubit_Decomposition_Tree_Search( Matrix Umtx_in, int qbit_num_in, int level_limit_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
80 
81 
92 N_Qubit_Decomposition_Tree_Search( Matrix Umtx_in, int qbit_num_in, int level_limit_in, std::vector<matrix_base<int>> topology_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
93 
94 
95 
100 
101 
107 virtual void start_decomposition();
108 
109 
110 
116 
117 
118 
126 
127 
128 
134 Gates_block*
136 
143 
149 
150 
151 
156 
157 
158 
159 
164 void set_unitary( Matrix& Umtx_new ) ;
165 
166 
172 
173 
174 
175 
176 };
177 
178 
179 
180 
181 
182 
183 #endif
virtual Gates_block * determine_gate_structure(Matrix_real &optimized_parameters_mtx)
Call determine the gate structrue of the decomposing circuit.
void add_two_qubit_block(Gates_block *gate_structure, int target_qbit, int control_qbit)
Call to add two-qubit building block (two single qubit rotation blocks and one two-qubit gate) to the...
int control_qbit
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations...
Definition: Gate.h:87
int level_limit_min
The minimal number of adaptive layers used in the decomposition.
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
Header file for Grey code container.
N_Qubit_Decomposition_Tree_Search()
Nullary constructor of the class.
matrix_base< int > possible_target_qbits
List of possible target qubits according to the topology – paired up with possible control qubits...
int target_qbit
The index of the qubit on which the operation acts (target_qbit >= 0)
Definition: Gate.h:85
GrayCode tree_search_over_gate_structures(int level_num)
Call to perform tree search over possible gate structures.
N_Qubit_Decomposition_custom perform_optimization(Gates_block *gate_structure_loc)
Call to perform the optimization on the given gate structure.
int level_limit
The maximal number of adaptive layers used in the decomposition.
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
int accelerator_num
number of utilized accelerators
std::vector< matrix_base< int > > topology
A vector of index pairs encoding the connectivity between the qubits.
matrix_base< int > possible_control_qbits
List of possible control qubits according to the topology – paired up with possible target qubits...
virtual void add_finalyzing_layer()
Call to add further layer to the gate structure used in the subdecomposition.
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
Class to store data of complex arrays and its properties.
Definition: matrix.h:38
A class responsible for grouping two-qubit (CNOT,CZ,CH) and one-qubit gates into layers.
Definition: Gates_block.h:41
virtual void start_decomposition()
Start the disentanglig process of the unitary.
std::map< std::string, Config_Element > config
config metadata utilized during the optimization
void set_unitary(Matrix &Umtx_new)
Set unitary matrix.
GrayCode tabu_search_over_gate_structures()
Perform tabu serach over gate structures.
Matrix_real optimized_parameters_mtx
The optimized parameters for the gates.
Gates_block * construct_gate_structure_from_Gray_code(const GrayCode &gcode)
Call to construct a gate structure corresponding to the configuration of the two-qubit gates describe...
virtual ~N_Qubit_Decomposition_Tree_Search()
Destructor of the class.
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:39