Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
SX.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 SX_H
24 #define SX_H
25 
26 
27 #include "U3.h"
28 //#include "Gate.h"
29 #include "matrix.h"
30 #define _USE_MATH_DEFINES
31 #include <math.h>
32 
33 
34 
38 class SX: public U3 {
39 
40 
41 public:
42 
46 SX();
47 
48 
57 SX(int qbit_num_in, int target_qbit_in);
58 
62 ~SX();
63 
64 
71 
72 
79 Matrix get_matrix( int parallel );
80 
81 
88 void apply_to( Matrix& input, int parallel );
89 
90 
96 void apply_from_right( Matrix& input );
97 
98 
103 SX* clone();
104 
105 
110 void set_qbit_num(int qbit_num_in);
111 
112 
113 
118 void reorder_qubits( std::vector<int> qbit_list);
119 
120 
127 
128 };
129 
130 
131 #endif //SX
132 
A class representing a U3 gate.
Definition: U3.h:36
SX()
NullaRX constructor of the class.
Definition: SX.cpp:32
void apply_to(Matrix &input, int parallel)
Call to apply the gate on the input array/matrix by U3*input.
Definition: SX.cpp:151
Matrix get_matrix()
Call to retrieve the gate matrix.
Definition: SX.cpp:110
SX * clone()
Call to create a clone of the present class.
Definition: SX.cpp:250
Matrix calc_one_qubit_u3()
Set static values for matrix of the gates.
Definition: SX.cpp:292
void reorder_qubits(std::vector< int > qbit_list)
Call to reorder the qubits in the matrix of the gate.
Definition: SX.cpp:269
Header file of complex array storage array with automatic and thread safe reference counting...
~SX()
Destructor of the class.
Definition: SX.cpp:100
Class to store data of complex arrays and its properties.
Definition: matrix.h:38
Header file for a class representing a U3 gate.
void set_qbit_num(int qbit_num_in)
Call to set the number of qubits spanning the matrix of the gate.
Definition: SX.cpp:280
void apply_from_right(Matrix &input)
Call to apply the gate on the input array/matrix by input*U3.
Definition: SX.cpp:176
A class representing a U3 gate.
Definition: SX.h:38