Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
N_Qubit_Decomposition.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 @author: Peter Rakyta, Ph.D.
18 */
23 #ifndef N_Qubit_Decomposition_H
24 #define N_Qubit_Decomposition_H
25 
26 #include "Optimization_Interface.h"
28 
29 
30 
36 
37 
38 public:
39 
40 protected:
41 
42 /*
44  bool optimize_layer_num;
45 
47  std::map<int,int> identical_blocks;
48 
50  Gates_block* gate_structure;
51 
52 
53  std::vector<decomposition_tree_node*> root_nodes;
54 */
55 
57  std::map<int, Gates_block*> gate_structure;
58 public:
59 
65 
66 
67 
76 N_Qubit_Decomposition( Matrix Umtx_in, int qbit_num_in, bool optimize_layer_num_in, std::map<std::string, Config_Element>& config, guess_type initial_guess_in );
77 
81 N_Qubit_Decomposition( Matrix_float Umtx_in, int qbit_num_in, bool optimize_layer_num_in, std::map<std::string, Config_Element>& config, guess_type initial_guess_in );
82 
83 
84 
88 virtual ~N_Qubit_Decomposition();
89 
90 
95 virtual void start_decomposition(bool finalize_decomp=true);
96 
97 
102 
106 void decompose_submatrix();
107 
108 
114 
115 
120 void set_custom_gate_structure( std::map<int, Gates_block*> gate_structure_in );
121 
128 int set_identical_blocks( int n, int identical_blocks_in );
129 
135 int set_identical_blocks( std::map<int, int> identical_blocks_in );
136 
137 
138 
139 
140 };
141 
142 
143 #endif
N_Qubit_Decomposition()
Nullary constructor of the class.
void decompose_submatrix()
Start the decompostion process to recursively decompose the submatrices.
virtual void start_decomposition(bool finalize_decomp=true)
Start the disentanglig process of the unitary.
void finalize_decomposition()
After the main optimization problem is solved, the indepent qubits can be rotated into state |0> by t...
void set_custom_gate_structure(std::map< int, Gates_block *> gate_structure_in)
Call to set custom layers to the gate structure that are intended to be used in the subdecomposition...
virtual ~N_Qubit_Decomposition()
Destructor of the class.
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...
Double-precision complex matrix (float64).
Definition: matrix.h:38
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
void extract_subdecomposition_results(Sub_Matrix_Decomposition *cSub_decomposition)
Call to extract and store the calculated parameters and gates of the sub-decomposition processes...
guess_type
Type definition of the types of the initial guess.
std::map< std::string, Config_Element > config
config metadata utilized during the optimization
Header file for a class responsible for the disentanglement of one qubit from the others...
std::map< int, Gates_block * > gate_structure
A map of <int n: Gates_block* block> describing custom gate structure to be used in the decomposition...
A class responsible for the disentanglement of one qubit from the others.
int set_identical_blocks(int n, int identical_blocks_in)
Set the number of identical successive blocks during the subdecomposition of the n-th qubit...
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gate...