Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
U3.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 U3_H
24 #define U3_H
25 
26 #include "Gate.h"
27 #include "matrix.h"
28 #include "matrix_real.h"
29 #define _USE_MATH_DEFINES
30 #include <math.h>
31 
32 
36 class U3: public Gate {
37 
38 
39 public:
40 
44 U3();
45 
46 
52 U3(int qbit_num_in, int target_qbit_in);
53 
54 
58 virtual ~U3();
59 
60 
67 
68 
75 Matrix get_matrix( Matrix_real& parameters, int parallel );
76 
77 
84 void apply_to_list( Matrix_real& parameters, std::vector<Matrix>& inputs, int parallel );
85 
86 
93 virtual void apply_to( Matrix_real& parameters, Matrix& input, int parallel );
94 
100 virtual void apply_from_right( Matrix_real& parameters, Matrix& input );
101 
102 
109 virtual std::vector<Matrix> apply_derivate_to( Matrix_real& parameters, Matrix& input, int parallel );
110 
111 
116 virtual void set_qbit_num(int qbit_num_in);
117 
118 
123 virtual void reorder_qubits( std::vector<int> qbit_list);
124 
125 
130 virtual U3* clone();
131 
132 
138 virtual Matrix_real extract_parameters( Matrix_real& parameters );
139 
140 
141 };
142 
143 #endif //U3
A class representing a U3 gate.
Definition: U3.h:36
Header file for a class for the representation of general gate operations.
virtual Matrix get_matrix()
Call to retrieve the operation matrix.
Definition: Gate.cpp:129
virtual void apply_to(Matrix_real &parameters, Matrix &input, int parallel)
Call to apply the gate on the input array/matrix by U3*input.
Definition: U3.cpp:173
U3()
Nullary constructor of the class.
Definition: U3.cpp:33
void apply_to_list(Matrix_real &parameters, std::vector< Matrix > &inputs, int parallel)
Call to apply the gate on the input array/matrix by U3*input.
Definition: U3.cpp:141
virtual void reorder_qubits(std::vector< int > qbit_list)
Call to reorder the qubits in the matrix of the gate.
Definition: U3.cpp:271
virtual U3 * clone()
Call to create a clone of the present class.
Definition: U3.cpp:279
virtual void apply_from_right(Matrix_real &parameters, Matrix &input)
Call to apply the gate on the input array/matrix by input*U3.
Definition: U3.cpp:196
Header file of complex array storage array with automatic and thread safe reference counting...
Class to store data of complex arrays and its properties.
Definition: matrix.h:38
virtual Matrix_real extract_parameters(Matrix_real &parameters)
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate i...
Definition: U3.cpp:297
virtual std::vector< Matrix > apply_derivate_to(Matrix_real &parameters, Matrix &input, int parallel)
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters...
Definition: U3.cpp:220
virtual ~U3()
Destructor of the class.
Definition: U3.cpp:91
Base class for the representation of general gate operations.
Definition: Gate.h:73
virtual void set_qbit_num(int qbit_num_in)
Call to set the number of qubits spanning the matrix of the gate.
Definition: U3.cpp:263
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:39