Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
CR.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 CR_H
24 #define CR_H
25 
26 #include "R.h"
27 #include "CNOT.h"
28 #include "matrix.h"
29 #include "matrix_real.h"
30 #define _USE_MATH_DEFINES
31 #include <math.h>
32 
33 
37 class CR: public R {
38 
39 
40 public:
41 
45 CR();
46 
47 
53 CR(int qbit_num_in, int target_qbit_in, int control_qbit_in);
54 
58 virtual ~CR();
59 
60 
67 virtual void apply_to( Matrix_real& parameters, Matrix& input, int parallel );
68 
69 
75 virtual void apply_from_right( Matrix_real& parameters, Matrix& input );
76 
83 virtual std::vector<Matrix> apply_derivate_to( Matrix_real& parameters, Matrix& input, int parallel );
84 
85 
90 virtual CR* clone();
91 
92 
98 virtual Matrix_real extract_parameters( Matrix_real& parameters );
99 
100 };
101 
102 
103 #endif //CR
104 
Header file for a class representing a rotation gate around the X axis.
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: CR.cpp:167
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: CR.cpp:227
virtual void apply_from_right(Matrix_real &parameters, Matrix &input)
Call to apply the gate on the input array/matrix by input*CRY.
Definition: CR.cpp:121
Header file for a class representing a CNOT operation.
virtual void apply_to(Matrix_real &parameters, Matrix &input, int parallel)
Call to apply the gate on the input array/matrix by CRY*input.
Definition: CR.cpp:90
virtual CR * clone()
Call to create a clone of the present class.
Definition: CR.cpp:208
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
A class representing a CRY gate.
Definition: CR.h:37
A class representing a U3 gate.
Definition: R.h:36
CR()
Nullary constructor of the class.
Definition: CR.cpp:31
virtual ~CR()
Destructor of the class.
Definition: CR.cpp:76
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:39