Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b493b29
add mirror RB experiment and analysis files
albertzhu01 Jul 11, 2022
11b8af2
edit appropriate mirrorRB-relevant files for PR
albertzhu01 Jul 11, 2022
f3121eb
update docstrings
albertzhu01 Jul 11, 2022
b4e6072
delete commented series code
albertzhu01 Jul 11, 2022
aef0379
fix pygsti version
albertzhu01 Jul 12, 2022
933bc7b
remove outcomes setting
albertzhu01 Jul 12, 2022
094ebd0
remove prints and add paper ref
paco-ri Jul 12, 2022
0e1ec4d
remove prints and add paper ref
paco-ri Jul 12, 2022
f28cdb7
move coupling map outside loop, delete elements_without_inv and int_c…
albertzhu01 Jul 12, 2022
281b777
Merge branch 'main' of https://github.com/albertzhu01/qiskit-experiments
albertzhu01 Jul 12, 2022
9a4602a
reformat files with black and lint
albertzhu01 Jul 12, 2022
1c9b350
cleaned RB tutorial
paco-ri Jul 12, 2022
66c6f3e
cleaned RB tutorial
paco-ri Jul 12, 2022
374fc2e
moved Clifford sampling in edgegrab algo
paco-ri Jul 12, 2022
34e2cb7
use full connectivity for coupling map if coupling map is not provided
albertzhu01 Aug 8, 2022
fefc4ba
resolved some merge conflits
paco-ri Aug 31, 2022
b8ab48d
changed AnalysisResult imports
paco-ri Sep 1, 2022
5cd64e5
edited BitGenerator and SeedSequence imports
paco-ri Sep 7, 2022
b43325a
removed MirrorRBPyGSTi from library init file
paco-ri Sep 7, 2022
f172c9b
fix full connectivity map generation code
albertzhu01 Oct 31, 2022
d0feba2
remove MirrorRBPyGSTi from mirror_rb_experiment.py, rb tutorial, and …
albertzhu01 Oct 31, 2022
d069f5d
fix oupling map full connectivity generation and update aer imports i…
albertzhu01 Nov 1, 2022
6846e12
fix merge conflicts with upstream main branch
albertzhu01 Nov 3, 2022
ddfcbaf
reformat imports (temporarily) to pass lint with merged code from ups…
albertzhu01 Nov 3, 2022
1124ea8
merged main
coruscating Dec 12, 2022
057de84
merged main branch
coruscating Jan 31, 2023
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
2 changes: 2 additions & 0 deletions docs/_ext/autoref.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class WebSite(Directive):
.. ref_website:: qiskit-experiments, https://github.com/Qiskit/qiskit-experiments

"""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this file look unnecessary; please revert them if so.

required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True
Expand Down Expand Up @@ -67,6 +68,7 @@ class Arxiv(Directive):
If an article is not found, no journal information will be shown.

"""

