Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
RZ_P.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 RZ_P_H
24 #define RZ_P_H
25 
26 #include "U3.h"
27 #include "matrix.h"
28 #include "matrix_real.h"
29 #define _USE_MATH_DEFINES
30 #include <math.h>
31 
32 
36 class RZ_P: public U3 {
37 
38 
39 public:
40 
44 RZ_P();
45 
46 
55 RZ_P(int qbit_num_in, int target_qbit_in);
56 
60 ~RZ_P();
61 
62 
69 void apply_to( Matrix_real& parameters, Matrix& input, int parallel );
70 
71 
77 void apply_from_right( Matrix_real& parameters, Matrix& input );
78 
85 virtual std::vector<Matrix> apply_derivate_to( Matrix_real& parameters, Matrix& input, int parallel );
86 
94 void parameters_for_calc_one_qubit( double& ThetaOver2, double& Phi, double& Lambda);
95 
100 RZ_P* clone();
101 
102 
103 };
104 
105 
106 #endif //U3
107 
A class representing a U3 gate.
Definition: U3.h:36
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: RZ_P.cpp:180
void apply_to(Matrix_real &parameters, Matrix &input, int parallel)
Call to apply the gate on the input array/matrix by U3*input.
Definition: RZ_P.cpp:118
A class representing a RZ + global phase gate.
Definition: RZ_P.h:36
~RZ_P()
Destructor of the class.
Definition: RZ_P.cpp:103
void apply_from_right(Matrix_real &parameters, Matrix &input)
Call to apply the gate on the input array/matrix by input*U3.
Definition: RZ_P.cpp:148
RZ_P * clone()
Call to create a clone of the present class.
Definition: RZ_P.cpp:229
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
Header file for a class representing a U3 gate.
void parameters_for_calc_one_qubit(double &ThetaOver2, double &Phi, double &Lambda)
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit ...
Definition: RZ_P.cpp:219
RZ_P()
NullaRZ constructor of the class.
Definition: RZ_P.cpp:31
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:39