Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix allXY plot label and plot #221

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions src/qibocal/calibrations/characterization/allXY.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def allXY(

# retrieve the results for every qubit
for ro_pulse in ro_pulses.values():
r = results[ro_pulse.serial].to_dict_probability(state=0)
z_proj = 2 * results[ro_pulse.serial].ground_state_probability - 1
# store the results
r.update(
{
"gateNumber": gateNumber,
"qubit": ro_pulse.qubit,
"iteration": iteration,
}
)
r = {
"probability": z_proj,
"gateNumber": gateNumber,
"beta_param": beta_param,
"qubit": ro_pulse.qubit,
"iteration": iteration,
}
data.add(r)
count += 1
gateNumber += 1
Expand Down Expand Up @@ -193,16 +193,15 @@ def allXY_drag_pulse_tuning(

# retrieve the results for every qubit
for ro_pulse in ro_pulses.values():
r = results[ro_pulse.serial].to_dict_probability(state=0)
z_proj = 2 * results[ro_pulse.serial].ground_state_probability - 1
# store the results
r.update(
{
"gateNumber": gateNumber,
"beta_param": beta_param,
"qubit": ro_pulse.qubit,
"iteration": iteration,
}
)
r = {
"probability": z_proj,
"gateNumber": gateNumber,
"beta_param": beta_param,
"qubit": ro_pulse.qubit,
"iteration": iteration,
}
data.add(r)
count += 1
gateNumber += 1
Expand Down
22 changes: 20 additions & 2 deletions src/qibocal/plots/allXY.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,20 @@ def allXY(folder, routine, qubit, format):
col=1,
)

fig.add_hline(
y=-1,
line_width=2,
line_dash="dash",
line_color="grey",
row=1,
col=1,
)

fig.update_layout(
showlegend=True,
uirevision="0", # ``uirevision`` allows zooming while live plotting
xaxis_title="Gate sequence number",
yaxis_title="Z projection probability of qubit state |o>",
yaxis_title="Expectation value of Z",
)
return fig

Expand Down Expand Up @@ -194,11 +203,20 @@ def allXY_drag_pulse_tuning(folder, routine, qubit, format):
col=1,
)

fig.add_hline(
y=-1,
line_width=2,
line_dash="dash",
line_color="grey",
row=1,
col=1,
)

fig.update_layout(
showlegend=True,
uirevision="0", # ``uirevision`` allows zooming while live plotting
xaxis_title="Gate sequence number",
yaxis_title="Z projection probability of qubit state |o>",
yaxis_title="Expectation value of Z",
)
return fig

Expand Down