Template Function Pennylane::Gates::getRot(const std::vector<U>&)¶
Defined in File Gates.hpp
Function Documentation¶
-
template<class T, class U = T>
static auto Pennylane::Gates::getRot(const std::vector<U> ¶ms) -> std::vector<std::complex<T>>¶ Create a matrix representation of the Rot gate data in row-major format.
The gate is defined as: \(\begin{split}Rot(\phi,\theta,\omega) = RZ(\omega)RY(\theta)RZ(\phi)= \begin{bmatrix} e^{-i(\phi+\omega)/2}\cos(\theta/2) & -e^{i(\phi-\omega)/2}\sin(\theta/2) \\ e^{-i(\phi-\omega)/2}\sin(\theta/2) & e^{i(\phi+\omega)/2}\cos(\theta/2) \end{bmatrix}.\end{split}\)
- Template Parameters
T – Required precision of gate (
float
ordouble
).U – Required precision of parameter (
float
ordouble
).
- Parameters
params – Vector of gate data. Values are expected in order of \([\phi, \theta, \omega]\).
- Returns
const std::vector<std::complex<T>> Return const Rot gate data.
api/function_namespacePennylane_1_1Gates_1aec1504b87a86c0b4522e41adf053b336
Download Python script
Download Notebook
View on GitHub