What are the angles (lambda, phi and theta) for Pauli-Z gate in U3 ?
Asked
Active
Viewed 137 times
1
-
1related: https://quantumcomputing.stackexchange.com/q/6236/55. If that doesn't answer your question, please provide more context and details (by editing the question accordingly, not in the comments). For example, what do you mean exactly with "find angle" here? – glS Oct 31 '22 at 09:25
2 Answers
1
You can use OneQubitEulerDecomposer class as follows:
from qiskit.circuit.library import ZGate
from qiskit.quantum_info import OneQubitEulerDecomposer
decomposer = OneQubitEulerDecomposer('U3')
theta, phi, _lambda = decomposer.angles(ZGate().to_matrix())
print(theta, phi, _lambda)
Egretta.Thula
- 9,972
- 1
- 11
- 30
0
You can turn rewrite your Pauli-Z into a U3 with transpile:
from qiskit import transpile
from qiskit.opflow import Z
circuit_u3 = transpile(Z.to_circuit(), basis_gates=['u3'])
circuit_u3.draw()
┌───────────┐
q: ┤ U3(0,0,π) ├
└───────────┘
There you have the $\texttt{U3}(\theta, \phi, \lambda)$, $\theta=0$, $\phi=0$, and $\lambda=\pi$.
luciano
- 5,763
- 1
- 12
- 34