Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Random_Unitary.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 #pragma once
27 #include <map>
28 #include <cstdlib>
29 #include <time.h>
30 #include <ctime>
31 #include "common.h"
32 #include "U3.h"
33 #include "CNOT.h"
34 #include "matrix.h"
35 #include "logging.h"
36 
37 
44 Matrix few_CNOT_unitary( int qbit_num, int cnot_num);
45 
46 
47 
51 class Random_Unitary : public logging {
52 
53 
54 public:
56  int dim;
57 
58 
59 
60 public:
61 
67 Random_Unitary( int dim_in );
68 
69 
75 
83 Matrix Construct_Unitary_Matrix( double* vartheta, double* varphi, double* varkappa );
84 
85 
92 int convert_indexes( int varalpha, int varbeta );
93 
100 
109 Matrix Omega(int varalpha, int varbeta, QGD_Complex16 x, QGD_Complex16 y );
110 
111 
120 Matrix M( int varalpha, int varbeta, QGD_Complex16 s, QGD_Complex16 t );
121 
129 
130 
137 Matrix E_alpha_beta( int varalpha, int varbeta );
138 
139 
146 Matrix I_alpha_beta( int varalpha, int varbeta );
147 
152 double gamma();
153 
160 double kronecker( int a, int b );
161 
162 
163 };
164 
165 
166 
167 
Matrix few_CNOT_unitary(int qbit_num, int cnot_num)
Call to create a random unitary constructed by CNOT operation between randomly chosen qubits and by r...
Header file for a class containing basic methods for setting up the verbosity level.
int convert_indexes(int varalpha, int varbeta)
Calculates an index from paramaters varalpha and varbeta.
double kronecker(int a, int b)
Kronecker delta.
Header file for a class representing a CNOT operation.
A class containing basic methods for setting up the verbosity level.
Definition: logging.h:43
int dim
The number of rows in the created unitary.
double gamma()
Implements Eq (11) of arXiv:1303:5904v1.
Matrix E_alpha_beta(int varalpha, int varbeta)
Implements matrix I below Eq (7) of arXiv:1303:5904v1.
Header file of complex array storage array with automatic and thread safe reference counting...
Matrix M(int varalpha, int varbeta, QGD_Complex16 s, QGD_Complex16 t)
Implements Eq (8) of arXiv:1303:5904v1.
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
Header file for a class representing a U3 gate.
Random_Unitary(int dim_in)
Constructor of the class.
A class to cerate general random unitary matrix according to arXiv:1303:5904v1.
Matrix Q(QGD_Complex16 u1, QGD_Complex16 u2)
Implements Eq (9) of arXiv:1303:5904v1.
Matrix I_alpha_beta(int varalpha, int varbeta)
Implements matrix I below Eq (7) of arXiv:1303:5904v1.
Header file for commonly used functions and wrappers to CBLAS functions.
Matrix Omega(int varalpha, int varbeta, QGD_Complex16 x, QGD_Complex16 y)
Eq (6) of arXiv:1303:5904v1.
Matrix Construct_Unitary_Matrix()
Call to create a random unitary.