mindquantum.core.gates.Ryz
- class mindquantum.core.gates.Ryz(pr)[source]
Ryz gate. More usage, please see
RX
.\[\begin{split}Ryz(\theta) = \exp{\left(-i\frac{\theta}{2} Z\otimes Y\right)} = \begin{pmatrix} \cos{\frac{\theta}{2}} & -\sin{\frac{\theta}{2}} & 0 & 0\\ \sin{\frac{\theta}{2}} & \cos{\frac{\theta}{2}} & 0 & 0\\ 0 & 0 & \cos{\frac{\theta}{2}} & \sin{\frac{\theta}{2}}\\ 0 & 0 & -\sin{\frac{\theta}{2}} & \cos{\frac{\theta}{2}}\\ \end{pmatrix}\end{split}\]- Parameters
pr (Union[int, float, str, dict, ParameterResolver]) – the parameters of parameterized gate, see above for detail explanation.
- diff_matrix(pr=None, about_what=None)[source]
Differential form of this parameterized gate.
- Parameters
pr (Union[ParameterResolver, dict]) – The parameter value for parameterized gate. Default: None.
about_what (str) – calculate the gradient w.r.t which parameter. Default: None.
- Returns
numpy.ndarray, the differential form matrix.
- matrix(pr=None, full=False, **kwargs)[source]
Get the matrix of this parameterized gate.
- Parameters
pr (Union[ParameterResolver, dict]) – The parameter value for parameterized gate. Default: None.
full (bool) – Whether to get the full matrix of this gate (the gate should be acted on some qubits). Default:
False
.kwargs (dict) – other key arguments.
- Returns
numpy.ndarray, the matrix of this gate.