Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
U3.h
Go to the documentation of this file.
1 
5 #ifndef U3_H
6 #define U3_H
7 
8 #include "Gate.h"
9 #include "matrix.h"
10 #include "matrix_real.h"
11 #include "matrix_real_float.h"
12 #include "matrix_float.h"
13 #include <math.h>
14 
19 class U3: public Gate {
20 public:
21  U3();
22  U3(int qbit_num_in, int target_qbit_in);
23  ~U3() override;
24 
25  virtual U3* clone() override;
26  virtual std::vector<double> get_parameter_multipliers() const override;
27  virtual Matrix gate_kernel(const Matrix_real& precomputed_sincos) override;
28  virtual Matrix_float gate_kernel(const Matrix_real_float& precomputed_sincos) override;
29  virtual Matrix inverse_gate_kernel(const Matrix_real& precomputed_sincos) override;
30  virtual Matrix_float inverse_gate_kernel(const Matrix_real_float& precomputed_sincos) override;
31  virtual Matrix derivative_kernel(const Matrix_real& precomputed_sincos, int param_idx) override;
32  virtual Matrix_float derivative_kernel(const Matrix_real_float& precomputed_sincos, int param_idx) override;
33  virtual void gate_kernel_to(const Matrix_real& precomputed_sincos, Matrix& output) override;
34  virtual void gate_kernel_to(const Matrix_real_float& precomputed_sincos, Matrix_float& output) override;
35  virtual void inverse_gate_kernel_to(const Matrix_real& precomputed_sincos, Matrix& output) override;
36  virtual void inverse_gate_kernel_to(const Matrix_real_float& precomputed_sincos, Matrix_float& output) override;
37  virtual void derivative_kernel_to(const Matrix_real& precomputed_sincos, int param_idx, Matrix& output) override;
38  virtual void derivative_kernel_to(const Matrix_real_float& precomputed_sincos, int param_idx, Matrix_float& output) override;
39 
40 };
41 
42 // Free helper functions — compute a 2×2 U3 matrix without constructing a gate object.
43 Matrix u3_matrix_kernel(double ThetaOver2, double Phi, double Lambda);
44 Matrix_float u3_matrix_kernel_f(float ThetaOver2, float Phi, float Lambda);
45 
46 // Free helpers — compute a 2x2 U3 kernel without constructing a gate object.
47 Matrix u3_matrix_kernel(double ThetaOver2, double Phi, double Lambda);
48 Matrix_float u3_matrix_kernel_f(float ThetaOver2, float Phi, float Lambda);
49 
50 #endif //U3_H
Copyright (C) Miklos Maroti, 2021 SPDX-License-Identifier: Apache-2.0.
Definition: U3.h:19
Header file of single-precision complex array storage with automatic and thread safe reference counti...
Header file for a class for the representation of general gate operations.
Class to store single-precision real arrays and properties.
Matrix u3_matrix_kernel(double ThetaOver2, double Phi, double Lambda)
Definition: U3.cpp:149
virtual void gate_kernel_to(const Matrix_real &precomputed_sincos, Matrix &output) override
Definition: U3.cpp:89
U3()
Definition: U3.cpp:25
virtual Matrix gate_kernel(const Matrix_real &precomputed_sincos) override
Compute the gate kernel matrix from precomputed trigonometric values.
Definition: U3.cpp:53
~U3() override
Definition: U3.cpp:39
virtual std::vector< double > get_parameter_multipliers() const override
Returns the per-parameter multipliers relative to 2π used by extract_parameters. ...
Definition: U3.cpp:49
virtual void derivative_kernel_to(const Matrix_real &precomputed_sincos, int param_idx, Matrix &output) override
Definition: U3.cpp:113
virtual Matrix inverse_gate_kernel(const Matrix_real &precomputed_sincos) override
Definition: U3.cpp:65
Header file of complex array storage array with automatic and thread safe reference counting...
virtual void inverse_gate_kernel_to(const Matrix_real &precomputed_sincos, Matrix &output) override
Definition: U3.cpp:101
Double-precision complex matrix (float64).
Definition: matrix.h:38
Matrix_float u3_matrix_kernel_f(float ThetaOver2, float Phi, float Lambda)
Definition: U3.cpp:159
virtual Matrix derivative_kernel(const Matrix_real &precomputed_sincos, int param_idx) override
Definition: U3.cpp:77
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
Base class for the representation of general gate operations.
Definition: Gate.h:86
virtual U3 * clone() override
Call to create a clone of the present class.
Definition: U3.cpp:41
Class to store data of complex arrays and its properties.
Definition: matrix_real.h:41