Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
RXX.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 RXX_H
24 #define RXX_H
25 
26 #include "Gate.h"
27 #include "matrix.h"
28 #include "matrix_real.h"
29 #define _USE_MATH_DEFINES
30 #include <math.h>
34 class RXX: public Gate {
35 
36 
37 public:
38 
42 RXX();
43 
49 RXX(int qbit_num_in, const std::vector<int>& target_qbits_in);
50 
54 ~RXX();
55 
57 Matrix gate_kernel(const Matrix_real& precomputed_sincos) override;
58 Matrix_float gate_kernel(const Matrix_real_float& precomputed_sincos) override;
59 Matrix inverse_gate_kernel(const Matrix_real& precomputed_sincos) override;
60 Matrix_float inverse_gate_kernel(const Matrix_real_float& precomputed_sincos) override;
61 Matrix derivative_kernel(const Matrix_real& precomputed_sincos, int param_idx) override;
62 Matrix_float derivative_kernel(const Matrix_real_float& precomputed_sincos, int param_idx) override;
63 void gate_kernel_to(const Matrix_real& precomputed_sincos, Matrix& output) override;
64 void gate_kernel_to(const Matrix_real_float& precomputed_sincos, Matrix_float& output) override;
65 void inverse_gate_kernel_to(const Matrix_real& precomputed_sincos, Matrix& output) override;
66 void inverse_gate_kernel_to(const Matrix_real_float& precomputed_sincos, Matrix_float& output) override;
67 void derivative_kernel_to(const Matrix_real& precomputed_sincos, int param_idx, Matrix& output) override;
68 void derivative_kernel_to(const Matrix_real_float& precomputed_sincos, int param_idx, Matrix_float& output) override;
69 
74 RXX* clone() override;
75 
76 
82 std::vector<double> get_parameter_multipliers() const override;
83 
84 };
85 #endif //RXX,
A class representing a RXX gate.
Definition: RXX.h:34
Header file for a class for the representation of general gate operations.
Class to store single-precision real arrays and properties.
Matrix inverse_gate_kernel(const Matrix_real &precomputed_sincos) override
Definition: RXX.cpp:107
~RXX()
Destructor of the class.
Definition: RXX.cpp:81
RXX * clone() override
Call to create a clone of the present class.
Definition: RXX.cpp:185
RXX()
Nullary constructor of the class.
Definition: RXX.cpp:31
void inverse_gate_kernel_to(const Matrix_real &precomputed_sincos, Matrix &output) override
Definition: RXX.cpp:145
Matrix gate_kernel(const Matrix_real &precomputed_sincos) override
Build and return the 4x4 RXX unitary for the given parameter.
Definition: RXX.cpp:95
Header file of complex array storage array with automatic and thread safe reference counting...
void derivative_kernel_to(const Matrix_real &precomputed_sincos, int param_idx, Matrix &output) override
Definition: RXX.cpp:159
Double-precision complex matrix (float64).
Definition: matrix.h:38
std::vector< double > get_parameter_multipliers() const override
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate i...
Definition: RXX.cpp:197
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
Base class for the representation of general gate operations.
Definition: Gate.h:86
Matrix derivative_kernel(const Matrix_real &precomputed_sincos, int param_idx) override
Definition: RXX.cpp:119
void gate_kernel_to(const Matrix_real &precomputed_sincos, Matrix &output) override
Definition: RXX.cpp:131
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:41