Template Function Pennylane::Gates::getRot¶
Defined in File Gates.hpp
Function Documentation¶
-
template<template<typename...> class ComplexT, typename T, typename U = T>
static auto Pennylane::Gates::getRot(U phi, U theta, U omega) -> std::vector<ComplexT<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
ComplexT – Complex class.
T – Required precision of gate (
float
ordouble
).T – Required precision of parameter (
float
ordouble
).
- Parameters
phi – \(\phi\) shift angle.
theta – \(\theta\) shift angle.
omega – \(\omega\) shift angle.
- Returns
std::vector<ComplexT<T>> Return Rot gate data.
api/function_Gates_8hpp_1a77223ff6deabcc656617371a99b0564b
Download Python script
Download Notebook
View on GitHub