Sequential Quantum Gate Decomposer  v1.9.3
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 
34 
40 
41 
42 public:
43 
44 protected:
45 
47  std::unordered_set<GrayCode, GrayCodeHash> tested_gate_structures;
48 
49  std::vector< std::pair<GrayCode, double> > best_solutions;
50 
51 
52 public:
53 
59 
60 
70 N_Qubit_Decomposition_Tabu_Search( Matrix Umtx_in, int qbit_num_in, int level_limit_in, std::map<std::string, Config_Element>& config, int accelerator_num=0 );
71 
72 
83 N_Qubit_Decomposition_Tabu_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 );
84 
85 
86 
91 
92 
93 
99 
100 
101 
107 
108 
114 std::vector<GrayCode> determine_mutated_structures( const GrayCode& gcode );
115 
116 
117 
123 GrayCode draw_gate_structure_from_list( std::vector<GrayCode>& gcodes );
124 
125 
126 
132 void insert_into_best_solution( const GrayCode& gcode_, double minimum_ );
133 
134 
135 };
136 
137 
138 
139 
140 
141 
142 #endif
Gates_block * determine_gate_structure(Matrix_real &optimized_parameters_mtx)
Call determine the gate structrue of the decomposing circuit.
GrayCode draw_gate_structure_from_list(std::vector< GrayCode > &gcodes)
Call to sample a gate structure from a list of gate structures to test in the optimization process...
Copyright 2021 Budapest Quantum Computing Group.
std::vector< GrayCode > determine_mutated_structures(const GrayCode &gcode)
Call to generate a list of mutated gate structures.
Header file for Gray code hashing.
std::vector< std::pair< GrayCode, double > > best_solutions
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...
GrayCode tabu_search_over_gate_structures()
Perform tabu serach over gate structures.
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...
void insert_into_best_solution(const GrayCode &gcode_, double minimum_)
Call to store a given solution among the best ones.
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
std::map< std::string, Config_Element > config
config metadata utilized during the optimization
std::unordered_set< GrayCode, GrayCodeHash > 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:39