Sequential Quantum Gate Decomposer  v1.9.3
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 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
35 int LAPACKE_zggev ( int matrix_layout,
36  char jobvl,
37  char jobvr,
38  int n,
39  QGD_Complex16 * a,
40  int lda,
41  QGD_Complex16 * b,
42  int ldb,
44  QGD_Complex16 * beta,
45  QGD_Complex16 * vl,
46  int ldvl,
47  QGD_Complex16 * vr,
48  int ldvr
49  );
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 
61 
62 
63 public:
64 
65 protected:
66 
67 /*
69  bool optimize_layer_num;
70 
72  std::map<int,int> identical_blocks;
73 
75  Gates_block* gate_structure;
76 
77 
78  std::vector<decomposition_tree_node*> root_nodes;
79 */
80 
82  std::map<int, Gates_block*> gate_structure;
83 public:
84 
90 
91 
92 
101 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 );
102 
103 
104 
108 virtual ~N_Qubit_Decomposition();
109 
110 
115 virtual void start_decomposition(bool finalize_decomp=true);
116 
117 
122 
126 void decompose_submatrix();
127 
128 
134 
135 
140 void set_custom_gate_structure( std::map<int, Gates_block*> gate_structure_in );
141 
148 int set_identical_blocks( int n, int identical_blocks_in );
149 
155 int set_identical_blocks( std::map<int, int> identical_blocks_in );
156 
157 
158 
159 
160 };
161 
162 
163 #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...
Structure type representing complex numbers in the SQUANDER package.
Definition: QGDTypes.h:38
Class to store data of complex arrays and its properties.
Definition: matrix.h:38
int LAPACKE_zggev(int matrix_layout, char jobvl, char jobvr, int n, QGD_Complex16 *a, int lda, QGD_Complex16 *b, int ldb, QGD_Complex16 *alpha, QGD_Complex16 *beta, QGD_Complex16 *vl, int ldvl, QGD_Complex16 *vr, int ldvr)
Definition of the zggev function from Lapacke to calculate the eigenvalues of a complex matrix...
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...