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

Add minimal working code examples in Experiment API docs #1494

Open
wants to merge 157 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
ad6d660
FineFrequencyCal (failed)
Naohnakazawa Sep 15, 2023
56efc5f
fine_frequency_cal : a bit improved
Naohnakazawa Nov 8, 2023
131866d
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Nov 12, 2023
241669b
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Nov 13, 2023
247e8dc
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Dec 5, 2023
3764681
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Dec 14, 2023
f5bd4ac
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Dec 18, 2023
e1c27e4
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Dec 21, 2023
a18dd9f
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Dec 22, 2023
f579970
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Jan 9, 2024
073183e
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Jan 9, 2024
317a763
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Jan 10, 2024
0235766
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Jan 11, 2024
86ae019
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Jan 17, 2024
3977bda
Merge branch 'main' of github.com:Qiskit-Extensions/qiskit-experiments
Naohnakazawa Jan 18, 2024
0b7cae7
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Jan 24, 2024
2547d26
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 9, 2024
26ef0c0
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 9, 2024
2a3c9b5
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 10, 2024
a29022f
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 12, 2024
4a0193a
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 15, 2024
5aeb353
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 20, 2024
536969b
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 3, 2024
3dac8ce
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 4, 2024
027d858
Merge branch 'main' of github.com:Naohnakazawa/qiskit-experiments
Naohnakazawa Mar 4, 2024
c1f143d
Merge branch 'Qiskit-Extensions:main' into main
Naohnakazawa Mar 12, 2024
cabe7f0
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 12, 2024
e099a0d
Merge branch 'main' of github.com:Naohnakazawa/qiskit-experiments
Naohnakazawa Mar 12, 2024
3e5e9d4
Merge branch 'Qiskit-Extensions:main' into main
Naohnakazawa Mar 26, 2024
ccb3d5f
Merge branch 'Qiskit-Extensions:main' into main
Naohnakazawa Mar 26, 2024
04e097c
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 27, 2024
788f4ca
Merge branch 'Qiskit-Extensions:main' into main
Naohnakazawa Apr 1, 2024
57c98d0
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Apr 1, 2024
54164f8
Merge branch 'main' of github.com:Naohnakazawa/qiskit-experiments
Naohnakazawa Apr 1, 2024
9bb8113
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Apr 23, 2024
c95a03d
Merge branch 'qiskit-community:main' into main
Naohnakazawa Oct 24, 2024
6558cbd
Merge branch 'main' of github.com:Naohnakazawa/qiskit-experiments
Naohnakazawa Oct 25, 2024
8577155
Merge branch 'qiskit-community:main' into main
Naohnakazawa Oct 25, 2024
8cece20
Merge branch 'qiskit-community:main' into main
Naohnakazawa Oct 26, 2024
78e7f54
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Oct 26, 2024
610b225
Update fine_amplitude.py
Naohnakazawa Oct 26, 2024
406ed46
Update fine_drag_cal.py
Naohnakazawa Oct 26, 2024
a8c7b91
Update fine_frequency_cal.py
Naohnakazawa Oct 26, 2024
edf3821
Update frequency_cal.py
Naohnakazawa Oct 26, 2024
2aed40f
Update half_angle_cal.py
Naohnakazawa Oct 26, 2024
3ce9c6b
Update rough_amplitude_cal.py
Naohnakazawa Oct 26, 2024
299b66e
Update rough_drag_cal.py
Naohnakazawa Oct 26, 2024
df39f1e
Update rough_frequency.py
Naohnakazawa Oct 26, 2024
9754dca
Update qst_experiment.py
Naohnakazawa Oct 28, 2024
f0bfe36
Update qst_experiment.py
Naohnakazawa Oct 28, 2024
6c43253
Update tomography_experiment.py
Naohnakazawa Oct 28, 2024
0e8e6ad
Update mit_qst_experiment.py
Naohnakazawa Oct 28, 2024
5eeea9b
Update qpt_experiment.py
Naohnakazawa Oct 28, 2024
0be4c0d
Update mit_qpt_experiment.py
Naohnakazawa Oct 28, 2024
fea22e9
Update mit_qpt_experiment.py
Naohnakazawa Oct 28, 2024
a252cc8
Update qv_experiment.py
Naohnakazawa Oct 28, 2024
2fc0ee3
Update standard_rb.py
Naohnakazawa Oct 29, 2024
b4a81fe
Update standard_rb.py
Naohnakazawa Oct 29, 2024
8d41d01
Update interleaved_rb_experiment.py
Naohnakazawa Oct 29, 2024
8faa9e8
Update layer_fidelity.py
Naohnakazawa Oct 29, 2024
ccfd09b
Update rabi.py
Naohnakazawa Oct 29, 2024
a264859
Update ef_spectroscopy.py
Naohnakazawa Oct 29, 2024
ca04ade
Merge branch 'issue-#1238-draft' of github.com:Naohnakazawa/qiskit-ex…
Naohnakazawa Oct 29, 2024
b6bd9b5
update fine_amplitude.py
Naohnakazawa Oct 29, 2024
a58e115
update rough_frequency.py
Naohnakazawa Oct 29, 2024
b45902f
update randomized_benchmarking/layer_fidelity.py
Naohnakazawa Oct 29, 2024
9e828b3
update tomography/qpt_experiment.py
Naohnakazawa Oct 29, 2024
c919d7c
update tomography/qst_experiment.py
Naohnakazawa Oct 29, 2024
ee2e8bb
update calibration/fine_drag_cal.py
Naohnakazawa Oct 29, 2024
1cb91cc
update tomography/mit_qpt_experiment.py
Naohnakazawa Oct 29, 2024
063e870
update tomography/mit_qst_experiment.py
Naohnakazawa Oct 29, 2024
cc8de31
update tomography/mit_qst_experiment.py
Naohnakazawa Oct 29, 2024
f0ee881
update tomography/mit_qpt_experiment.py
Naohnakazawa Oct 29, 2024
050fd50
update calibration/fine_drag_cal.py
Naohnakazawa Oct 29, 2024
2a12c67
update calibration/fine_frequency_cal.py
Naohnakazawa Oct 29, 2024
2b0e196
update calibration/fine_frequency_cal.py
Naohnakazawa Oct 29, 2024
288c021
update calibration/frequency_cal.py
Naohnakazawa Oct 29, 2024
c6686fc
update calibration/rough_amplitude_cal.py
Naohnakazawa Oct 29, 2024
b11fd67
update calibration/rough_drag_cal.py
Naohnakazawa Oct 29, 2024
8f46477
update calibration/rough_frequency.py
Naohnakazawa Oct 29, 2024
7c9b2df
update calibration/fine_amplitude.py
Naohnakazawa Oct 29, 2024
b615d5e
update calibration/fine_frequency_cal.py
Naohnakazawa Oct 29, 2024
4a11bab
update calibration/frequency_cal.py
Naohnakazawa Oct 29, 2024
d6aca98
update calibration/rough_amplitude_cal.py
Naohnakazawa Oct 29, 2024
731c04c
update calibration/rough_drag_cal.py
Naohnakazawa Oct 29, 2024
3740dee
update calibration/rough_frequency.py
Naohnakazawa Oct 29, 2024
c8d60a3
update calibration/half_angle_cal.py
Naohnakazawa Oct 29, 2024
98a67a9
update calibration/half_angle_cal.py
Naohnakazawa Oct 29, 2024
f70ceb1
update driven_freq_tuning/ramsey_amp_scan.py
Naohnakazawa Oct 29, 2024
b541b8b
update driven_freq_tuning/p1_spect.py
Naohnakazawa Oct 29, 2024
03b541b
update driven_freq_tuning/p1_spect.py
Naohnakazawa Oct 29, 2024
36d010d
update calibration/rough_drag_cal.py
Naohnakazawa Oct 30, 2024
43ad417
update releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3…
Naohnakazawa Oct 30, 2024
c81f6a4
improved calibrations/fine_amplitude.py
Naohnakazawa Nov 2, 2024
03777b6
improved calibration/fine_drag_cal.py
Naohnakazawa Nov 2, 2024
2d1b414
improved EFRoughXSXAmplitudeCal
Naohnakazawa Nov 3, 2024
92b7005
imploved rough_amplitude_cal.py
Naohnakazawa Nov 5, 2024
cd19f34
improved RoughDragCal
Naohnakazawa Nov 5, 2024
1e3180a
improved StarkRamseyXYAmpScan
Naohnakazawa Nov 5, 2024
f78a31d
improved QuantumVolume
Naohnakazawa Nov 5, 2024
c43c835
improved RoughEFFrequencyCal
Naohnakazawa Nov 6, 2024
fa360ad
improved LayerFidelity
Naohnakazawa Nov 6, 2024
54e024a
improved StandardRB
Naohnakazawa Nov 6, 2024
aa141fd
updated releasenotes/notes/add-examples-to-experiments-api-docs-31f3e…
Naohnakazawa Nov 7, 2024
6b5f64b
improved StarkP1Spectroscopy
Naohnakazawa Nov 7, 2024
95e8d3f
releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6…
Naohnakazawa Nov 7, 2024
6c86cee
Merge branch 'main' of https://github.com/Qiskit-Community/qiskit-exp…
Naohnakazawa Nov 14, 2024
b685974
Merge branch 'issue-#1238-draft' of github.com:Naohnakazawa/qiskit-ex…
Naohnakazawa Nov 14, 2024
15f6055
Merge branch 'main' of https://github.com/Qiskit-Community/qiskit-exp…
Naohnakazawa Nov 14, 2024
b7ffa89
update calibration/fine_amplitude.py
Naohnakazawa Nov 19, 2024
0875788
update calibration/fine_drag_cal.py
Naohnakazawa Nov 19, 2024
1c4f1b3
update calibration/fine_frequency_cal.py
Naohnakazawa Nov 19, 2024
b71d521
update calibration/frequency_cal.py
Naohnakazawa Nov 19, 2024
261c89c
update calibration/half_angle_cal.py
Naohnakazawa Nov 19, 2024
1ef6637
update calibration/rough_amplitude_cal.py
Naohnakazawa Nov 19, 2024
dd820ae
update calibration/rough_drag_cal.py
Naohnakazawa Nov 19, 2024
8b8f9a0
update calibration/rough_frequency.py
Naohnakazawa Nov 19, 2024
e0673aa
removed: a code exapmle for StarkP1Spectroscopy
Naohnakazawa Nov 19, 2024
75ae3c2
update EFRabi
Naohnakazawa Nov 19, 2024
f754951
update releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3…
Naohnakazawa Nov 19, 2024
32e749f
Merge branch 'main' of https://github.com/Qiskit-Community/qiskit-exp…
Naohnakazawa Nov 19, 2024
3f24c15
removed: an example of StarkRamseyXYAmpScan in private-v3.2 (PR draft…
Naohnakazawa Nov 21, 2024
4361bf9
update releasenotes: removed StarkRamseyXYAmpScan
Naohnakazawa Nov 21, 2024
bc28a49
update FineAmplitude-type experiment
Naohnakazawa Nov 23, 2024
0490069
update FineDrag-type experiments
Naohnakazawa Nov 23, 2024
db09f36
update FineFrequencyCal-type experiments
Naohnakazawa Nov 23, 2024
e86a4ee
update FrequencyCal-type experiments
Naohnakazawa Nov 23, 2024
4bc9f82
update HalfAngleCal experiment
Naohnakazawa Nov 23, 2024
8750882
update RoughAmplitudeCal-type experiments
Naohnakazawa Nov 23, 2024
5846e51
update RoughFrequencyCal experiment
Naohnakazawa Nov 23, 2024
b30b14f
update EFSpectroscopy
Naohnakazawa Nov 23, 2024
b310d0b
update QuantumVolume
Naohnakazawa Nov 23, 2024
83423f7
update InterleavedRB
Naohnakazawa Nov 23, 2024
86c465d
update StandardRB
Naohnakazawa Nov 23, 2024
fd372eb
update MitigatedProcessTomography
Naohnakazawa Nov 23, 2024
e29a20f
update MitigatedStateTomography
Naohnakazawa Nov 23, 2024
bc8cb84
update ProcessTomography
Naohnakazawa Nov 23, 2024
33444a0
update StateTomography
Naohnakazawa Nov 23, 2024
62d19e9
update TomographyExperiment
Naohnakazawa Nov 23, 2024
b3e2f40
Merge branch 'main' of https://github.com/Qiskit-Community/qiskit-exp…
Naohnakazawa Nov 27, 2024
b92cdbe
update FineFrequency
Naohnakazawa Nov 27, 2024
36191e7
update FrequencyCal
Naohnakazawa Nov 27, 2024
3e922f1
update FineFrequency
Naohnakazawa Nov 27, 2024
bd856bd
update QuantumVolume
Naohnakazawa Nov 27, 2024
02194c0
update InterleavedRB
Naohnakazawa Nov 27, 2024
d1c49a7
update LayerFidelity
Naohnakazawa Nov 27, 2024
9d566b5
update StandardRB
Naohnakazawa Nov 27, 2024
0e7d3ff
update MitigatedQPT
Naohnakazawa Nov 27, 2024
8f2a196
update MitigatedQST
Naohnakazawa Nov 27, 2024
f5f5a7d
update ProcessTomography
Naohnakazawa Nov 27, 2024
7ea967d
update StateTomography
Naohnakazawa Nov 27, 2024
84bc8d5
update TomographyExperiment
Naohnakazawa Nov 27, 2024
5ec0c2b
update MitigatedQST
Naohnakazawa Nov 27, 2024
1538797
update MitigatedQPT
Naohnakazawa Nov 27, 2024
58f7881
update StateTomography
Naohnakazawa Nov 27, 2024
c9c8135
update StateTomograpy
Naohnakazawa Nov 27, 2024
2f59a27
update TomographyExperiment
Naohnakazawa Nov 27, 2024
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
100 changes: 98 additions & 2 deletions qiskit_experiments/library/calibration/fine_amplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,40 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude):
experiment the circuits that are run have a custom gate with the pulse schedule attached
to it through the calibrations.