required_arguments = 2
optional_arguments = 0
final_argument_whitespace = False
Expand Down
18 changes: 11 additions & 7 deletions docs/tutorials/calibrating_real_device.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"outputs": [],
"source": [
"IBMQ.load_account()\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this file look unnecessary; please revert them if so.

"provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main')\n",
"backend = provider.get_backend('ibmq_lima')"
"provider = IBMQ.get_provider(hub=\"ibm-q\", group=\"open\", project=\"main\")\n",
"backend = provider.get_backend(\"ibmq_lima\")"
]
},
{
Expand Down Expand Up @@ -86,16 +86,17 @@
"\n",
" with pulse.build(name=\"xm\") as xm:\n",
" pulse.play(pulse.Drag(dur, -amp, sigma, beta), drive)\n",
" \n",
"\n",
" with pulse.build(name=\"x90p\") as x90p:\n",
" pulse.play(pulse.Drag(dur, Parameter(\"amp\"), sigma, Parameter(\"β\")), drive)\n",
"\n",
" cals.add_schedule(xp, num_qubits=1)\n",
" cals.add_schedule(xm, num_qubits=1)\n",
" cals.add_schedule(x90p, num_qubits=1)\n",
" \n",
"\n",
" return cals\n",
"\n",
"\n",
"def add_parameter_guesses(cals: Calibrations):\n",
" \"\"\"Add guesses for the parameter values to the calibrations.\"\"\"\n",
" for sched in [\"xp\", \"x90p\"]:\n",
Expand Down Expand Up @@ -376,7 +377,7 @@
"outputs": [],
"source": [
"freq01_estimate = backend.defaults().qubit_freq_est[qubit]\n",
"frequencies = np.linspace(freq01_estimate -15e6, freq01_estimate + 15e6, 51)\n",
"frequencies = np.linspace(freq01_estimate - 15e6, freq01_estimate + 15e6, 51)\n",
"spec = RoughFrequencyCal(qubit, cals, frequencies, backend=backend)\n",
"spec.set_experiment_options(amp=0.005)"
]
Expand Down Expand Up @@ -1098,7 +1099,7 @@
"source": [
"cal_drag.set_experiment_options(reps=[3, 5, 7])\n",
"\n",
"cal_drag.circuits()[5].draw(output='mpl')"
"cal_drag.circuits()[5].draw(output=\"mpl\")"
]
},
{
Expand Down Expand Up @@ -1395,7 +1396,9 @@
"scale = target_angle / (target_angle + dtheta)\n",
"pulse_amp = cals.get_parameter_value(\"amp\", qubit, \"x\")\n",
"print(f\"The ideal angle is {target_angle:.2f} rad. We measured a deviation of {dtheta:.3f} rad.\")\n",
"print(f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\")"
"print(\n",
" f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\"\n",
")"
]
},
{
Expand Down Expand Up @@ -1946,6 +1949,7 @@
],
"source": [
"import qiskit.tools.jupyter\n",
"\n",
"%qiskit_copyright"
]
}
Expand Down
59 changes: 37 additions & 22 deletions docs/tutorials/fine_calibrations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"outputs": [],
"source": [
"IBMQ.load_account()\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this file look unnecessary; please revert them if so.

"provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main')\n",
"backend = provider.get_backend('ibmq_lima')"
"provider = IBMQ.get_provider(hub=\"ibm-q\", group=\"open\", project=\"main\")\n",
"backend = provider.get_backend(\"ibmq_lima\")"
]
},
{
Expand Down Expand Up @@ -82,7 +82,7 @@
}
],
"source": [
"x_pulse = backend.defaults().instruction_schedule_map.get('x', (qubit,)).instructions[0][1].pulse\n",
"x_pulse = backend.defaults().instruction_schedule_map.get(\"x\", (qubit,)).instructions[0][1].pulse\n",
"x_pulse"
]
},
Expand All @@ -94,15 +94,19 @@
"outputs": [],
"source": [
"# create the schedules we need and add them to an instruction schedule map.\n",
"sx_pulse = pulse.Drag(x_pulse.duration, 0.5*x_pulse.amp, x_pulse.sigma, x_pulse.beta, name=\"SXp_d0\")\n",
"y_pulse = pulse.Drag(x_pulse.duration, 1.0j*x_pulse.amp, x_pulse.sigma, x_pulse.beta, name=\"Yp_d0\")\n",
"sx_pulse = pulse.Drag(\n",
" x_pulse.duration, 0.5 * x_pulse.amp, x_pulse.sigma, x_pulse.beta, name=\"SXp_d0\"\n",
")\n",
"y_pulse = pulse.Drag(\n",
" x_pulse.duration, 1.0j * x_pulse.amp, x_pulse.sigma, x_pulse.beta, name=\"Yp_d0\"\n",
")\n",
"\n",
"d0, inst_map = pulse.DriveChannel(qubit), InstructionScheduleMap()\n",
"\n",
"for name, pulse_ in [(\"x\", x_pulse), (\"y\", y_pulse), (\"sx\", sx_pulse)]:\n",
" with pulse.build(name=name) as sched:\n",
" pulse.play(pulse_, d0)\n",
" \n",
"\n",
" inst_map.add(name, (qubit,), sched)"
]
},
Expand Down Expand Up @@ -150,12 +154,12 @@
"metadata": {},
"outputs": [],
"source": [
"pulse_amp = ideal_amp*1.02\n",
"pulse_amp = ideal_amp * 1.02\n",
"target_angle = np.pi\n",
"\n",
"with pulse.build(backend=backend, name=\"x\") as x_over:\n",
" pulse.play(pulse.Drag(x_pulse.duration, pulse_amp, x_pulse.sigma, x_pulse.beta), d0)\n",
" \n",
"\n",
"inst_map.add(\"x\", (qubit,), x_over)"
]
},
Expand Down Expand Up @@ -276,7 +280,9 @@
"dtheta = data_over.analysis_results(\"d_theta\").value.nominal_value\n",
"scale = target_angle / (target_angle + dtheta)\n",
"print(f\"The ideal angle is {target_angle:.2f} rad. We measured a deviation of {dtheta:.3f} rad.\")\n",
"print(f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\")\n",
"print(\n",
" f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\"\n",
")\n",
"print(f\"Amplitude reported by the backend {ideal_amp:.4f}.\")"
]
},
Expand Down Expand Up @@ -338,12 +344,12 @@
"metadata": {},
"outputs": [],
"source": [
"pulse_amp = ideal_amp*0.98\n",
"pulse_amp = ideal_amp * 0.98\n",
"target_angle = np.pi\n",
"\n",
"with pulse.build(backend=backend, name=\"xp\") as x_under:\n",
" pulse.play(pulse.Drag(x_pulse.duration, pulse_amp, x_pulse.sigma, x_pulse.beta), d0)\n",
" \n",
"\n",
"inst_map.add(\"x\", (qubit,), x_under)"
]
},
Expand Down Expand Up @@ -434,7 +440,9 @@
"dtheta = data_under.analysis_results(\"d_theta\").value.nominal_value\n",
"scale = target_angle / (target_angle + dtheta)\n",
"print(f\"The ideal angle is {target_angle:.2f} rad. We measured a deviation of {dtheta:.3f} rad.\")\n",
"print(f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\")\n",
"print(\n",
" f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\"\n",
")\n",
"print(f\"Amplitude reported by the backend {ideal_amp:.4f}.\")"
]
},
Expand Down Expand Up @@ -462,7 +470,7 @@
"outputs": [],
"source": [
"# restore the x_pulse\n",
"inst_map.add(\"x\", (qubit,), backend.defaults().instruction_schedule_map.get('x', (qubit,)))"
"inst_map.add(\"x\", (qubit,), backend.defaults().instruction_schedule_map.get(\"x\", (qubit,)))"
]
},
{
Expand Down Expand Up @@ -571,14 +579,16 @@
}
],
"source": [
"sx = backend.defaults().instruction_schedule_map.get('sx', (qubit,))\n",
"sx = backend.defaults().instruction_schedule_map.get(\"sx\", (qubit,))\n",
"sx_ideal_amp = sx.instructions[0][1].pulse.amp\n",
"\n",
"target_angle = np.pi / 2\n",
"dtheta = data_x90p.analysis_results(\"d_theta\").value.nominal_value\n",
"scale = target_angle / (target_angle + dtheta)\n",
"print(f\"The ideal angle is {target_angle:.2f} rad. We measured a deviation of {dtheta:.3f} rad.\")\n",
"print(f\"Thus, scale the {sx_pulse.amp:.4f} pulse amplitude by {scale:.3f} to obtain {sx_pulse.amp*scale:.5f}.\")\n",
"print(\n",
" f\"Thus, scale the {sx_pulse.amp:.4f} pulse amplitude by {scale:.3f} to obtain {sx_pulse.amp*scale:.5f}.\"\n",
")\n",
"print(f\"Amplitude reported by the backend {sx_ideal_amp:.4f}.\")"
]
},
Expand All @@ -597,11 +607,11 @@
"metadata": {},
"outputs": [],
"source": [
"pulse_amp = sx_pulse.amp*scale\n",
"pulse_amp = sx_pulse.amp * scale\n",
"\n",
"with pulse.build(backend=backend, name=\"sx\") as sx_new:\n",
" pulse.play(pulse.Drag(x_pulse.duration, pulse_amp, x_pulse.sigma, x_pulse.beta), d0)\n",
" \n",
"\n",
"inst_map.add(\"sx\", (qubit,), sx_new)"
]
},
Expand Down Expand Up @@ -681,7 +691,9 @@
"dtheta = data_x90p.analysis_results(\"d_theta\").value.nominal_value\n",
"scale = target_angle / (target_angle + dtheta)\n",
"print(f\"The ideal angle is {target_angle:.2f} rad. We measured a deviation of {dtheta:.3f} rad.\")\n",
"print(f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\")\n",
"print(\n",
" f\"Thus, scale the {pulse_amp:.4f} pulse amplitude by {scale:.3f} to obtain {pulse_amp*scale:.5f}.\"\n",
")\n",
"print(f\"Amplitude reported by the backend {sx_ideal_amp:.4f}.\")"
]
},
Expand Down Expand Up @@ -729,12 +741,12 @@
"metadata": {},
"outputs": [],
"source": [
"pulse_beta = ideal_beta*1.25\n",
"pulse_beta = ideal_beta * 1.25\n",
"target_angle = np.pi\n",
"\n",
"with pulse.build(backend=backend, name=\"x\") as x_over:\n",
" pulse.play(pulse.Drag(x_pulse.duration, x_pulse.amp, x_pulse.sigma, pulse_beta), d0)\n",
" \n",
"\n",
"inst_map.add(\"x\", (qubit,), x_over)"
]
},
Expand Down Expand Up @@ -891,7 +903,9 @@
"\n",
"ddelta = -0.25 * np.sqrt(np.pi) * dtheta * x_pulse.sigma / ((target_angle**2) / 4)\n",
"\n",
"print(f\"Adjust β={pulse_beta:.3f} by ddelta={ddelta:.3f} to get {ddelta + pulse_beta:.3f} as new β.\")\n",
"print(\n",
" f\"Adjust β={pulse_beta:.3f} by ddelta={ddelta:.3f} to get {ddelta + pulse_beta:.3f} as new β.\"\n",
")\n",
"print(f\"The backend reports β={x_pulse.beta:.3f}\")"
]
},
Expand Down Expand Up @@ -1053,7 +1067,7 @@
}
],
"source": [
"sx = backend.defaults().instruction_schedule_map.get('sx', (qubit,))\n",
"sx = backend.defaults().instruction_schedule_map.get(\"sx\", (qubit,))\n",
"sx_amp = sx.instructions[0][1].pulse.amp\n",
"\n",
"print(f\"Adjust the phase of {np.angle(sx_pulse.amp)} of the sx pulse by {-dhac/2:.3f} rad.\")\n",
Expand Down Expand Up @@ -1081,6 +1095,7 @@
],
"source": [
"import qiskit.tools.jupyter\n",
"\n",
"%qiskit_copyright"
]
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading