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 expample in experiment API docs #1433

Merged
merged 151 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 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
5b96dd8
T1 update(issue#1238)
Naohnakazawa Feb 9, 2024
1be1ca0
T1 releasenote update(issue#1238)
Naohnakazawa Feb 10, 2024
0832ec5
ZZRamsey update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
18a681f
Tphi update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
6502bfc
T2Ramsey update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
49b1bcf
T2Hahn update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
01b42ca
T2Hahn update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
cee91de
ZZRamsey update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
832b22c
RoughDrag update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
cd304c1
ReadoutAngle update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
3767d7d
RamseyXY update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
4eb30a2
Rabi update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
d01d766
QubitSpectroscopy update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
f403e7c
MultiStateDiscrimination update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
6f10a01
ZZRamsey update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
af0032b
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 10, 2024
6357a2c
LocalReadoutError update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
6924892
HalfAngle update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
c6940fe
FineXDrag update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
8363d27
FineXAmplitude update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
87dfdbf
EFSpectroscopy update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
77f822b
EFRabi update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
6707540
FineXAmplitude update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
d2bfdbc
FineXAmplitude update (Qiskit-Extensions#1238)
Naohnakazawa Feb 10, 2024
cf01161
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 12, 2024
b5370c8
ZZRamsey impoved by eblack (Qiskit-Extesions#1238)
Naohnakazawa Feb 13, 2024
941eaa6
ZZRamsey improved (Qiskit-Extensions#1238)
Naohnakazawa Feb 13, 2024
ab68d20
ZZRamsey updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 14, 2024
54871fb
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 15, 2024
17f5e8e
ZZRamsey updated for qiskit v1.0.0 (Qiskit-Extension#1238)
Naohnakazawa Feb 16, 2024
e63f281
Tphi updated for qisit v1.0.0 (Qiskit-Extensions#1238)
Naohnakazawa Feb 16, 2024
a9d6d7b
T2Ramsey updated for qiskit v1.0.0 (Qiskit-Extesions#1238)
Naohnakazawa Feb 16, 2024
e48933a
T1 updated for qiskit v1.0.0 (Qiskit-Extensions#1238)
Naohnakazawa Feb 16, 2024
84bafa3
RamseyXY updated for qiskit v1.0.0 (Qiskit-Extensions#1238)
Naohnakazawa Feb 16, 2024
50148c5
LocalReadoutError updated for qiskit v1.0.0 (Qiskit-Extensions#1238)
Naohnakazawa Feb 16, 2024
f3b9f03
FineFrequency updated (Qiskit-Extesions#1238)
Naohnakazawa Feb 19, 2024
e3fde62
FineFrequency : improved (Qiskit-Extensions#1238)
Naohnakazawa Feb 19, 2024
be80c14
FineFrequency : improved (Qiskit-Extensions#1238)
Naohnakazawa Feb 19, 2024
1dbed8c
FienFrequency : impreved (Qiskit-Extensions#1238)
Naohnakazawa Feb 19, 2024
6650cae
CorrelatedReadoutError : updated (Qiskit-extensions#1238)
Naohnakazawa Feb 19, 2024
1e3e7a0
CorrelatedReadoutError : improved (Qiskit-Extensions#1238)
Naohnakazawa Feb 19, 2024
d082d5f
CorrelatedReadoutError : improved (Qiskit-Extensions#1238)
Naohnakazawa Feb 19, 2024
eb05c7e
CorrelatedReadoutError : improved (Qiskit-Extensions#1238)
Naohnakazawa Feb 19, 2024
780c457
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Feb 20, 2024
9c82462
releasenoes/notes/sds.yaml is updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 20, 2024
8e8a850
releasenotes/notes/s-d-s.yaml : updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 20, 2024
42b4f97
a previous s-d-s.yaml is deleted (Qiskit-Extensions#1238)
Naohnakazawa Feb 20, 2024
73dcefe
s-d-s.yaml is updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 20, 2024
0513eea
s-d-s.yaml is updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 20, 2024
b5d80ea
s-d-s.yaml is updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 20, 2024
9fab00f
short-description-string-19804fd679a0d471.yaml : renamed
Naohnakazawa Feb 20, 2024
a8b8e1e
added add-example-to-characterization-experiments-19804fd679a0d471.ya…
Naohnakazawa Feb 20, 2024
e285ac0
ResonatorSpectroscopy updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 25, 2024
13a3dd9
CrossResonanceHamiltonian updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 26, 2024
c99dc87
CR-Hamiltonian updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 26, 2024
56b6abf
CR-Hamiltonian updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 26, 2024
66f401f
EchoedCRH updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 26, 2024
e424ff5
CRH and EchoedCRH : updated (Qiskit-Extensions#1238)
Naohnakazawa Feb 26, 2024
188c95c
releasenotes/notes/add-example-to-characterization-experiments-19804f…
Naohnakazawa Feb 27, 2024
8cfeb12
old reno report is deleted (Qiskit-Extensions#1238)
Naohnakazawa Feb 27, 2024
beae79f
add new releasenote/notes/add-example-to-characterization-experiments…
Naohnakazawa Feb 27, 2024
80fda23
deleted : releasenotes/notes/add-example-to-characterization-experime…
Naohnakazawa Feb 27, 2024
8ff0b42
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 3, 2024
f2b550e
releasenotes/notes/-cc268596887d775d added (Qiskit-Extensions#1238)
Naohnakazawa Mar 5, 2024
554164a
releasenotes/notes/_cc268596887d775d added (Qiskit-Extensions#1238)
Naohnakazawa Mar 5, 2024
4d59bd2
releasenotes/notes/-cc268596887d775d : deleted
Naohnakazawa Mar 5, 2024
2120aa5
releasenotes/notes/-e77d4d26c6b4969a4 added (Qiskit-Extensions#1238)
Naohnakazawa Mar 5, 2024
5ca63ce
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 12, 2024
8fa518b
Add qiskit-ibm-provider to requirements-extras.txt for CorrelatedRead…
Naohnakazawa Mar 12, 2024
ec05a50
FineDrag update (Qiskit-Extensions#1238)
Naohnakazawa Mar 13, 2024
ff1a6b3
FineDrag update (Qiskit-Extensions#1238)
Naohnakazawa Mar 13, 2024
c3f9944
CorrelatedReadoutError update (Qiskit-Extensions#1238)
Naohnakazawa Mar 15, 2024
d293c41
CorrelatedReadoutError update
Naohnakazawa Mar 15, 2024
07a9f5e
ResonatorSpectroscopy update (Qiskit-Extensions#1238)
Naohnakazawa Mar 15, 2024
d131f17
CrossResonanceHamiltoniam and EchoedCRH update
Naohnakazawa Mar 15, 2024
3dc7b9a
CRH update
Naohnakazawa Mar 15, 2024
d46e8d2
ResonatorSpectroscopy update
Naohnakazawa Mar 15, 2024
6f8db43
FineSXAmplitude update
Naohnakazawa Mar 15, 2024
a92fb7b
FineSXAmplitude update
Naohnakazawa Mar 15, 2024
940755a
FineAmplitude update (Qiskit-Extensions#1238)
Naohnakazawa Mar 17, 2024
960ad37
FineAmplitude update (Qiskit-Extensions#1238)
Naohnakazawa Mar 17, 2024
2a136f8
FineAmplitude update (Qiskit-Extensions#1238)
Naohnakazawa Mar 18, 2024
6231a5b
FineSXDrag update (Qiskit-Extensions#1238)
Naohnakazawa Mar 18, 2024
e133d5d
FineSXDrag update
Naohnakazawa Mar 18, 2024
00f1633
MultiStateDiscrimination update
Naohnakazawa Mar 19, 2024
8664376
ZZRamsey update
Naohnakazawa Mar 19, 2024
0a1713f
HalfAngle update (Qiskit-Extensions#1238)
Naohnakazawa Mar 19, 2024
d38f3c0
Rabi update (Qiskit-Extensions#1238)
Naohnakazawa Mar 19, 2024
8181021
Rabi & EFRabi update
Naohnakazawa Mar 19, 2024
8455a71
Rabi & EFRabi update
Naohnakazawa Mar 19, 2024
d39c39b
Rabi & EFRabi update
Naohnakazawa Mar 21, 2024
823a917
MSD update
Naohnakazawa Mar 21, 2024
971a5ad
EFRabi update
Naohnakazawa Mar 21, 2024
e2619a9
RamseyXY update
Naohnakazawa Mar 21, 2024
bd52163
Rabi update
Naohnakazawa Mar 21, 2024
9d7c9c2
EFSpectroscopy update
Naohnakazawa Mar 21, 2024
48ee755
EFRabi update
Naohnakazawa Mar 21, 2024
32a3260
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 26, 2024
dd1513c
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Mar 27, 2024
672848f
CRE update
Naohnakazawa Mar 27, 2024
3043091
CRH and EchoedCRH update
Naohnakazawa Mar 27, 2024
cda08c5
ResonatorSpectroscopy update
Naohnakazawa Mar 27, 2024
7690cc4
CRE update
Naohnakazawa Mar 27, 2024
6e7b968
requirement-dev.txt update (Qiskit-Extensions#1238)
Naohnakazawa Mar 28, 2024
bfc5376
requirements-extras.txt update (Qiskit-Extensions#1238)
Naohnakazawa Mar 28, 2024
585aefe
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Apr 1, 2024
e18bcab
Merge branch 'main' into issue-#1238
Naohnakazawa Apr 16, 2024
e0d412a
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Apr 23, 2024
abd9b99
Merge branch 'Qiskit-Extensions:main' into issue-#1238
Naohnakazawa Apr 23, 2024
3470ff8
code examples in CorrelatedReadoutError, CRHamiltonian and ResonatorS…
Naohnakazawa Apr 26, 2024
7eca570
update a code example of CorrelatedReadoutError
Naohnakazawa Apr 26, 2024
36cdb80
update CorrelatedReadoutError
Naohnakazawa Apr 26, 2024
ef99cef
dependency on qiskit-ibm-provider is deleted in requirements-dev.txt
Naohnakazawa Apr 26, 2024
8db0c73
Merge branch 'main' of https://github.com/Qiskit-Extensions/qiskit-ex…
Naohnakazawa Apr 27, 2024
c11c160
Merge branch 'Qiskit-Extensions:main' into issue-#1238
Naohnakazawa Apr 27, 2024
b155a07
Merge branch 'issue-#1238' of github.com:Naohnakazawa/qiskit-experime…
Naohnakazawa Apr 27, 2024
935a721
read
Naohnakazawa Apr 29, 2024
f62d346
update correlated_readout_error.py(Qiskit-Extesions#1238)
Naohnakazawa Apr 29, 2024
3ffb37b
update fine_frequency.py (Qiskit-Extensions#1238)
Naohnakazawa Apr 30, 2024
764ed94
update t2hahn.py (Qiskit-Extensions#1238)
Naohnakazawa Apr 30, 2024
3e6805d
Merge branch 'main' into issue-#1238
Naohnakazawa May 2, 2024
3bc7ba6
update correlated_readout_error.py(Qiskit-Extensions#1238)
Naohnakazawa May 2, 2024
087d631
update qiskit_experiments/library/characterization/drag.py (Qiskit-Ex…
Naohnakazawa May 2, 2024
3e30fb7
update qiskit_experiments/library/characterization/half_angle.py (Qis…
Naohnakazawa May 2, 2024
41dc16c
update qiskit_experiments/library/characterization/readout_angle.py (…
Naohnakazawa May 2, 2024
662a105
update qiskit_experiments/library/characterization/t2hahn.py
Naohnakazawa May 2, 2024
a3ee6ee
update add-examples-to-characterization-experiments-e77d4d26c6b49694.…
Naohnakazawa May 2, 2024
34f7a19
update qiskit_experiments/library/characterization/t1.py
Naohnakazawa May 2, 2024
90f18aa
update qiskit_experiments/library/characterization/correlated_readout…
Naohnakazawa May 2, 2024
dc72240
update qiskit_experiments/library/characterization/t1.py
Naohnakazawa May 2, 2024
2c1324d
Merge branch 'issue-#1238' of github.com:Naohnakazawa/qiskit-experime…
Naohnakazawa May 2, 2024
a5cfef3
update /characterization/local_readout_error.py (Qiskit-Extensions#1238)
Naohnakazawa May 9, 2024
55eee0b
update /characterization/tphi.py (Qiskit-Extensions#1238)
Naohnakazawa May 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,27 @@ class CorrelatedReadoutError(BaseExperiment):
# section: analysis_ref
:class:`CorrelatedReadoutErrorAnalysis`

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

from qiskit.providers.fake_provider import GenericBackendV2
from qiskit_aer import AerSimulator

num_qubits=5
backend = AerSimulator.from_backend(GenericBackendV2(num_qubits=num_qubits,
calibrate_instructions=True))

.. jupyter-execute::

from qiskit_experiments.library import CorrelatedReadoutError

exp = CorrelatedReadoutError(physical_qubits=(0,1,2), backend=backend)

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

# section: manual
:doc:`/manuals/measurement/readout_mitigation`

Expand Down
28 changes: 28 additions & 0 deletions qiskit_experiments/library/characterization/drag.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,34 @@ class RoughDrag(BaseExperiment, RestlessMixin):
# section: analysis_ref
:class:`DragCalAnalysis`

# 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 import pulse
from qiskit.circuit import Parameter
from qiskit_experiments.library import RoughDrag

with pulse.build() as build_sched:
pulse.play(pulse.Drag(160, 0.50, 40, Parameter("beta")), pulse.DriveChannel(0))

exp = RoughDrag(physical_qubits=(0,),
schedule=build_sched,
betas = np.linspace(-4, 4, 51),
backend=backend,)
exp.set_experiment_options(reps=[3, 5, 7])

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

# section: reference
.. ref_arxiv:: 1 1011.1949
.. ref_arxiv:: 2 0901.0534
Expand Down
25 changes: 25 additions & 0 deletions qiskit_experiments/library/characterization/ef_spectroscopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,32 @@ class EFSpectroscopy(QubitSpectroscopy):
└───┘└────────────┘ ░ └╥┘
measure: 1/═══════════════════════╩═
0
# section: example
.. jupyter-execute::
:hide-code:

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

.. jupyter-execute::

import numpy as np
from qiskit_experiments.library.characterization import EFSpectroscopy

qubit = 0
freq01_estimate = backend.defaults().qubit_freq_est[qubit]
frequencies = np.linspace(freq01_estimate-15e6, freq01_estimate+15e6, 51)

exp = EFSpectroscopy(physical_qubits = (0,),
frequencies = frequencies,
backend = backend,
)
exp.set_experiment_options(amp=0.005)

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

def __init__(
Expand Down
62 changes: 51 additions & 11 deletions qiskit_experiments/library/characterization/fine_amplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,25 @@ class FineAmplitude(BaseExperiment, RestlessMixin):
in this case.

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

The steps to run a fine amplitude experiment are
# backend
from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend
backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e6, noise=True, seed=185)

.. code-block:: python
.. jupyter-execute::

import numpy as np
from qiskit.circuit.library import XGate
from qiskit_experiments.library import FineAmplitude

qubit = 3
amp_cal = FineAmplitude([qubit], SXGate())
amp_cal.set_experiment_options(
angle_per_gate=np.pi/2,
phase_offset=np.pi
)
amp_cal.run(backend)
exp = FineAmplitude(physical_qubits=(0,), gate=XGate(), backend=backend)
exp.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, "phase_offset" : np.pi})

Note that there are subclasses of :class:`FineAmplitude` such as :class:`FineSXAmplitude`
that set the appropriate options for specific gates by default.
exp_data = exp.run().block_for_results()
display(exp_data.figure(0))
exp_data.analysis_results(dataframe=True)

# section: analysis_ref
:class:`FineAmplitudeAnalysis`
Expand Down Expand Up @@ -251,6 +255,24 @@ class FineXAmplitude(FineAmplitude):

:class:`FineXAmplitude` is a subclass of :class:`FineAmplitude` and is used to set
the appropriate values for the default options.

# 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=198)

.. jupyter-execute::

from qiskit_experiments.library import FineXAmplitude

exp = FineXAmplitude(physical_qubits=(0,), backend=backend)

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

def __init__(self, physical_qubits: Sequence[int], backend: Optional[Backend] = None):
Expand Down Expand Up @@ -289,6 +311,24 @@ class FineSXAmplitude(FineAmplitude):

:class:`FineSXAmplitude` is a subclass of :class:`FineAmplitude` and is used to set
the appropriate values for the default options.

# 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=198)

.. jupyter-execute::

from qiskit_experiments.library import FineSXAmplitude

exp = FineSXAmplitude(physical_qubits=(0,), backend=backend)

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

def __init__(self, physical_qubits: Sequence[int], backend: Optional[Backend] = None):
Expand Down
69 changes: 67 additions & 2 deletions qiskit_experiments/library/characterization/fine_drag.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,25 @@ class FineDrag(BaseExperiment, RestlessMixin):
# section: analysis_ref
:class:`.ErrorAmplificationAnalysis`

# 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.circuit.library import XGate
from qiskit_experiments.library.characterization import FineDrag

exp = FineDrag(physical_qubits=(0,), gate=XGate(), backend=backend)

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

# section: reference
.. ref_arxiv:: 1 1612.00858
.. ref_arxiv:: 2 1011.1949
Expand Down Expand Up @@ -235,7 +254,26 @@ def _metadata(self):


class FineXDrag(FineDrag):
"""Class to fine characterize the DRAG parameter of an X gate."""
"""Class to fine characterize the DRAG parameter of an 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=199)

.. jupyter-execute::

from qiskit_experiments.library.characterization import FineXDrag

exp = FineXDrag(physical_qubits=(0,), backend=backend)

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

def __init__(self, physical_qubits: Sequence[int], backend: Optional[Backend] = None):
"""Initialize the experiment."""
Expand All @@ -260,7 +298,34 @@ def _pre_circuit() -> QuantumCircuit:


class FineSXDrag(FineDrag):
"""Class to fine characterize the DRAG parameter of an :math:`SX` gate."""
"""Class to fine characterize the DRAG parameter of an :math:`SX` 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=199)

.. jupyter-execute::

import numpy as np
from qiskit_experiments.library.characterization import FineSXDrag

exp = FineSXDrag(physical_qubits=(0,), backend=backend)
exp.analysis.set_options(normalization= True,
fixed_parameters={
"angle_per_gate" : 0.0,
"phase_offset" : np.pi/2,
"amp" : 0.6
},
)

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

def __init__(self, physical_qubits: Sequence[int], backend: Optional[Backend] = None):
"""Initialize the experiment."""
Expand Down
25 changes: 25 additions & 0 deletions qiskit_experiments/library/characterization/fine_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,31 @@ class FineFrequency(BaseExperiment):
0
# section: analysis_ref
:class:`~qiskit_experiments.curve_analysis.ErrorAmplificationAnalysis`

# 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.library.characterization import FineFrequency

repetitions = list(range(40))

exp = FineFrequency((0,),
delay_duration=320,
backend=backend,
repetitions=repetitions)
exp.set_transpile_options(optimization_level=0, basis_gates=['sx', 'rz', 'delay'])

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

def __init__(
Expand Down
18 changes: 18 additions & 0 deletions qiskit_experiments/library/characterization/half_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@ class HalfAngle(BaseExperiment):
# section: analysis_ref
:class:`.ErrorAmplificationAnalysis`

# 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_experiments.library.characterization import HalfAngle

exp = HalfAngle((0,), backend=backend)

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

# section: reference
.. ref_arxiv:: 1 1504.06597
"""
Expand Down
22 changes: 22 additions & 0 deletions qiskit_experiments/library/characterization/local_readout_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,28 @@ class LocalReadoutError(BaseExperiment):
# section: analysis_ref
:class:`LocalReadoutErrorAnalysis`

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

# backend
from qiskit_aer import AerSimulator
from qiskit_ibm_runtime.fake_provider import FakePerth
backend = AerSimulator.from_backend(FakePerth())

.. jupyter-execute::

from qiskit_experiments.library import LocalReadoutError

qubits = list(range(4))
exp = LocalReadoutError(physical_qubits=qubits, backend=backend)
exp.analysis.set_options(plot=True)
exp.set_run_options(shots=10000)

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

# section: manual
:doc:`/manuals/measurement/readout_mitigation`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ class MultiStateDiscrimination(BaseExperiment):
# section: analysis_ref
:class:`MultiStateDiscriminationAnalysis`

# 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_experiments.library.characterization import MultiStateDiscrimination

exp=MultiStateDiscrimination((0,), backend=backend)

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

# section: reference
`Qiskit Textbook\
<https://github.com/Qiskit/textbook/blob/main/notebooks/quantum-hardware-pulses/accessing_higher_energy_states.ipynb>`_
Expand Down
Loading
Loading