# section: example
.. jupyter-execute::
:hide-code:

# backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=101)

.. jupyter-execute::

import numpy as np
from qiskit.circuit.library import XGate
from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library import FineAmplitudeCal

library = FixedFrequencyTransmon()
cals = Calibrations.from_backend(backend=backend, libraries=[library])
exp_cal = FineAmplitudeCal(physical_qubits=(0,),
calibrations=cals,
schedule_name="x",
backend=backend,
cal_parameter_name="amp",
auto_update=True,
gate=XGate(),
measurement_qubits=(0,))
# This option is necessary!
exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi,
"phase_offset" : np.pi/2})

cal_data = exp_cal.run().block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
Expand Down Expand Up @@ -156,7 +190,38 @@ def update_calibrations(self, experiment_data: ExperimentData):


class FineXAmplitudeCal(FineAmplitudeCal):
"""A calibration experiment to calibrate the amplitude of the X schedule."""
"""A calibration experiment to calibrate the amplitude of the X schedule.

# section: example
.. jupyter-execute::
:hide-code:

# backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=111)

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library import FineXAmplitudeCal

library = FixedFrequencyTransmon(default_values={"duration": 320})
cals = Calibrations.from_backend(backend, libraries=[library])

exp_cal = FineXAmplitudeCal((0,),
cals,
schedule_name="x",
backend=backend,
cal_parameter_name="amp",
auto_update=True,
)

exp_data = exp_cal.run().block_for_results()
display(exp_data.figure(0))
exp_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down Expand Up @@ -204,7 +269,38 @@ def _pre_circuit(self, num_clbits: int) -> QuantumCircuit:


class FineSXAmplitudeCal(FineAmplitudeCal):
"""A calibration experiment to calibrate the amplitude of the SX schedule."""
"""A calibration experiment to calibrate the amplitude of the SX schedule.

