What are the angles (lambda, phi and theta) for Pauli-Z gate in U3 ?
Asked
Active
Viewed 157 times
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
- 11,986
- 1
- 13
- 34
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
- 6,084
- 1
- 13
- 34