Quantum Gate Decomposer  v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
Random_Unitary.h
Go to the documentation of this file.
1 /*
2 Created on Fri Jun 26 14:13:26 2020
3 Copyright (C) 2020 Peter Rakyta, Ph.D.
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17 
18 @author: Peter Rakyta, Ph.D.
19 */
24 #pragma once
25 #include <map>
26 #include <cstdlib>
27 #include <time.h>
28 #include <ctime>
29 #include "qgd/common.h"
30 #include "qgd/U3.h"
31 #include "qgd/CNOT.h"
32 #include "qgd/matrix.h"
33 
34 
35 
42 Matrix few_CNOT_unitary( int qbit_num, int cnot_num);
43 
44 
45 
50 
51 
52 public:
54  int dim;
55 
56 
57 
58 public:
59 
65 Random_Unitary( int dim_in );
66 
67 
73 
81 Matrix Construct_Unitary_Matrix( double* vartheta, double* varphi, double* varkappa );
82 
83 
90 int convert_indexes( int varalpha, int varbeta );
91 
97 Matrix Construct_Unitary_Matrix( double* parameters );
98 
107 Matrix Omega(int varalpha, int varbeta, QGD_Complex16 x, QGD_Complex16 y );
108 
109 
118 Matrix M( int varalpha, int varbeta, QGD_Complex16 s, QGD_Complex16 t );
119 
127 
128 
135 Matrix E_alpha_beta( int varalpha, int varbeta );
136 
137 
144 Matrix I_alpha_beta( int varalpha, int varbeta );
145 
150 double gamma();
151 
158 double kronecker( int a, int b );
159 
160 
161 };
162 
163 
164 
165 
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...
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.
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.
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 QGD package.
Definition: QGDTypes.h:39
Class to store data of complex arrays and its properties.
Definition: matrix.h:12
int qbit_num
Definition: example.py:38
Header file for a class representing a U3 operation.
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.