# section: example
.. jupyter-execute::
:hide-code:

# backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=105)

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library import FineSXAmplitudeCal

library = FixedFrequencyTransmon(default_values={"duration": 320})
cals = Calibrations.from_backend(backend, libraries=[library])

exp_cal = FineSXAmplitudeCal((0,),
cals,
schedule_name="sx",
backend=backend,
cal_parameter_name="amp",
auto_update=True,
)

cal_data = exp_cal.run().block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down
97 changes: 94 additions & 3 deletions qiskit_experiments/library/calibration/fine_drag_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,38 @@


class FineDragCal(BaseCalibrationExperiment, FineDrag):
"""A calibration version of the fine DRAG experiment."""
"""A calibration version of the fine DRAG experiment.

# section: example
.. jupyter-execute::
:hide-code:

#backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=108)

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library import FineDragCal

library = FixedFrequencyTransmon(default_values={"duration": 320})
cals = Calibrations.from_backend(backend, libraries=[library])

exp_cal = FineDragCal((0,),
cals,
backend=backend,
schedule_name="sx",
cal_parameter_name="β",
auto_update=True,
)

cal_data = exp_cal.run().block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down Expand Up @@ -146,7 +177,37 @@ def update_calibrations(self, experiment_data: ExperimentData):


class FineXDragCal(FineDragCal):
"""Fine DRAG calibration of X gate."""
"""Fine DRAG calibration of X gate.

