Suppose I use Qiskit to prepare the $| + \rangle$ state using a RY rotation,
import numpy as np
from qiskit import QuantumCircuit
circ = QuantumCircuit(1)
circ.ry(np.pi / 2, 0)
I would like to know the Bloch sphere trajectory of the qubit on the physical level when I do this. Naively, I would expect that this is implemented as a rotation $\pi / 2$ rotation about the $Y$ axis which is the minimal distance path. But as I know, this circuit can be introspected in various ways.
For example, when I transpile
the ciruit to the ibmq_armonk
backend, I get the following circuit level description
which suggests that actually the qubit goes from $| 0 \rangle$ to the xy-plane at some angle $\pi / 4$ away from $+x$ and is then corrected with the final $RZ(\pi / 2)$.
I can then introspect even further at the pulse-level using the build_schedule
utility obtained via from qiskit import schedule as build_schedule
to obtain the description of the circuit as
Schedule((0, ShiftPhase(-1.5707963267948966, DriveChannel(0))), (0, Play(Drag(duration=320, amp=(0.3705139948561776-0.07637772314715083j), sigma=80, beta=-1.0562934233232557), DriveChannel(0))), (320, ShiftPhase(-4.71238898038469, DriveChannel(0))), name="circuit32")
Is there a way--from the pulse level description--to infer the time-dynamics of the state as I apply the RY rotation? It seems like I could possibly apply the DRAG pulse with half the amplitude, but
- I'm not sure how to simulate pulse schedules to get the output state
- I'm not sure that is sound since the DRAG pulse has a complicated definition.
In regards to (1), I tried the following code
backend_sim = qiskit.providers.aer.PulseSimulator()
backend_sim.set_options(system_model=backend.backend)
pulse_qobj = assemble(sched.sched, backend=backend_sim)
results = backend_sim.run(pulse_qobj)
by attempting to guess what system_model
meant in this guide, but this didn't work. Note that backend.backend
is just the armonk backend
wrapped into a custom class and sched.sched
is just a Schedule
object with the DRAG pulse and measurement also wrapped into a custom class.