Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
N_Qubit_Decomposition_Tabu_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_Tabu_Search_H
27 #define N_Qubit_Decomposition_Tabu_Search_H
28 
30 #include "GrayCode.h"
31 #include "GrayCodeHash.h"
32 #include <unordered_set>
33 
35 
41 
42 
43 public:
44 
45 protected:
46 
48  std::unordered_set<GrayCodeCNOT, GrayCodeHashCNOT> tested_gate_structures;
49 
50  std::vector< std::pair<GrayCodeCNOT, double> > best_solutions;
51 
52 
53 public:
54 
60 
61 
70 N_Qubit_Decomposition_Tabu_Search( Matrix Umtx_in, int qbit_num_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
71 
75 N_Qubit_Decomposition_Tabu_Search( Matrix_float Umtx_in, int qbit_num_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
76 
77 
87 N_Qubit_Decomposition_Tabu_Search( Matrix Umtx_in, int qbit_num_in, std::vector<matrix_base<int>> topology_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
88 
92 N_Qubit_Decomposition_Tabu_Search( Matrix_float Umtx_in, int qbit_num_in, std::vector<matrix_base<int>> topology_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
93 
94 
95 
100 
101 
102 
108 
109 
110 
116 
117 
123 std::vector<GrayCodeCNOT> determine_mutated_structures( const GrayCodeCNOT& gcode );
124 
125 
126 
132 GrayCodeCNOT draw_gate_structure_from_list( std::vector<GrayCodeCNOT>& gcodes );
133 
134 
135 
141 void insert_into_best_solution( const GrayCodeCNOT& gcode_, double minimum_ );
142 
143 
144 };
145 
146 
147 
148 
149 
150 
151 #endif
Gates_block * determine_gate_structure(Matrix_real &optimized_parameters_mtx)
Call determine the gate structrue of the decomposing circuit.
void insert_into_best_solution(const GrayCodeCNOT &gcode_, double minimum_)
Call to store a given solution among the best ones.
Copyright 2021 Budapest Quantum Computing Group.
std::vector< std::pair< GrayCodeCNOT, double > > best_solutions
Class to hash function operator for GrayCode_base keys in unordered maps and unordered sets...
Header file for Gray code hashing.
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_Tabu_Search()
Nullary constructor of the class.
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
GrayCodeCNOT draw_gate_structure_from_list(std::vector< GrayCodeCNOT > &gcodes)
Call to sample a gate structure from a list of gate structures to test in the optimization process...
int accelerator_num
number of utilized accelerators
virtual ~N_Qubit_Decomposition_Tabu_Search()
Destructor of the class.
Header file for a class implementing the adaptive gate decomposition algorithm of arXiv:2203...
std::vector< GrayCodeCNOT > determine_mutated_structures(const GrayCodeCNOT &gcode)
Call to generate a list of mutated gate structures.
Double-precision complex matrix (float64).
Definition: matrix.h:38
A class responsible for grouping two-qubit (CNOT,CZ,CH) and one-qubit gates into layers.
Definition: Gates_block.h:44
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
std::map< std::string, Config_Element > config
config metadata utilized during the optimization
std::unordered_set< GrayCodeCNOT, GrayCodeHashCNOT > tested_gate_structures
the set of already examined gate structures (mapped to n-ary Gray codes)
Matrix_real optimized_parameters_mtx
The optimized parameters for the gates.
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:41
GrayCodeCNOT tabu_search_over_gate_structures()
Perform tabu serach over gate structures.