1
$\begingroup$

What are the angles (lambda, phi and theta) for Pauli-Z gate in U3 ?

$\endgroup$
1
  • 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 2

1
$\begingroup$

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)
$\endgroup$
1
  • $\begingroup$ I like this solution! $\endgroup$
    – luciano
    Nov 1, 2022 at 8:28
0
$\begingroup$

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$.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.