# section: example
.. jupyter-execute::
:hide-code:

#backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=118)

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library import FineXDragCal

library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.4})
cals = Calibrations.from_backend(backend, libraries=[library])

exp_cal = FineXDragCal((0,),
cals,
backend=backend,
cal_parameter_name="β",
auto_update=True,
)

cal_data = exp_cal.run().block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down Expand Up @@ -178,7 +239,37 @@ def __init__(


class FineSXDragCal(FineDragCal):
"""Fine DRAG calibration of X gate."""
"""Fine DRAG calibration of X gate.

# section: example
.. jupyter-execute::
:hide-code:

#backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=118)

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library import FineSXDragCal

library = FixedFrequencyTransmon(default_values={"duration": 320})
cals = Calibrations.from_backend(backend=backend, libraries=[library])

exp_cal = FineSXDragCal((0,),
cals,
backend=backend,
cal_parameter_name="β",
auto_update=True,
)

cal_data = exp_cal.run().block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down
27 changes: 26 additions & 1 deletion qiskit_experiments/library/calibration/fine_frequency_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,32 @@


class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency):
"""A calibration version of the fine frequency experiment."""
"""A calibration version of the fine frequency experiment.

# section: example
.. jupyter-execute::
:hide-code:

# backend
from qiskit_ibm_runtime.fake_provider import FakePerth
from qiskit_aer import AerSimulator

backend = AerSimulator.from_backend(FakePerth())

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library.calibration.fine_frequency_cal import FineFrequencyCal

cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()])
exp_cal = FineFrequencyCal((0,), cals, backend=backend, auto_update=True, gate_name="sx")

