Skip to content

Commit

Permalink
docs: Propagate acquisitions usage to doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Aug 16, 2024
1 parent e8c81da commit 4123b9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions doc/source/getting-started/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ We leave to the dedicated tutorial a full explanation of the experiment, but her
)

results = platform.execute([sequence], options, [[sweeper]])
probe_pulse = next(iter(sequence.probe_pulses))
_, acq = next(iter(sequence.acquisitions))

# plot the results
amplitudes = magnitude(results[probe_pulse.id][0])
amplitudes = magnitude(results[acq.id][0])
frequencies = (
np.arange(-2e8, +2e8, 1e6) + platform.config(str(qubit.probe.name)).frequency
)
Expand Down
18 changes: 9 additions & 9 deletions doc/source/tutorials/calibration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ In few seconds, the experiment will be finished and we can proceed to plot it.

import matplotlib.pyplot as plt

probe_pulse = sequence.probe_pulses[0]
amplitudes = magnitude(results[probe_pulse.id][0])
acq = sequence.acquisitions[0][1]
amplitudes = magnitude(results[acq.id][0])
frequencies = (
np.arange(-2e8, +2e8, 1e6) + platform.config(str(qubit.probe.name)).frequency
)
Expand Down Expand Up @@ -166,8 +166,8 @@ We can now proceed to launch on hardware:

results = platform.execute([sequence], options, [[sweeper]])

probe_pulse = next(iter(sequence.probe_pulses))
amplitudes = magnitude(results[probe_pulse.id][0])
_, acq = next(iter(sequence.acquisitions))
amplitudes = magnitude(results[acq.id][0])
frequencies = (
np.arange(-2e8, +2e8, 1e6) + platform.config(str(qubit.drive.name)).frequency
)
Expand Down Expand Up @@ -255,19 +255,19 @@ and its impact on qubit states in the IQ plane.
results_one = platform.execute([one_sequence], options)
results_zero = platform.execute([zero_sequence], options)

probe_pulse1 = next(iter(one_sequence.probe_pulses))
probe_pulse2 = next(iter(zero_sequence.probe_pulses))
_, acq1 = next(iter(one_sequence.acquisitions))
_, acq0 = next(iter(zero_sequence.acquisitions))

plt.title("Single shot classification")
plt.xlabel("I [a.u.]")
plt.ylabel("Q [a.u.]")
plt.scatter(
results_one[probe_pulse1.id][0],
results_one[probe_pulse1.id][0],
results_one[acq1.id][0],
results_one[acq1.id][0],
label="One state",
)
plt.scatter(
*unpack(results_zero[probe_pulse2.id][0]),
*unpack(results_zero[acq0.id][0]),
label="Zero state",
)
plt.show()
Expand Down

0 comments on commit 4123b9d

Please sign in to comment.