# How the arguments of $U_3$ gate are converted when they're not lying in the expected range?

From the qiskit documentation (here), a general form of a single qubit unitary is defined as $$U(\theta, \phi, \lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -e^{i\lambda} \sin\left(\frac{\theta}{2}\right) \\ e^{i\phi} \sin\left(\frac{\theta}{2}\right) & e^{i(\lambda + \phi)} \cos\left(\frac{\theta}{2}\right) \end{pmatrix}.$$ Where $$0β€πβ€π, 0β€π<2π, \text{and} \ 0β€π<2π$$. However, when I tried to put some arguments out of the range, the gate still operates. For example, if I set $$\theta = -1,\phi=8,\lambda=7$$,

simulator = Aer.get_backend('statevector_simulator')
quancir = QuantumCircuit(1)
quancir.u3(-1,8,7,0)
results = execute(quancir, simulator).result()
resvec = results.get_statevector(quancir)
bloch_sphere([conv(resvec)])


I can still visualize how the $$U_3$$ gate operates on the initial state $$|0\rangle$$, and plot the final vector:

I'm wondering if my arguments aren't in the expected range, like in this case, what really happened to the $$U_3$$ gate? Am I still getting the vector I want, or do I need to convert the arguments myself to make sure the output vector is correct? Thanks:)

Update: I tried to take the mod of those parameters but it looks like the output vector is different (points toward the opposite direction):

quancir = QuantumCircuit(1)
T = float(-1%pi)
P = float(8%(2*pi))
L = float(7%(2*pi))
quancir.u3(T,P,L,0)
results = execute(quancir, simulator).result()
resvec = results.get_statevector(quancir)
bloch_sphere([conv(resvec)])


• These are periodic functions. So for instance, $\sin(3) = \sin(3 + 2\pi)$. Mar 25, 2021 at 21:36
• quancir = QuantumCircuit(1) quancir.u3(-1+2*pi,8 - 2*pi ,7 - 2*pi,0) resvec =quancir.statevector() bloch_sphere([resvec]) Try this... Mar 25, 2021 at 22:10
• It is the same as $-1\%(2\pi)$. Note in the function, the factor is $\theta/2$. Mar 25, 2021 at 22:23
• It should be. If you plug in different parameters then you can see it. Mar 25, 2021 at 22:30
• @KAJ226 Thank you so much:)
– ZR-
Mar 25, 2021 at 22:40

In this case all input parameters will be mod $$4\pi$$, $$2\pi$$, and $$2\pi$$ for $$\theta$$, $$\phi$$, and $$\lambda$$ respectively. You will obtain the same vector that you would have received if you took the mod of these parameters yourself.
• You're right, I have corrected my answer. $\theta$ is $4\pi$ periodic due to its factor of $1/2$ as seen in its matrix representation. Mar 28, 2021 at 15:57