cal_data=exp_cal.run(backend_run=True).block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down
27 changes: 26 additions & 1 deletion qiskit_experiments/library/calibration/frequency_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,32 @@


class FrequencyCal(BaseCalibrationExperiment, RamseyXY):
"""A qubit frequency calibration experiment based on the Ramsey XY experiment."""
"""A qubit frequency calibration experiment based on the Ramsey XY experiment.

# section: example
.. jupyter-execute::
:hide-code:

# backend
from qiskit_ibm_runtime.fake_provider import FakePerth
from qiskit_aer import AerSimulator

backend = AerSimulator.from_backend(FakePerth())

.. jupyter-execute::

from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library.calibration.frequency_cal import FrequencyCal

cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()])
exp_cal = FrequencyCal((0,), cals, backend=backend, auto_update=True)

cal_data=exp_cal.run(backend_run=True).block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down
36 changes: 35 additions & 1 deletion qiskit_experiments/library/calibration/half_angle_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,41 @@


class HalfAngleCal(BaseCalibrationExperiment, HalfAngle):
"""Calibration version of the :class:`.HalfAngle` experiment."""
"""Calibration version of the :class:`.HalfAngle` experiment.

# section: example
.. jupyter-execute::
:hide-code:

# backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=199)

.. jupyter-execute::

from qiskit import pulse
from qiskit_experiments.calibration_management.calibrations import Calibrations
from qiskit_experiments.calibration_management.basis_gate_library \
import FixedFrequencyTransmon
from qiskit_experiments.library.calibration.half_angle_cal import HalfAngleCal

library = FixedFrequencyTransmon(default_values={"duration": 640})
cals = Calibrations.from_backend(backend=backend, libraries=[library])
exp_cal = HalfAngleCal((0,), cals, backend=backend)

inst_map = backend.defaults().instruction_schedule_map
with pulse.build(backend=backend, name="y") as sched_build:
pulse.play(pulse.Drag(duration=160,
sigma=40,
beta=5,
amp=0.05821399464431249,
angle=0.0,), pulse.DriveChannel(0),)
inst_map.add("y", (0,), sched_build)

cal_data = exp_cal.run().block_for_results()
display(cal_data.figure(0))
cal_data.analysis_results(dataframe=True)
"""

def __init__(
self,
Expand Down
Loading
Loading