Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
RZZ.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 RZZ_H
24 #define RZZ_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 RZZ: public Gate {
35 
36 
37 public:
38 
42 RZZ();
43 
49 RZZ(int qbit_num_in, const std::vector<int>& target_qbits_in);
50 
54 ~RZZ();
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 RZZ* clone() override;
75 
81 std::vector<double> get_parameter_multipliers() const override;
82 
83 };
84 #endif //RZZ
Header file for a class for the representation of general gate operations.
Class to store single-precision real arrays and properties.
~RZZ()
Destructor of the class.
Definition: RZZ.cpp:80
Matrix derivative_kernel(const Matrix_real &precomputed_sincos, int param_idx) override
Definition: RZZ.cpp:108
RZZ()
Nullary constructor of the class.
Definition: RZZ.cpp:30
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: RZZ.cpp:187
Matrix gate_kernel(const Matrix_real &precomputed_sincos) override
Build and return the 4x4 RZZ unitary for the given parameter.
Definition: RZZ.cpp:84
Header file of complex array storage array with automatic and thread safe reference counting...
A class representing a RZZ gate.
Definition: RZZ.h:34
Double-precision complex matrix (float64).
Definition: matrix.h:38
RZZ * clone() override
Call to create a clone of the present class.
Definition: RZZ.cpp:175
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
void inverse_gate_kernel_to(const Matrix_real &precomputed_sincos, Matrix &output) override
Definition: RZZ.cpp:134
void derivative_kernel_to(const Matrix_real &precomputed_sincos, int param_idx, Matrix &output) override
Definition: RZZ.cpp:148
Base class for the representation of general gate operations.
Definition: Gate.h:86
void gate_kernel_to(const Matrix_real &precomputed_sincos, Matrix &output) override
Definition: RZZ.cpp:120
Matrix inverse_gate_kernel(const Matrix_real &precomputed_sincos) override
Definition: RZZ.cpp:96
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:41