What are the angles (lambda, phi and theta) for Pauli-Z gate in U3 ?
-
1$\begingroup$ related: 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? $\endgroup$– glS ♦Oct 31, 2022 at 9:25
2 Answers
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)
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$.