From ad6d660f207ec9ff8254dfc4d3d95e4a7c301dd9 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa Date: Fri, 15 Sep 2023 09:17:11 +0900 Subject: [PATCH 001/171] FineFrequencyCal (failed) --- .../library/calibration/fine_frequency_cal.py | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 5fe3251f89..51312ff660 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -28,7 +28,54 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): - """A calibration version of the fine frequency experiment.""" + """A calibration version of the fine frequency experiment. + + # section: example + ..jupyter-execute:: + + # mwc + import pandas as pd + import numpy as np + import qiskit.pulse as pulse + from qiskit.circuit import Parameter + from qiskit_experiments.calibration_management.calibrations import Calibrations + from qiskit import schedule + from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend + + ..jupyter-execute:: + :hide-code: + + # backend + backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, noise=False, seed=100) + + ..jupyter-execute:: + + # mwc + from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + + qubit = 0 + library = FixedFrequencyTransmon(default_values={"duration": 320}) + cals = Calibrations.from_backend(backend, libraries=[library]) + + from qiskit_experiments.library import FineFrequencyCal + + freq_cal = FineFrequencyCal([qubit], + cals, + backend=backend, + delay_duration=None, + repetitions=None, + auto_update=True, + gate_name="sx", + ) + + freq_cal.set_transpile_options(scheduling_method="asap", + optimization_level=3, + basis_gates=["sx", "rz", "delay"] + ) + + exp_data_x90p = freq_cal.run().block_for_results() + exp_data_x90p.figure(0) + """ def __init__( self, From 56efc5f734d753b00e95138f1db99da340a320aa Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa Date: Wed, 8 Nov 2023 12:18:21 +0900 Subject: [PATCH 002/171] fine_frequency_cal : a bit improved --- .../library/calibration/fine_frequency_cal.py | 49 +------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 51312ff660..5fe3251f89 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -28,54 +28,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): - """A calibration version of the fine frequency experiment. - - # section: example - ..jupyter-execute:: - - # mwc - import pandas as pd - import numpy as np - import qiskit.pulse as pulse - from qiskit.circuit import Parameter - from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit import schedule - from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend - - ..jupyter-execute:: - :hide-code: - - # backend - backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, noise=False, seed=100) - - ..jupyter-execute:: - - # mwc - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon - - qubit = 0 - library = FixedFrequencyTransmon(default_values={"duration": 320}) - cals = Calibrations.from_backend(backend, libraries=[library]) - - from qiskit_experiments.library import FineFrequencyCal - - freq_cal = FineFrequencyCal([qubit], - cals, - backend=backend, - delay_duration=None, - repetitions=None, - auto_update=True, - gate_name="sx", - ) - - freq_cal.set_transpile_options(scheduling_method="asap", - optimization_level=3, - basis_gates=["sx", "rz", "delay"] - ) - - exp_data_x90p = freq_cal.run().block_for_results() - exp_data_x90p.figure(0) - """ + """A calibration version of the fine frequency experiment.""" def __init__( self, From 610b2257273a88f19796c0ed544ef3e3a832c638 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:28:06 +0900 Subject: [PATCH 003/171] Update fine_amplitude.py update fine_amplitude.py --- .../library/calibration/fine_amplitude.py | 102 +++++++++++++++++- 1 file changed, 100 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 8e3ff17972..c99f8d4768 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -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}) + + print(exp_cal.circuits()[5]) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) """ def __init__( @@ -156,8 +190,38 @@ def update_calibrations(self, experiment_data: ExperimentData): class FineXAmplitudeCal(FineAmplitudeCal): - """A calibration experiment to calibrate the amplitude of the X schedule.""" + r"""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, physical_qubits: Sequence[int], @@ -204,7 +268,41 @@ def _pre_circuit(self, num_clbits: int) -> QuantumCircuit: class FineSXAmplitudeCal(FineAmplitudeCal): - """A calibration experiment to calibrate the amplitude of the SX schedule.""" + r"""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:: + + import numpy as np + import qiskit.pulse as pulse + from qiskit import schedule + from qiskit.circuit import Parameter + 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, From 406ed4634c01df7f04dfab91624a3e9a02a40d99 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:49:46 +0900 Subject: [PATCH 004/171] Update fine_drag_cal.py update fine_drag_cal.py --- .../library/calibration/fine_drag_cal.py | 104 +++++++++++++++++- 1 file changed, 101 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index 74ff341657..5735eaf4f6 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -30,7 +30,38 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): - """A calibration version of the fine DRAG experiment.""" + r"""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:: + + import numpy as np + 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, @@ -146,7 +177,44 @@ def update_calibrations(self, experiment_data: ExperimentData): class FineXDragCal(FineDragCal): - """Fine DRAG calibration of X gate.""" + r"""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:: + + import numpy as np + import pandas as pd + 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)) + display(cal_data.analysis_results(dataframe=True)) + + pd.DataFrame(**cals.parameters_table(qubit_list=[0])) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) + """ def __init__( self, @@ -178,7 +246,37 @@ def __init__( class FineSXDragCal(FineDragCal): - """Fine DRAG calibration of X gate.""" + r"""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:: + + import numpy as np + 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, From a8c7b910989d8dc9879ac323bc1f3187ba14e497 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:56:21 +0900 Subject: [PATCH 005/171] Update fine_frequency_cal.py update fine_frequency_cal.py --- .../library/calibration/fine_frequency_cal.py | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 13b1c64b62..7cc161d5f6 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -28,7 +28,31 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): - """A calibration version of the fine frequency experiment.""" + r"""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().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) + """ def __init__( self, From edf38217d16bb420190b48d13547bc4aa61d48c0 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:02:11 +0900 Subject: [PATCH 006/171] Update frequency_cal.py update frequency_cal.py --- .../library/calibration/frequency_cal.py | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index 5f683b217d..e96d23812b 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -27,7 +27,31 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): - """A qubit frequency calibration experiment based on the Ramsey XY experiment.""" + r"""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().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) + """ def __init__( self, From 2aed40fcd10672c816de1fa6b1bed4d7b0eb0883 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:08:22 +0900 Subject: [PATCH 007/171] Update half_angle_cal.py update half_angle_cal.py --- .../library/calibration/half_angle_cal.py | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index e3c3784ba3..696e0057f5 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -28,7 +28,40 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): - """Calibration version of the :class:`.HalfAngle` experiment.""" + r"""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, From 3ce9c6bbb835c888bb98d9d6d2ab82c10a715867 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:25:54 +0900 Subject: [PATCH 008/171] Update rough_amplitude_cal.py update rough_amplitude_cal.py --- .../calibration/rough_amplitude_cal.py | 133 +++++++++++++++++- 1 file changed, 131 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index c6bea05d53..24f67522f0 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -31,7 +31,40 @@ class RoughAmplitudeCal(BaseCalibrationExperiment, Rabi): - """A calibration version of the Rabi experiment.""" + r"""A calibration version of the Rabi 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=True, seed=106) + + .. jupyter-execute:: + + import numpy as np + from qiskit_experiments.calibration_management.calibrations import Calibrations + from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.library.calibration import RoughAmplitudeCal + + library = FixedFrequencyTransmon() + cals = Calibrations.from_backend(backend=backend, libraries=[library]) + + exp_cal = RoughAmplitudeCal(physical_qubits=(0,), + calibrations=cals, + schedule_name="x", + amplitudes=np.linspace(-0.1, 0.1, 51), + cal_parameter_name="amp", + target_angle=np.pi, + auto_update=True, + group="default", + backend=backend) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) + """ def __init__( self, @@ -189,7 +222,31 @@ def update_calibrations(self, experiment_data: ExperimentData): class RoughXSXAmplitudeCal(RoughAmplitudeCal): - """A rough amplitude calibration of x and sx gates.""" + r"""A rough amplitude calibration of x and sx gates. + + # 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=180) + + .. jupyter-execute:: + + import numpy as np + from qiskit_experiments.calibration_management.calibrations import Calibrations + from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.library.calibration import RoughXSXAmplitudeCal + + library = FixedFrequencyTransmon() + cals = Calibrations.from_backend(backend, libraries=[library]) + exp_cal = RoughXSXAmplitudeCal((0,), cals, backend=backend, amplitudes=np.linspace(-0.1, 0.1, 51)) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) + """ def __init__( self, @@ -220,6 +277,78 @@ def __init__( class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): r"""A rough amplitude calibration of :math:`X` and :math:`SX` gates on the :math:`|1\rangle` <-> :math:`|2\rangle` transition. + + # 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=180) + + .. jupyter-execute:: + + import numpy as np + import pandas as pd + import qiskit.pulse as pulse + from qiskit.compiler import schedule + from qiskit.circuit import Parameter + from qiskit_experiments.calibration_management.calibrations import Calibrations + from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.library.calibration import EFRoughXSXAmplitudeCal + + library = FixedFrequencyTransmon() + cals = Calibrations.from_backend( + backend=backend, + libraries=[library] + ) + + amp = Parameter("amp") + + with pulse.build(name="x12") as build_x12: + with pulse.align_left(): + pulse.shift_frequency(-.25e9, pulse.DriveChannel(0)) + pulse.play(pulse.Drag(160, + amp, + 40, + 0., + 0., + ), pulse.DriveChannel(0)) + + with pulse.build(name="sx12") as build_sx12: + with pulse.align_left(): + pulse.shift_frequency(-.25e9, pulse.DriveChannel(0)) + pulse.play(pulse.Drag(160, + amp / 2, + 40, + 0., + 0., + ), pulse.DriveChannel(0)) + + cals.add_schedule(build_x12, qubits=(0,), num_qubits=1) + cals.add_schedule(build_sx12, qubits=(0,), num_qubits=1) + for sched in ["x", "x12"]: + cals.add_parameter_value(0.5, "amp", (0,), schedule=sched) + + for sched in ["sx", "sx12"]: + cals.add_parameter_value(0.25, "amp", (0,), schedule=sched) + + columns_to_show = ["parameter", "qubits", "schedule", "value", "date_time"] + pd.DataFrame(**cals.parameters_table(qubit_list=[0, ()]))[columns_to_show] + + exp_cal = EFRoughXSXAmplitudeCal(physical_qubits=(0,), + calibrations=cals, + amplitudes=np.linspace(-0.1, 0.1, 51), + backend=backend, + ef_pulse_label="12",) + + print(exp_cal.calibrations) + print(exp_cal.circuits()[0]) + print(exp_cal.circuits()[0].calibrations) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) """ __outcome__ = "rabi_rate_12" From 299b66e85bf97697cf6094882dcb43496053b6bf Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:36:09 +0900 Subject: [PATCH 009/171] Update rough_drag_cal.py update rough_drag_cal.py --- .../library/calibration/rough_drag_cal.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index 21e055f8c4..afe8a2599e 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -32,6 +32,32 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): # section: manual :ref:`DRAG Calibration` + # 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=161) + + .. jupyter-execute:: + + import numpy as np + import qiskit.pulse as pulse + from qiskit import schedule + from qiskit.circuit import Parameter + from qiskit_experiments.calibration_management.calibrations import Calibrations + from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.library import RoughDragCal + + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.03}) + cals = Calibrations.from_backend(backend=backend, libraries=[library]) + exp_cal = RoughDragCal((0,), cals, backend=backend, betas=np.linspace(-20, 20, 25)) + exp_cal.set_experiment_options(reps=[3, 5, 7]) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) """ def __init__( From df39f1ed4fbb4886ab4b7c1638b13d7120a3f142 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:45:14 +0900 Subject: [PATCH 010/171] Update rough_frequency.py update rough_frequency.py remark: RoughEFFrequencyCal is missing --- .../library/calibration/rough_frequency.py | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index a40f7dcb80..2d5bbff39e 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -27,8 +27,37 @@ class RoughFrequencyCal(BaseCalibrationExperiment, QubitSpectroscopy): - """A calibration experiment that runs :class:`.QubitSpectroscopy` to calibrate the qubit - transition frequency.""" + r"""A calibration experiment that runs :class:`.QubitSpectroscopy` to calibrate the qubit + transition frequency. + + # 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=100) + + .. jupyter-execute:: + + import numpy as np + from qiskit_experiments.calibration_management.calibrations import Calibrations + from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.library.calibration.rough_frequency import RoughFrequencyCal + + qubit=0 + library = FixedFrequencyTransmon() + cals = Calibrations.from_backend(backend=backend, libraries=[library]) + + freq_est = backend.defaults().qubit_freq_est[qubit] + frequencies = np.linspace(freq_est-15e6, freq_est+15e6, 51) + exp_cal = RoughFrequencyCal((qubit,), cals, frequencies, backend=backend) + exp_cal.set_experiment_options(amp=0.005) + + cal_data = exp_cal.run().block_for_results() + display(cal_data.figure(0)) + cal_data.analysis_results(dataframe=True) + """ def __init__( self, @@ -78,6 +107,11 @@ def _attach_calibrations(self, circuit: QuantumCircuit): class RoughEFFrequencyCal(BaseCalibrationExperiment, EFSpectroscopy): r"""A calibration experiment that runs :class:`.QubitSpectroscopy` for the :math:`|1\rangle` <-> :math:`|2\rangle` transition. + + + + + """ __updater__ = Frequency From 9754dca7c210969e30180b443b7c735dca80c320 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:49:07 +0900 Subject: [PATCH 011/171] Update qst_experiment.py update QST --- .../library/tomography/qst_experiment.py | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index 39c17a11d6..226f67cfa5 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -26,7 +26,7 @@ class StateTomography(TomographyExperiment): - """An experiment to reconstruct the quantum state from measurement data. + r"""An experiment to reconstruct the quantum state from measurement data. # section: overview Quantum state tomography (QST) is a method for experimentally @@ -47,6 +47,41 @@ class StateTomography(TomographyExperiment): # section: manual :doc:`/manuals/verification/state_tomography` + # 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 import QuantumCircuit + from qiskit_experiments.library import TomographyExperiment + from qiskit_experiments.library.tomography.basis import PauliMeasurementBasis + from qiskit.visualization import plot_state_city + + nq = 2 + qc_ghz = QuantumCircuit(nq) + qc_ghz.h(0) + qc_ghz.s(0) + + for i in range(1, nq): + qc_ghz.cx(0, i) + + qstexp = TomographyExperiment( + circuit=qc_ghz, + backend=backend, + physical_qubits=(0,1), + measurement_basis=PauliMeasurementBasis(), + ) + + qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + state_result = qstdata.analysis_results("state") + plot_state_city(state_result.value, title="Density Matrix") """ def __init__( From f0bfe3613a27505d2b528ab2fa4eba4bf1c4def8 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:56:58 +0900 Subject: [PATCH 012/171] Update qst_experiment.py upsate StateTomography --- .../library/tomography/qst_experiment.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index 226f67cfa5..e5fdaae4f4 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -51,7 +51,7 @@ class StateTomography(TomographyExperiment): .. jupyter-execute:: :hide-code: - # backend + # backend from qiskit_aer import AerSimulator from qiskit_ibm_runtime.fake_provider import FakePerth @@ -60,8 +60,7 @@ class StateTomography(TomographyExperiment): .. jupyter-execute:: from qiskit import QuantumCircuit - from qiskit_experiments.library import TomographyExperiment - from qiskit_experiments.library.tomography.basis import PauliMeasurementBasis + from qiskit_experiments.library import StateTomography from qiskit.visualization import plot_state_city nq = 2 @@ -72,17 +71,11 @@ class StateTomography(TomographyExperiment): for i in range(1, nq): qc_ghz.cx(0, i) - qstexp = TomographyExperiment( - circuit=qc_ghz, - backend=backend, - physical_qubits=(0,1), - measurement_basis=PauliMeasurementBasis(), - ) - + qstexp = StateTomography(qc_ghz) qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") - """ + """ def __init__( self, From 6c432531ec94bd74c3caeb66f3486edd6a6860b3 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:03:15 +0900 Subject: [PATCH 013/171] Update tomography_experiment.py update TomographyExperiment --- .../tomography/tomography_experiment.py | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/tomography_experiment.py b/qiskit_experiments/library/tomography/tomography_experiment.py index bced816a49..f28aab561d 100644 --- a/qiskit_experiments/library/tomography/tomography_experiment.py +++ b/qiskit_experiments/library/tomography/tomography_experiment.py @@ -27,10 +27,46 @@ class TomographyExperiment(BaseExperiment): - """Base experiment for quantum state and process tomography. + r"""Base experiment for quantum state and process tomography. # section: analysis_ref :class:`TomographyAnalysis` + + # 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 import QuantumCircuit + from qiskit_experiments.library import TomographyExperiment + from qiskit_experiments.library.tomography.basis import PauliMeasurementBasis + from qiskit.visualization import plot_state_city + + nq = 2 + qc_ghz = QuantumCircuit(nq) + qc_ghz.h(0) + qc_ghz.s(0) + + for i in range(1, nq): + qc_ghz.cx(0, i) + + qstexp = TomographyExperiment( + circuit=qc_ghz, + backend=backend, + physical_qubits=(0,1), + measurement_basis=PauliMeasurementBasis(), + ) + + qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + state_result = qstdata.analysis_results("state") + plot_state_city(state_result.value, title="Density Matrix") """ @classmethod From 0e8e6adb8c266568c9be859637d4854bffa3ba5c Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:14:57 +0900 Subject: [PATCH 014/171] Update mit_qst_experiment.py update MitigatedStateTomography --- .../library/tomography/mit_qst_experiment.py | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index 98bec48fe2..cf7c7308ff 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -25,7 +25,7 @@ class MitigatedStateTomography(BatchExperiment): - """A batched experiment to characterize readout error then perform state tomography + r"""A batched experiment to characterize readout error then perform state tomography for doing readout error mitigated state tomography. # section: overview @@ -50,6 +50,41 @@ class MitigatedStateTomography(BatchExperiment): * :py:class:`qiskit_experiments.library.tomography.StateTomography` * :py:class:`qiskit_experiments.library.characterization.LocalReadoutError` + # section: example + .. jupyter-execute:: + :hide-code: + + # backend + from qiskit_aer import AerSimulator + from qiskit_ibm_runtime.fake_provider import FakePerth + from qiskit_aer.noise import NoiseModel + + noise_model = NoiseModel.from_backend(FakePerth(), + thermal_relaxation=False, + gate_error=False, + readout_error=True, + ) + + backend = AerSimulator.from_backend(FakePerth(), noise_model=noise_model) + + .. jupyter-execute:: + + from qiskit import QuantumCircuit + from qiskit_experiments.library import MitigatedStateTomography + from qiskit.visualization import plot_state_city + + nq = 2 + qc_ghz = QuantumCircuit(nq) + qc_ghz.h(0) + qc_ghz.s(0) + + for i in range(1, nq): + qc_ghz.cx(0, i) + + mitqstexp = MitigatedStateTomography(qc_ghz) + mitqstdata = mitqstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + state_result = mitqstdata.analysis_results("state") + plot_state_city(state_result.value, title="mitigated Density Matrix") """ def __init__( From 5eeea9b329b107d4ea80bbd694b071cb53ef3778 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:22:03 +0900 Subject: [PATCH 015/171] Update qpt_experiment.py update ProcessTomography --- .../library/tomography/qpt_experiment.py | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index 17d7d7347b..f0b07bc078 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -27,7 +27,7 @@ class ProcessTomography(TomographyExperiment): - """An experiment to reconstruct the quantum channel from measurement data. + r"""An experiment to reconstruct the quantum channel from measurement data. # section: overview Quantum process tomography (QPT) is a method for experimentally @@ -46,6 +46,49 @@ class ProcessTomography(TomographyExperiment): # section: analysis_ref :class:`ProcessTomographyAnalysis` + # 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:: + + import numpy as np + from qiskit import QuantumCircuit + from qiskit_experiments.library import ProcessTomography + + num_qubits = 2 + qc_ghz = QuantumCircuit(num_qubits) + qc_ghz.h(0) + qc_ghz.s(0) + + for i in range(1, num_qubits): + qc_ghz.cx(0, i) + + qptexp = ProcessTomography(qc_ghz) + qptdata = qptexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + choi_out = qptdata.analysis_results("state").value + + # extracting a densitymatrix from choi_out + from qiskit.visualization import plot_state_city + import qiskit.quantum_info as qinfo + + _rho_exp_00 = np.array([[None, None, None, None], + [None, None, None, None], + [None, None, None, None], + [None, None, None, None]]) + + for i in range(4): + for j in range(4): + _rho_exp_00[i][j] = choi_out.data[i][j] + + rho_exp_00 = qinfo.DensityMatrix(_rho_exp_00) + display(plot_state_city(rho_exp_00, title="Density Matrix")) """ def __init__( From 0be4c0ddf48c89f19ae1185e9ae9da4b3cff44de Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:32:01 +0900 Subject: [PATCH 016/171] Update mit_qpt_experiment.py update MitigatedProcessTomography --- .../library/tomography/mit_qpt_experiment.py | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index bdebf34bd0..0d31d79c06 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -25,7 +25,7 @@ class MitigatedProcessTomography(BatchExperiment): - """A batched experiment to characterize readout error then perform process tomography + r"""A batched experiment to characterize readout error then perform process tomography for doing readout error mitigated process tomography. # section: overview @@ -50,6 +50,49 @@ class MitigatedProcessTomography(BatchExperiment): * :py:class:`qiskit_experiments.library.tomography.ProcessTomography` * :py:class:`qiskit_experiments.library.characterization.LocalReadoutError` + # 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:: + + import numpy as np + from qiskit import QuantumCircuit + from qiskit_experiments.library import MitigatedProcessTomography + + num_qubits = 2 + qc_ghz = QuantumCircuit(num_qubits) + qc_ghz.h(0) + qc_ghz.s(0) + + for i in range(1, num_qubits): + qc_ghz.cx(0, i) + + mitqptexp = MitigatedProcessTomography(qc_ghz) + mitqptdata = mitqptexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + mitigated_choi_out = mitqptdata.analysis_results("state").value + + # extracting a densitymatrix from mitigated_choi_out + from qiskit.visualization import plot_state_city + import qiskit.quantum_info as qinfo + + _rho_exp_00 = np.array([[None, None, None, None], + [None, None, None, None], + [None, None, None, None], + [None, None, None, None]]) + + for i in range(4): + for j in range(4): + _rho_exp_00[i][j] = mitigated_choi_out.data[i][j] + + mitigated_rho_exp_00 = qinfo.DensityMatrix(_rho_exp_00) + display(plot_state_city(mitigated_rho_exp_00, title="mitigated Density Matrix")) """ def __init__( From fea22e902006c5fbd88286944ee7390802f1a33b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 04:53:52 +0900 Subject: [PATCH 017/171] Update mit_qpt_experiment.py update MitigatedProcessTomography --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 0d31d79c06..4c8825a930 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -60,7 +60,7 @@ class MitigatedProcessTomography(BatchExperiment): backend = AerSimulator.from_backend(FakePerth()) - ..jupyter-execute:: + .. jupyter-execute:: import numpy as np from qiskit import QuantumCircuit From a252cc83e42a412f08d15b08df7980fcae8d10c6 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 05:52:36 +0900 Subject: [PATCH 018/171] Update qv_experiment.py update QuantumVolume --- .../library/quantum_volume/qv_experiment.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/quantum_volume/qv_experiment.py b/qiskit_experiments/library/quantum_volume/qv_experiment.py index 5d64b37377..694ad2fe03 100644 --- a/qiskit_experiments/library/quantum_volume/qv_experiment.py +++ b/qiskit_experiments/library/quantum_volume/qv_experiment.py @@ -28,7 +28,7 @@ class QuantumVolume(BaseExperiment): - """An experiment to measure the largest random square circuit that can be run on a processor. + r"""An experiment to measure the largest random square circuit that can be run on a processor. # section: overview Quantum Volume (QV) is a single-number metric that can be measured using a concrete protocol @@ -66,6 +66,31 @@ class QuantumVolume(BaseExperiment): .. ref_arxiv:: 1 1811.12926 .. ref_arxiv:: 2 2008.08571 + # section: example + .. jupyter-execute:: + :hide-code: + + # backend + from qiskit_aer import AerSimulator + from qiskit_ibm_runtime.fake_provider import FakeSydneyV2 + backend = AerSimulator.from_backend(FakeSydneyV2()) + + .. jupyter-execute:: + + from qiskit_experiments.framework import BatchExperiment + from qiskit_experiments.library import QuantumVolume + + qubits = tuple(range(4)) # Can use specific qubits. for example [2, 4, 7, 10] + qv_exp = QuantumVolume(qubits, seed=42) + qv_exp.set_transpile_options(optimization_level=3) + qv_exp.set_run_options(shots=1000) + + expdata = qv_exp.run(backend).block_for_results() + + display(expdata.figure(0)) + + for result in expdata.analysis_results(): + print(result) """ def __init__( From 2fc0ee3ee764315d546030d53b4a2345458010ec Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:17:27 +0900 Subject: [PATCH 019/171] Update standard_rb.py update StandardRB --- .../randomized_benchmarking/standard_rb.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 43c77bb8c1..1ab7b71350 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -84,6 +84,51 @@ class StandardRB(BaseExperiment, RestlessMixin): # section: reference .. ref_arxiv:: 1 1009.3639 .. ref_arxiv:: 2 1109.6887 + + # 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()) + print(backend.coupling_map) + + .. jupyter-execute:: + + import numpy as np + from qiskit_experiments.library import StandardRB, InterleavedRB + from qiskit_experiments.framework import ParallelExperiment, BatchExperiment + import qiskit.circuit.library as circuits + + lengths_2_qubit = np.arange(1, 200, 30) + lengths_1_qubit = np.arange(1, 800, 200) + num_samples = 10 + seed = 1010 + qubits = (1, 2) + + # Run a 1-qubit RB experiment on qubits 1, 2 to determine the error-per-gate of 1-qubit gates + single_exps = BatchExperiment( + [ + StandardRB((qubit,), lengths_1_qubit, num_samples=num_samples, seed=seed) + for qubit in qubits + ] + ) + expdata_1q = single_exps.run(backend).block_for_results() + + exp_2q = StandardRB(qubits, lengths_2_qubit, num_samples=num_samples, seed=seed) + + # Use the EPG data of the 1-qubit runs to ensure correct 2-qubit EPG computation + exp_2q.analysis.set_options(epg_1_qubit=expdata_1q.analysis_results()) + + expdata_2q = exp_2q.run(backend).block_for_results() + + print("Gate error ratio: %s" % expdata_2q.experiment.analysis.options.gate_error_ratio) + display(expdata_2q.figure(0)) + for result in expdata_2q.analysis_results(): + print(result) """ def __init__( From b4a81fe6c64d9731e9ecbece522fe19932d71ba4 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:18:12 +0900 Subject: [PATCH 020/171] Update standard_rb.py update StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 1ab7b71350..6a6855bafe 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -54,7 +54,7 @@ class StandardRB(BaseExperiment, RestlessMixin): - """An experiment to characterize the error rate of a gate set on a device. + r"""An experiment to characterize the error rate of a gate set on a device. # section: overview From 8d41d011dd1731ffacbeb1428c6a0ec714157025 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:24:25 +0900 Subject: [PATCH 021/171] Update interleaved_rb_experiment.py update InterleavedRB --- .../interleaved_rb_experiment.py | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index 114f23b8a5..9d77725a4f 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -32,7 +32,7 @@ class InterleavedRB(StandardRB): - """An experiment to characterize the error rate of a specific gate on a device. + r"""An experiment to characterize the error rate of a specific gate on a device. # section: overview Interleaved Randomized Benchmarking (RB) is a method @@ -53,6 +53,37 @@ class InterleavedRB(StandardRB): # section: reference .. ref_arxiv:: 1 1203.4550 + # 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:: + + import numpy as np + from qiskit_experiments.library import StandardRB, InterleavedRB + from qiskit_experiments.framework import ParallelExperiment, BatchExperiment + import qiskit.circuit.library as circuits + + lengths = np.arange(1, 200, 30) + num_samples = 10 + seed = 1010 + qubits = (1, 2) + + int_exp2 = InterleavedRB( + circuits.CXGate(), qubits, lengths, num_samples=num_samples, seed=seed) + + int_expdata2 = int_exp2.run(backend).block_for_results() + int_results2 = int_expdata2.analysis_results() + + display(int_expdata2.figure(0)) + for result in int_results2: + print(result) """ def __init__( From 8faa9e8559d3923ef4f02d32ecf1d3805d671fb3 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:34:33 +0900 Subject: [PATCH 022/171] Update layer_fidelity.py update LayerFidelity --- .../randomized_benchmarking/layer_fidelity.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index 40c5247f87..5c36822304 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -76,6 +76,52 @@ class LayerFidelity(BaseExperiment, RestlessMixin): # section: reference .. ref_arxiv:: 1 2311.05933 + + # 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()) + + print(backend.coupling_map) + + .. jupyter-execute:: + + import numpy as np + from qiskit_experiments.library import StandardRB + from qiskit_experiments.library.randomized_benchmarking import LayerFidelity + + lengths = np.arange(1, 800, 200) + two_qubit_layers=[[(0, 1), (3, 5)], [(1, 3), (5, 6)]] + + for qpair in two_qubit_layers: + for qpair_ in backend.coupling_map: + if qpair_ == qpair: + pass + + num_samples = 6 + seed = 1010 + + exp = LayerFidelity( + physical_qubits=[0, 1, 3, 5, 6], + two_qubit_layers=two_qubit_layers, + lengths=lengths, + backend=backend, + num_samples=num_samples, + seed=seed, + two_qubit_gate=None, + one_qubit_basis_gates=None, + ) + + exp.set_run_options(shots=5000) + expdata = exp.run().block_for_results() + results = expdata.analysis_results() + + for i in range(4): + display(expdata.figure(i)) """ def __init__( From ccfd09b438ceadbe5a170e6df8ffb334fe8b9c8f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:37:51 +0900 Subject: [PATCH 023/171] Update rabi.py update EFRabi --- .../library/characterization/rabi.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/qiskit_experiments/library/characterization/rabi.py b/qiskit_experiments/library/characterization/rabi.py index 7306ce23f5..cdf26e8c40 100644 --- a/qiskit_experiments/library/characterization/rabi.py +++ b/qiskit_experiments/library/characterization/rabi.py @@ -256,8 +256,8 @@ class EFRabi(Rabi): ) # backend - from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend - backend = SingleTransmonTestBackend(5.2e9, -0.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=198) + from qiskit_experiments.test import SingleTransmonTestBackend + backend = SingleTransmonTestBackend(5e9, -0.25e9, 1e9, 0.8e9, 1e4, noise=True) .. jupyter-execute:: @@ -267,12 +267,16 @@ class EFRabi(Rabi): from qiskit_experiments.library import EFRabi with pulse.build() as build_sched: - pulse.play(pulse.Gaussian(160, Parameter("amp"), sigma=40), pulse.DriveChannel(0)) + with pulse.align_left(): + pulse.shift_frequency(-0.25e9, pulse.DriveChannel(0)) + pulse.play(pulse.Gaussian(160, Parameter("amp"), 40), pulse.DriveChannel(0)) exp = EFRabi(physical_qubits=(0,), - backend=backend, schedule=build_sched, - amplitudes=np.linspace(-0.1, 0.1, 21),) + amplitudes=np.linspace(-0.1, 0.1, 21), + backend=backend,) + + display(exp.circuits()[1].draw()) exp_data = exp.run().block_for_results() display(exp_data.figure(0)) From a2648597843a365eb2665aceac6244ee5feb7686 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:42:55 +0900 Subject: [PATCH 024/171] Update ef_spectroscopy.py update EFSpectroscopy --- .../library/characterization/ef_spectroscopy.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qiskit_experiments/library/characterization/ef_spectroscopy.py b/qiskit_experiments/library/characterization/ef_spectroscopy.py index 0b28c6636f..51107e47cb 100644 --- a/qiskit_experiments/library/characterization/ef_spectroscopy.py +++ b/qiskit_experiments/library/characterization/ef_spectroscopy.py @@ -22,7 +22,7 @@ class EFSpectroscopy(QubitSpectroscopy): - """A spectroscopy experiment to obtain a frequency sweep of the qubit's e-f transition. + r"""A spectroscopy experiment to obtain a frequency sweep of the qubit's e-f transition. # section: overview The circuits produced by spectroscopy, i.e. @@ -49,12 +49,15 @@ class EFSpectroscopy(QubitSpectroscopy): 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, - ) + freq12_estimate = freq01_estimate + (-.25e9) + frequencies = np.linspace(freq12_estimate-15e6, freq12_estimate+15e6, 51) + + exp = EFSpectroscopy( + physical_qubits = (0,), + frequencies = frequencies, + backend = backend, + absolute = True, + ) exp.set_experiment_options(amp=0.005) exp_data = exp.run().block_for_results() From b6bd9b5428dafaa4bc5a0743d6dbb19134492cc1 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:34:08 +0900 Subject: [PATCH 025/171] update fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index c99f8d4768..88a5f909ce 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -220,8 +220,8 @@ class FineXAmplitudeCal(FineAmplitudeCal): exp_data = exp_cal.run().block_for_results() display(exp_data.figure(0)) exp_data.analysis_results(dataframe=True) - """ - + """ + def __init__( self, physical_qubits: Sequence[int], @@ -269,7 +269,7 @@ def _pre_circuit(self, num_clbits: int) -> QuantumCircuit: class FineSXAmplitudeCal(FineAmplitudeCal): r"""A calibration experiment to calibrate the amplitude of the SX schedule. - + # section: example .. jupyter-execute:: :hide-code: From a58e115e777bf42d853fc8837b37cb31c65e05e1 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:35:17 +0900 Subject: [PATCH 026/171] update rough_frequency.py --- qiskit_experiments/library/calibration/rough_frequency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index 2d5bbff39e..8f82b84bfc 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -111,7 +111,7 @@ class RoughEFFrequencyCal(BaseCalibrationExperiment, EFSpectroscopy): - + """ __updater__ = Frequency From b45902f3571780967567f8891672c49dd9d9de95 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:37:13 +0900 Subject: [PATCH 027/171] update randomized_benchmarking/layer_fidelity.py --- .../library/randomized_benchmarking/layer_fidelity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index 5c36822304..e2da4b56e9 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -81,7 +81,7 @@ class LayerFidelity(BaseExperiment, RestlessMixin): .. jupyter-execute:: :hide-code: - # backend + # backend from qiskit_aer import AerSimulator from qiskit_ibm_runtime.fake_provider import FakePerth backend = AerSimulator.from_backend(FakePerth()) From 9e828b332d96df423a7aaef70cf64fce566f5970 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:38:08 +0900 Subject: [PATCH 028/171] update tomography/qpt_experiment.py --- qiskit_experiments/library/tomography/qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index f0b07bc078..237d10d1a6 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -87,7 +87,7 @@ class ProcessTomography(TomographyExperiment): for j in range(4): _rho_exp_00[i][j] = choi_out.data[i][j] - rho_exp_00 = qinfo.DensityMatrix(_rho_exp_00) + rho_exp_00 = qinfo.DensityMatrix(_rho_exp_00) display(plot_state_city(rho_exp_00, title="Density Matrix")) """ From c919d7cf9506e5581287aa653ed399fd17747307 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:39:14 +0900 Subject: [PATCH 029/171] update tomography/qst_experiment.py --- qiskit_experiments/library/tomography/qst_experiment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index e5fdaae4f4..c294519082 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -51,7 +51,7 @@ class StateTomography(TomographyExperiment): .. jupyter-execute:: :hide-code: - # backend + # backend from qiskit_aer import AerSimulator from qiskit_ibm_runtime.fake_provider import FakePerth @@ -75,7 +75,7 @@ class StateTomography(TomographyExperiment): qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") - """ + """ def __init__( self, From ee2e8bb6a467d62e47e545d6bef3f6778969908e Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:24:04 +0900 Subject: [PATCH 030/171] update calibration/fine_drag_cal.py --- qiskit_experiments/library/calibration/fine_drag_cal.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index 5735eaf4f6..db84e722cc 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -44,7 +44,8 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library import FineDragCal library = FixedFrequencyTransmon(default_values={"duration": 320}) @@ -192,7 +193,8 @@ class FineXDragCal(FineDragCal): import numpy as np import pandas as pd from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + 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}) @@ -260,7 +262,8 @@ class FineSXDragCal(FineDragCal): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library import FineSXDragCal library = FixedFrequencyTransmon(default_values={"duration": 320}) From 1cb91cc0b770f7775a39be6e04184f00a0c7893f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:25:02 +0900 Subject: [PATCH 031/171] update tomography/mit_qpt_experiment.py --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 4c8825a930..124dbabaa5 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -75,7 +75,8 @@ class MitigatedProcessTomography(BatchExperiment): qc_ghz.cx(0, i) mitqptexp = MitigatedProcessTomography(qc_ghz) - mitqptdata = mitqptexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + mitqptexp.set_run_options(shots=1000) + mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value # extracting a densitymatrix from mitigated_choi_out From 063e870d325f5db2e1a839ce61cb572921d7422d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:25:44 +0900 Subject: [PATCH 032/171] update tomography/mit_qst_experiment.py --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index cf7c7308ff..c4dae7c49e 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -82,7 +82,8 @@ class MitigatedStateTomography(BatchExperiment): qc_ghz.cx(0, i) mitqstexp = MitigatedStateTomography(qc_ghz) - mitqstdata = mitqstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + mitqstexp.set_run_options(shots=1000) + mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100).block_for_results() state_result = mitqstdata.analysis_results("state") plot_state_city(state_result.value, title="mitigated Density Matrix") """ From cc8de312712889591b9820a53bbe7c6e7b0095f4 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:36:13 +0900 Subject: [PATCH 033/171] update tomography/mit_qst_experiment.py --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index c4dae7c49e..84ea5200e8 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -82,7 +82,7 @@ class MitigatedStateTomography(BatchExperiment): qc_ghz.cx(0, i) mitqstexp = MitigatedStateTomography(qc_ghz) - mitqstexp.set_run_options(shots=1000) + mitqstexp.set_run_options(shots=1000) mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100).block_for_results() state_result = mitqstdata.analysis_results("state") plot_state_city(state_result.value, title="mitigated Density Matrix") From f0ee881cfa5484e4055633f6c3ad81ffba8f3b28 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:36:39 +0900 Subject: [PATCH 034/171] update tomography/mit_qpt_experiment.py --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 124dbabaa5..f0342d3f5b 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -75,7 +75,7 @@ class MitigatedProcessTomography(BatchExperiment): qc_ghz.cx(0, i) mitqptexp = MitigatedProcessTomography(qc_ghz) - mitqptexp.set_run_options(shots=1000) + mitqptexp.set_run_options(shots=1000) mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value From 050fd50d4c68ba0db59d82a4f1315a9e44b3ff1d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:37:49 +0900 Subject: [PATCH 035/171] update calibration/fine_drag_cal.py --- qiskit_experiments/library/calibration/fine_drag_cal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index db84e722cc..bf9fc04646 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -45,7 +45,7 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import FineDragCal library = FixedFrequencyTransmon(default_values={"duration": 320}) @@ -194,7 +194,7 @@ class FineXDragCal(FineDragCal): import pandas as pd from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import FineXDragCal library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.4}) @@ -263,7 +263,7 @@ class FineSXDragCal(FineDragCal): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import FineSXDragCal library = FixedFrequencyTransmon(default_values={"duration": 320}) From 2a12c678034eea25bc883eec4a608467ceeb75ae Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:19:10 +0900 Subject: [PATCH 036/171] update calibration/fine_frequency_cal.py --- .../library/calibration/fine_amplitude.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 88a5f909ce..411165dd26 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -49,7 +49,8 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): 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.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal library = FixedFrequencyTransmon() @@ -63,7 +64,8 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): 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}) + exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, + "phase_offset" : np.pi/2}) print(exp_cal.circuits()[5]) @@ -203,7 +205,8 @@ class FineXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library import FineXAmplitudeCal library = FixedFrequencyTransmon(default_values={"duration": 320}) @@ -285,7 +288,8 @@ class FineSXAmplitudeCal(FineAmplitudeCal): from qiskit import schedule from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library import FineSXAmplitudeCal library = FixedFrequencyTransmon(default_values={"duration": 320}) From 2b0e196d931106338bb6bbf5575d4d4e72c8d8c6 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:20:22 +0900 Subject: [PATCH 037/171] update calibration/fine_frequency_cal.py --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 7cc161d5f6..801da7ff8a 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -43,7 +43,8 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + 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()]) From 288c021b23632276d47eee279699170add5cd8fe Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:21:14 +0900 Subject: [PATCH 038/171] update calibration/frequency_cal.py --- qiskit_experiments/library/calibration/frequency_cal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index e96d23812b..24aead4c59 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -42,7 +42,8 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + 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()]) From c6686fc503425c025d8c3ad3d9f8ee5c55eeaf67 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:22:27 +0900 Subject: [PATCH 039/171] update calibration/rough_amplitude_cal.py --- .../library/calibration/rough_amplitude_cal.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 24f67522f0..792c393c99 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -45,7 +45,8 @@ class RoughAmplitudeCal(BaseCalibrationExperiment, Rabi): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import RoughAmplitudeCal library = FixedFrequencyTransmon() @@ -236,12 +237,17 @@ class RoughXSXAmplitudeCal(RoughAmplitudeCal): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import RoughXSXAmplitudeCal library = FixedFrequencyTransmon() cals = Calibrations.from_backend(backend, libraries=[library]) - exp_cal = RoughXSXAmplitudeCal((0,), cals, backend=backend, amplitudes=np.linspace(-0.1, 0.1, 51)) + exp_cal = RoughXSXAmplitudeCal((0,), + cals, + backend=backend, + amplitudes=np.linspace(-0.1, 0.1, 51) + ) cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) @@ -294,7 +300,8 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): from qiskit.compiler import schedule from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import EFRoughXSXAmplitudeCal library = FixedFrequencyTransmon() From b11fd678bb7d954ec13486abdd844ce472c9cad1 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:23:12 +0900 Subject: [PATCH 040/171] update calibration/rough_drag_cal.py --- qiskit_experiments/library/calibration/rough_drag_cal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index afe8a2599e..ce0363fbc4 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -47,7 +47,8 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): from qiskit import schedule from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library import RoughDragCal library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.03}) From 8f4647791fe96f683a09b4d0fd94e71fe938535f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:24:29 +0900 Subject: [PATCH 041/171] update calibration/rough_frequency.py --- qiskit_experiments/library/calibration/rough_frequency.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index 8f82b84bfc..535d289ef8 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -42,7 +42,8 @@ class RoughFrequencyCal(BaseCalibrationExperiment, QubitSpectroscopy): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library.calibration.rough_frequency import RoughFrequencyCal qubit=0 From 7c9b2df6555416d74fcced5dde442c4f47286e7d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:33:07 +0900 Subject: [PATCH 042/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 411165dd26..c38846ab48 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -50,7 +50,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): from qiskit.circuit.library import XGate from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal library = FixedFrequencyTransmon() @@ -65,7 +65,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): measurement_qubits=(0,)) # This option is necessary! exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, - "phase_offset" : np.pi/2}) + "phase_offset" : np.pi/2}) print(exp_cal.circuits()[5]) @@ -206,7 +206,7 @@ class FineXAmplitudeCal(FineAmplitudeCal): from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import FineXAmplitudeCal library = FixedFrequencyTransmon(default_values={"duration": 320}) @@ -289,7 +289,7 @@ class FineSXAmplitudeCal(FineAmplitudeCal): from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import FineSXAmplitudeCal library = FixedFrequencyTransmon(default_values={"duration": 320}) From b615d5e450826846cf3db0c2a0760065999e3458 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:34:04 +0900 Subject: [PATCH 043/171] update calibration/fine_frequency_cal.py --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 801da7ff8a..1d7fa79189 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -44,7 +44,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration.fine_frequency_cal import FineFrequencyCal cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()]) From 4a11bab79aa35215fa259e3dc5111dbddbe3c64b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:34:54 +0900 Subject: [PATCH 044/171] update calibration/frequency_cal.py --- qiskit_experiments/library/calibration/frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index 24aead4c59..30e11cede2 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -43,7 +43,7 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration.frequency_cal import FrequencyCal cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()]) From d6aca986fb3245eb5b4d2c25814b2136860a2b62 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:35:54 +0900 Subject: [PATCH 045/171] update calibration/rough_amplitude_cal.py --- .../library/calibration/rough_amplitude_cal.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 792c393c99..4cba5c7537 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -46,7 +46,7 @@ class RoughAmplitudeCal(BaseCalibrationExperiment, Rabi): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import RoughAmplitudeCal library = FixedFrequencyTransmon() @@ -238,16 +238,16 @@ class RoughXSXAmplitudeCal(RoughAmplitudeCal): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import RoughXSXAmplitudeCal library = FixedFrequencyTransmon() cals = Calibrations.from_backend(backend, libraries=[library]) exp_cal = RoughXSXAmplitudeCal((0,), - cals, - backend=backend, - amplitudes=np.linspace(-0.1, 0.1, 51) - ) + cals, + backend=backend, + amplitudes=np.linspace(-0.1, 0.1, 51) + ) cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) @@ -301,7 +301,7 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import EFRoughXSXAmplitudeCal library = FixedFrequencyTransmon() From 731c04c1c93c3c0465743f39467bb1cea9b4dd19 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:36:38 +0900 Subject: [PATCH 046/171] update calibration/rough_drag_cal.py --- qiskit_experiments/library/calibration/rough_drag_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index ce0363fbc4..cb7ec7bb1d 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -48,7 +48,7 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library import RoughDragCal library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.03}) From 3740deedc05913d957936dde3d3022aa59490df2 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:37:15 +0900 Subject: [PATCH 047/171] update calibration/rough_frequency.py --- qiskit_experiments/library/calibration/rough_frequency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index 535d289ef8..a3d88c0b5d 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -43,7 +43,7 @@ class RoughFrequencyCal(BaseCalibrationExperiment, QubitSpectroscopy): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration.rough_frequency import RoughFrequencyCal qubit=0 From c8d60a3b5af5ab832ab7b23d83d0bc8c2f842906 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:53:24 +0900 Subject: [PATCH 048/171] update calibration/half_angle_cal.py --- qiskit_experiments/library/calibration/half_angle_cal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index 696e0057f5..ff6dbd0652 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -42,7 +42,8 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): 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.calibration_management.basis_gate_library + import FixedFrequencyTransmon from qiskit_experiments.library.calibration.half_angle_cal import HalfAngleCal library = FixedFrequencyTransmon(default_values={"duration": 640}) From 98a67a9ab4ccb0874888da30f812a52019241959 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:01:48 +0900 Subject: [PATCH 049/171] update calibration/half_angle_cal.py --- qiskit_experiments/library/calibration/half_angle_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index ff6dbd0652..610043dab6 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -43,7 +43,7 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): from qiskit import pulse from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + import FixedFrequencyTransmon from qiskit_experiments.library.calibration.half_angle_cal import HalfAngleCal library = FixedFrequencyTransmon(default_values={"duration": 640}) From f70ceb1b6d2d5dd6a1dc90153c6e2b60469f3331 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:19:39 +0900 Subject: [PATCH 050/171] update driven_freq_tuning/ramsey_amp_scan.py --- .../driven_freq_tuning/ramsey_amp_scan.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py index e82d5d7910..cf3daf3eb4 100644 --- a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py +++ b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py @@ -93,6 +93,42 @@ class StarkRamseyXYAmpScan(BaseExperiment): # section: manual :doc:`/manuals/characterization/stark_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=198) + + .. jupyter-execute:: + + import numpy as np + from qiskit import pulse + from qiskit.pulse.channels import PulseChannel, DriveChannel + from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy + from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan + + qubit = 0 + + exp = StarkRamseyXYAmpScan((qubit,), backend=backend) + exp.set_experiment_options( + stark_channel=pulse.ControlChannel(qubit), + stark_freq_offset=80e6, + stark_sigma=15e-9, + stark_risefall=2, + stark_length=50e-9, + min_stark_amp=-1.0, + max_stark_amp=1.0, + num_stark_amps=51, + stark_amps=None, + ) + + exp.set_run_options(shots=10000) + exp_data = exp.run().block_for_results() + result = exp_data.analysis_results() + print(result) + display(exp_data.figure(0)) """ @deprecate_func( From b541b8b6d6979c2e2e557ffb888cbf091c462cfe Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:46:39 +0900 Subject: [PATCH 051/171] update driven_freq_tuning/p1_spect.py --- .../library/driven_freq_tuning/p1_spect.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py index 7c81611419..d44c40d6f7 100644 --- a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py +++ b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py @@ -72,6 +72,80 @@ class StarkP1Spectroscopy(BaseExperiment): # section: manual :doc:`/manuals/characterization/stark_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=198) + + .. jupyter-execute:: + + import numpy as np + from qiskit import pulse + from qiskit.pulse.channels import PulseChannel, DriveChannel + from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy + from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan + + qubit = 0 + + exp = StarkRamseyXYAmpScan((qubit,), backend=backend) + exp.set_experiment_options( + stark_channel=pulse.ControlChannel(qubit), + stark_freq_offset=80e6, + stark_sigma=15e-9, + stark_risefall=2, + stark_length=50e-9, + min_stark_amp=-1.0, + max_stark_amp=1.0, + num_stark_amps=51, + stark_amps=None, + ) + + exp.set_run_options(shots=10000) + exp_data = exp.run().block_for_results() + result = exp_data.analysis_results() + print(result) + display(exp_data.figure(0)) + + ret_coeffs = exp_data.analysis_results("stark_coefficients").value + + # encode and decode the stark_coefficients + import json + from qiskit_experiments.framework import ExperimentEncoder + + with open("coefficients.json", "w") as fp: + json.dump(ret_coeffs, fp, cls=ExperimentEncoder) + + from qiskit_experiments.framework import ExperimentDecoder + + with open("coefficients.json", "r") as fp: + coefficients = json.load(fp, cls=ExperimentDecoder) + + # StarkP1Spectroscopy + exp = StarkP1Spectroscopy(physical_qubits=(qubit,), + backend=backend, + stark_channel=pulse.DriveChannel(qubit), + ) + exp.set_experiment_options( + t1_delay=20e-6, + min_xval=-20e6, + max_xval=20e6, + xval_type="frequency", + spacing="linear", + stark_coefficients=coefficients, + ) + + exp.set_run_options(shots=100) + display(exp.circuits()[0].draw("mpl")) + + exp_data = exp.run().block_for_results() + result=exp_data.analysis_results() + for _ in result: + print(_) + + display(exp_data.figure(0)) """ @deprecate_func( From 03b541b009eada68959e3c6f91b806206d43fcee Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:55:17 +0900 Subject: [PATCH 052/171] update driven_freq_tuning/p1_spect.py --- .../library/driven_freq_tuning/p1_spect.py | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py index d44c40d6f7..a456626b30 100644 --- a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py +++ b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py @@ -73,79 +73,79 @@ class StarkP1Spectroscopy(BaseExperiment): :doc:`/manuals/characterization/stark_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=198) - - .. jupyter-execute:: - - import numpy as np - from qiskit import pulse - from qiskit.pulse.channels import PulseChannel, DriveChannel - from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy - from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan - - qubit = 0 - - exp = StarkRamseyXYAmpScan((qubit,), backend=backend) - exp.set_experiment_options( - stark_channel=pulse.ControlChannel(qubit), - stark_freq_offset=80e6, - stark_sigma=15e-9, - stark_risefall=2, - stark_length=50e-9, - min_stark_amp=-1.0, - max_stark_amp=1.0, - num_stark_amps=51, - stark_amps=None, - ) - - exp.set_run_options(shots=10000) - exp_data = exp.run().block_for_results() - result = exp_data.analysis_results() - print(result) - display(exp_data.figure(0)) - - ret_coeffs = exp_data.analysis_results("stark_coefficients").value - - # encode and decode the stark_coefficients - import json - from qiskit_experiments.framework import ExperimentEncoder - - with open("coefficients.json", "w") as fp: - json.dump(ret_coeffs, fp, cls=ExperimentEncoder) - - from qiskit_experiments.framework import ExperimentDecoder - - with open("coefficients.json", "r") as fp: - coefficients = json.load(fp, cls=ExperimentDecoder) - - # StarkP1Spectroscopy - exp = StarkP1Spectroscopy(physical_qubits=(qubit,), - backend=backend, - stark_channel=pulse.DriveChannel(qubit), - ) - exp.set_experiment_options( - t1_delay=20e-6, - min_xval=-20e6, - max_xval=20e6, - xval_type="frequency", - spacing="linear", - stark_coefficients=coefficients, - ) - - exp.set_run_options(shots=100) - display(exp.circuits()[0].draw("mpl")) - - exp_data = exp.run().block_for_results() - result=exp_data.analysis_results() - for _ in result: - print(_) - - display(exp_data.figure(0)) + .. 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=198) + + .. jupyter-execute:: + + import numpy as np + from qiskit import pulse + from qiskit.pulse.channels import PulseChannel, DriveChannel + from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy + from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan + + qubit = 0 + + exp = StarkRamseyXYAmpScan((qubit,), backend=backend) + exp.set_experiment_options( + stark_channel=pulse.ControlChannel(qubit), + stark_freq_offset=80e6, + stark_sigma=15e-9, + stark_risefall=2, + stark_length=50e-9, + min_stark_amp=-1.0, + max_stark_amp=1.0, + num_stark_amps=51, + stark_amps=None, + ) + + exp.set_run_options(shots=10000) + exp_data = exp.run().block_for_results() + result = exp_data.analysis_results() + print(result) + display(exp_data.figure(0)) + + ret_coeffs = exp_data.analysis_results("stark_coefficients").value + + # encode and decode the stark_coefficients + import json + from qiskit_experiments.framework import ExperimentEncoder + + with open("coefficients.json", "w") as fp: + json.dump(ret_coeffs, fp, cls=ExperimentEncoder) + + from qiskit_experiments.framework import ExperimentDecoder + + with open("coefficients.json", "r") as fp: + coefficients = json.load(fp, cls=ExperimentDecoder) + + # StarkP1Spectroscopy + exp = StarkP1Spectroscopy(physical_qubits=(qubit,), + backend=backend, + stark_channel=pulse.DriveChannel(qubit), + ) + exp.set_experiment_options( + t1_delay=20e-6, + min_xval=-20e6, + max_xval=20e6, + xval_type="frequency", + spacing="linear", + stark_coefficients=coefficients, + ) + + exp.set_run_options(shots=100) + display(exp.circuits()[0].draw("mpl")) + + exp_data = exp.run().block_for_results() + result=exp_data.analysis_results() + for _ in result: + print(_) + + display(exp_data.figure(0)) """ @deprecate_func( From 36d010de789f540a16407dfc2fa70cff4dbe15ff Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:18:05 +0900 Subject: [PATCH 053/171] update calibration/rough_drag_cal.py --- qiskit_experiments/library/calibration/rough_drag_cal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index cb7ec7bb1d..02b3a52a6a 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -29,9 +29,6 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): """A calibration version of the :class:`.RoughDrag` experiment. - # section: manual - :ref:`DRAG Calibration` - # section: example .. jupyter-execute:: :hide-code: @@ -59,6 +56,9 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) + + # section: manual + :ref:`DRAG Calibration` """ def __init__( From 43ad4170c2b334e270ee270b95b7d4ef3529f1ec Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:15:47 +0900 Subject: [PATCH 054/171] update releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml --- ...es-to-experiments-api-docs-31f3e3c3369a6f3d.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml new file mode 100644 index 0000000000..ee2cfdacbb --- /dev/null +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -0,0 +1,13 @@ +--- +other: + - | + Added minimal working code examples to experiments in API pages except + the following experiments which need two qubits gate operations with + a forth coming pulse test simulator, + CrossResonanceHamiltonian, EchoedCrossResonanceHamiltonian, FineZXAmplitude. + By default, the backend used in the code examples, are simulators such as + SingleTransmonTestBackend(), AerSimulator(FakePerth()). It is noted that, + because of the deprecation policy of the Qiskit Pulse in Qiskit 2.0, some + experiments which need pulse level programs are deprecated for the real + devices in the IBM Quantum platform. See also the Deprecation Notes in + the Release Notes 0.8.0. From c81f6a45e0e11cdf14728a17dbae6e57906d89cf Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:37:41 +0900 Subject: [PATCH 055/171] improved calibrations/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index c38846ab48..9a85a5adff 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -67,8 +67,6 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, "phase_offset" : np.pi/2}) - print(exp_cal.circuits()[5]) - cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) @@ -283,10 +281,6 @@ class FineSXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: - import numpy as np - import qiskit.pulse as pulse - from qiskit import schedule - from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon From 03777b6f05b3828c91ef0202adf01c1b3f95dd46 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:58:53 +0900 Subject: [PATCH 056/171] improved calibration/fine_drag_cal.py --- .../library/calibration/fine_drag_cal.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index bf9fc04646..e5d36afa7a 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -42,7 +42,6 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): .. jupyter-execute:: - import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon @@ -190,8 +189,6 @@ class FineXDragCal(FineDragCal): .. jupyter-execute:: - import numpy as np - import pandas as pd from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon @@ -207,12 +204,6 @@ class FineXDragCal(FineDragCal): auto_update=True, ) - cal_data = exp_cal.run().block_for_results() - display(cal_data.figure(0)) - display(cal_data.analysis_results(dataframe=True)) - - pd.DataFrame(**cals.parameters_table(qubit_list=[0])) - cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) @@ -260,7 +251,6 @@ class FineSXDragCal(FineDragCal): .. jupyter-execute:: - import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon From 2d1b414488bd3bc121276deccb77a69d035a506e Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:27:14 +0900 Subject: [PATCH 057/171] improved EFRoughXSXAmplitudeCal --- .../library/calibration/rough_amplitude_cal.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 4cba5c7537..ab0c841b25 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -295,7 +295,6 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): .. jupyter-execute:: import numpy as np - import pandas as pd import qiskit.pulse as pulse from qiskit.compiler import schedule from qiskit.circuit import Parameter @@ -340,19 +339,12 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): for sched in ["sx", "sx12"]: cals.add_parameter_value(0.25, "amp", (0,), schedule=sched) - columns_to_show = ["parameter", "qubits", "schedule", "value", "date_time"] - pd.DataFrame(**cals.parameters_table(qubit_list=[0, ()]))[columns_to_show] - exp_cal = EFRoughXSXAmplitudeCal(physical_qubits=(0,), calibrations=cals, amplitudes=np.linspace(-0.1, 0.1, 51), backend=backend, ef_pulse_label="12",) - print(exp_cal.calibrations) - print(exp_cal.circuits()[0]) - print(exp_cal.circuits()[0].calibrations) - cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) From 92b7005011a370cc4589376c3b7dc848a2393a29 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:24:37 +0900 Subject: [PATCH 058/171] imploved rough_amplitude_cal.py --- qiskit_experiments/library/calibration/rough_amplitude_cal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index ab0c841b25..1239b59287 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -296,7 +296,6 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): import numpy as np import qiskit.pulse as pulse - from qiskit.compiler import schedule from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library From cd19f34611012d004c83864f6b9103ab06a03c65 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:40:15 +0900 Subject: [PATCH 059/171] improved RoughDragCal --- qiskit_experiments/library/calibration/rough_drag_cal.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index 02b3a52a6a..6d83082e88 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -40,9 +40,6 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): .. jupyter-execute:: import numpy as np - import qiskit.pulse as pulse - from qiskit import schedule - from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon From 1e3180a3240090ce3f37d98f68f2c6186cbdbdbb Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:54:25 +0900 Subject: [PATCH 060/171] improved StarkRamseyXYAmpScan --- .../library/driven_freq_tuning/ramsey_amp_scan.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py index cf3daf3eb4..c2c6ec9164 100644 --- a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py +++ b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py @@ -103,10 +103,7 @@ class StarkRamseyXYAmpScan(BaseExperiment): .. jupyter-execute:: - import numpy as np from qiskit import pulse - from qiskit.pulse.channels import PulseChannel, DriveChannel - from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan qubit = 0 @@ -127,7 +124,6 @@ class StarkRamseyXYAmpScan(BaseExperiment): exp.set_run_options(shots=10000) exp_data = exp.run().block_for_results() result = exp_data.analysis_results() - print(result) display(exp_data.figure(0)) """ From f78a31d2473eef8d8870a38cb2892338e976666a Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:30:33 +0900 Subject: [PATCH 061/171] improved QuantumVolume --- qiskit_experiments/library/quantum_volume/qv_experiment.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qiskit_experiments/library/quantum_volume/qv_experiment.py b/qiskit_experiments/library/quantum_volume/qv_experiment.py index 694ad2fe03..f616d0d924 100644 --- a/qiskit_experiments/library/quantum_volume/qv_experiment.py +++ b/qiskit_experiments/library/quantum_volume/qv_experiment.py @@ -86,7 +86,6 @@ class QuantumVolume(BaseExperiment): qv_exp.set_run_options(shots=1000) expdata = qv_exp.run(backend).block_for_results() - display(expdata.figure(0)) for result in expdata.analysis_results(): From c43c83585e4e9ce4d44845fd489e85166a8d9e54 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 7 Nov 2024 06:06:13 +0900 Subject: [PATCH 062/171] improved RoughEFFrequencyCal --- qiskit_experiments/library/calibration/rough_frequency.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index a3d88c0b5d..dcfd6b2fd2 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -109,10 +109,6 @@ class RoughEFFrequencyCal(BaseCalibrationExperiment, EFSpectroscopy): r"""A calibration experiment that runs :class:`.QubitSpectroscopy` for the :math:`|1\rangle` <-> :math:`|2\rangle` transition. - - - - """ __updater__ = Frequency From fa360addd7e39f755d87d61ba2b1c916b3fcc393 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 7 Nov 2024 06:07:35 +0900 Subject: [PATCH 063/171] improved LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index e2da4b56e9..0cd2e6a1b1 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -86,8 +86,6 @@ class LayerFidelity(BaseExperiment, RestlessMixin): from qiskit_ibm_runtime.fake_provider import FakePerth backend = AerSimulator.from_backend(FakePerth()) - print(backend.coupling_map) - .. jupyter-execute:: import numpy as np From 54e024afbc063b4e4d0f85c8532a155d4cacf25f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 7 Nov 2024 06:08:42 +0900 Subject: [PATCH 064/171] improved StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 6a6855bafe..ed217b0e19 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -94,7 +94,6 @@ class StandardRB(BaseExperiment, RestlessMixin): from qiskit_ibm_runtime.fake_provider import FakePerth backend = AerSimulator.from_backend(FakePerth()) - print(backend.coupling_map) .. jupyter-execute:: From aa141fdbbdfaee1d7211671f61a2ac7d4150d36b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:38:43 +0900 Subject: [PATCH 065/171] updated releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml --- ...experiments-api-docs-31f3e3c3369a6f3d.yaml | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml index ee2cfdacbb..912f262473 100644 --- a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -1,13 +1,32 @@ --- other: - | - Added minimal working code examples to experiments in API pages except - the following experiments which need two qubits gate operations with - a forth coming pulse test simulator, - CrossResonanceHamiltonian, EchoedCrossResonanceHamiltonian, FineZXAmplitude. - By default, the backend used in the code examples, are simulators such as - SingleTransmonTestBackend(), AerSimulator(FakePerth()). It is noted that, - because of the deprecation policy of the Qiskit Pulse in Qiskit 2.0, some - experiments which need pulse level programs are deprecated for the real - devices in the IBM Quantum platform. See also the Deprecation Notes in - the Release Notes 0.8.0. + Added minimal working code examples to the API pages for Experiments, + EFSpectroscopy, + EFRabi, + StarkRamseyXYAmpScan, + FineAmplitudeCal, + FineXAmplitudeCal, + FineSXAmplitudeCal, + FineDragCal, + FineXDragCal, + FineSXDragCal, + FineFrequencyCal, + FrequencyCal, + HalfAngleCal, + RoughAmplitudeCal, + RoughXSXAmplitudeCal, + EFRoughXSXAmplitudeCal, + RoughDragCal, + RoughFrequencyCal, + QuantumVolume, + InterleavedRB, + LayerFidelity, + StandardRB, + MitigatedProcessTomography, + MitigatedStateTomography, + ProcessTomography and + StateTomography. + By default, the backend used in the code examples, are simulators + such as, SingleTransmonTestBackend() and + AerSimulator(FakePerth()). From 6b5f64b208658d4c0b0878d5a32d0fac6db2c6dd Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:55:57 +0900 Subject: [PATCH 066/171] improved StarkP1Spectroscopy --- .../library/driven_freq_tuning/p1_spect.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py index a456626b30..3d49571097 100644 --- a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py +++ b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py @@ -82,14 +82,11 @@ class StarkP1Spectroscopy(BaseExperiment): .. jupyter-execute:: - import numpy as np from qiskit import pulse - from qiskit.pulse.channels import PulseChannel, DriveChannel from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan qubit = 0 - exp = StarkRamseyXYAmpScan((qubit,), backend=backend) exp.set_experiment_options( stark_channel=pulse.ControlChannel(qubit), @@ -105,10 +102,6 @@ class StarkP1Spectroscopy(BaseExperiment): exp.set_run_options(shots=10000) exp_data = exp.run().block_for_results() - result = exp_data.analysis_results() - print(result) - display(exp_data.figure(0)) - ret_coeffs = exp_data.analysis_results("stark_coefficients").value # encode and decode the stark_coefficients @@ -136,15 +129,9 @@ class StarkP1Spectroscopy(BaseExperiment): spacing="linear", stark_coefficients=coefficients, ) - exp.set_run_options(shots=100) - display(exp.circuits()[0].draw("mpl")) exp_data = exp.run().block_for_results() - result=exp_data.analysis_results() - for _ in result: - print(_) - display(exp_data.figure(0)) """ From 95e8d3f2cb096cf973009069f290b79945b71586 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:59:20 +0900 Subject: [PATCH 067/171] releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml --- .../add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml index 912f262473..bccb5a26a2 100644 --- a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -5,6 +5,7 @@ other: EFSpectroscopy, EFRabi, StarkRamseyXYAmpScan, + StarkP1Spectroscopy, FineAmplitudeCal, FineXAmplitudeCal, FineSXAmplitudeCal, From b7ffa899b512feb215e13f4cb1193cbf751f4cc0 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:59:57 +0900 Subject: [PATCH 068/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 9a85a5adff..596336dfae 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -49,7 +49,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): 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 + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal @@ -203,7 +203,7 @@ class FineXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineXAmplitudeCal @@ -282,7 +282,7 @@ class FineSXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineSXAmplitudeCal From 08757882aead742455f3978369f8b5eb951015a5 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:00:55 +0900 Subject: [PATCH 069/171] update calibration/fine_drag_cal.py --- qiskit_experiments/library/calibration/fine_drag_cal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index e5d36afa7a..40910522b0 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -43,7 +43,7 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineDragCal @@ -190,7 +190,7 @@ class FineXDragCal(FineDragCal): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineXDragCal @@ -252,7 +252,7 @@ class FineSXDragCal(FineDragCal): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineSXDragCal From 1c4f1b3c6758a1987efc611cdf17160a017eb566 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:01:52 +0900 Subject: [PATCH 070/171] update calibration/fine_frequency_cal.py --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 1d7fa79189..40d60ffba1 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -43,7 +43,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library.calibration.fine_frequency_cal import FineFrequencyCal From b71d5213ec6268fc74e25d0274f26cdd1583cb77 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:02:44 +0900 Subject: [PATCH 071/171] update calibration/frequency_cal.py --- qiskit_experiments/library/calibration/frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index 30e11cede2..ef4d6e6c87 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -42,7 +42,7 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): .. jupyter-execute:: from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library.calibration.frequency_cal import FrequencyCal From 261c89cc1d9a9467c94b2248cba6adf723451491 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:03:30 +0900 Subject: [PATCH 072/171] update calibration/half_angle_cal.py --- qiskit_experiments/library/calibration/half_angle_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index 610043dab6..26075994c4 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -42,7 +42,7 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): from qiskit import pulse from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library.calibration.half_angle_cal import HalfAngleCal From 1ef6637a7925ad0379749c959bf0140ed2219a6d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:04:19 +0900 Subject: [PATCH 073/171] update calibration/rough_amplitude_cal.py --- .../library/calibration/rough_amplitude_cal.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 1239b59287..43083666f4 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -45,7 +45,7 @@ class RoughAmplitudeCal(BaseCalibrationExperiment, Rabi): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library.calibration import RoughAmplitudeCal @@ -237,7 +237,7 @@ class RoughXSXAmplitudeCal(RoughAmplitudeCal): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library.calibration import RoughXSXAmplitudeCal @@ -298,8 +298,8 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): import qiskit.pulse as pulse from qiskit.circuit import Parameter from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library - import FixedFrequencyTransmon + from qiskit_experiments.calibration_management.basis_gate_library \ + import FixedFrequencyTransmon from qiskit_experiments.library.calibration import EFRoughXSXAmplitudeCal library = FixedFrequencyTransmon() From dd820ae7b5818a4785b428957b5f46121988ccee Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:05:05 +0900 Subject: [PATCH 074/171] update calibration/rough_drag_cal.py --- qiskit_experiments/library/calibration/rough_drag_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index 6d83082e88..623e521ee8 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -41,7 +41,7 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import RoughDragCal From 8b8f9a09239789991a61fbc51f7c83f233658bbc Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:05:57 +0900 Subject: [PATCH 075/171] update calibration/rough_frequency.py --- qiskit_experiments/library/calibration/rough_frequency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index dcfd6b2fd2..efb95f8da1 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -42,7 +42,7 @@ class RoughFrequencyCal(BaseCalibrationExperiment, QubitSpectroscopy): import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations - from qiskit_experiments.calibration_management.basis_gate_library + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library.calibration.rough_frequency import RoughFrequencyCal From e0673aabaa2fec4cfa68dbad744ab60e8f44f580 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:12:23 +0900 Subject: [PATCH 076/171] removed: a code exapmle for StarkP1Spectroscopy --- .../library/driven_freq_tuning/p1_spect.py | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py index 3d49571097..5a2e867e54 100644 --- a/qiskit_experiments/library/driven_freq_tuning/p1_spect.py +++ b/qiskit_experiments/library/driven_freq_tuning/p1_spect.py @@ -71,68 +71,6 @@ class StarkP1Spectroscopy(BaseExperiment): # section: manual :doc:`/manuals/characterization/stark_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=198) - - .. jupyter-execute:: - - from qiskit import pulse - from qiskit_experiments.library.driven_freq_tuning.p1_spect import StarkP1Spectroscopy - from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan - - qubit = 0 - exp = StarkRamseyXYAmpScan((qubit,), backend=backend) - exp.set_experiment_options( - stark_channel=pulse.ControlChannel(qubit), - stark_freq_offset=80e6, - stark_sigma=15e-9, - stark_risefall=2, - stark_length=50e-9, - min_stark_amp=-1.0, - max_stark_amp=1.0, - num_stark_amps=51, - stark_amps=None, - ) - - exp.set_run_options(shots=10000) - exp_data = exp.run().block_for_results() - ret_coeffs = exp_data.analysis_results("stark_coefficients").value - - # encode and decode the stark_coefficients - import json - from qiskit_experiments.framework import ExperimentEncoder - - with open("coefficients.json", "w") as fp: - json.dump(ret_coeffs, fp, cls=ExperimentEncoder) - - from qiskit_experiments.framework import ExperimentDecoder - - with open("coefficients.json", "r") as fp: - coefficients = json.load(fp, cls=ExperimentDecoder) - - # StarkP1Spectroscopy - exp = StarkP1Spectroscopy(physical_qubits=(qubit,), - backend=backend, - stark_channel=pulse.DriveChannel(qubit), - ) - exp.set_experiment_options( - t1_delay=20e-6, - min_xval=-20e6, - max_xval=20e6, - xval_type="frequency", - spacing="linear", - stark_coefficients=coefficients, - ) - exp.set_run_options(shots=100) - - exp_data = exp.run().block_for_results() - display(exp_data.figure(0)) """ @deprecate_func( From 75ae3c25f99667af1c007a8bfd240ba3b0649434 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:16:31 +0900 Subject: [PATCH 077/171] update EFRabi --- qiskit_experiments/library/characterization/rabi.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/qiskit_experiments/library/characterization/rabi.py b/qiskit_experiments/library/characterization/rabi.py index 0f427047de..2c547ba7fa 100644 --- a/qiskit_experiments/library/characterization/rabi.py +++ b/qiskit_experiments/library/characterization/rabi.py @@ -286,8 +286,6 @@ class EFRabi(Rabi): amplitudes=np.linspace(-0.1, 0.1, 21), backend=backend,) - display(exp.circuits()[1].draw()) - exp_data = exp.run().block_for_results() display(exp_data.figure(0)) exp_data.analysis_results(dataframe=True) From f754951e07a02dfa98047e6aefbeff77d70bc0d8 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:21:53 +0900 Subject: [PATCH 078/171] update releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml --- ...d-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml index bccb5a26a2..9bb50de162 100644 --- a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -5,7 +5,6 @@ other: EFSpectroscopy, EFRabi, StarkRamseyXYAmpScan, - StarkP1Spectroscopy, FineAmplitudeCal, FineXAmplitudeCal, FineSXAmplitudeCal, @@ -26,8 +25,9 @@ other: StandardRB, MitigatedProcessTomography, MitigatedStateTomography, - ProcessTomography and - StateTomography. + ProcessTomography, + StateTomography and + TomographyExperiment. By default, the backend used in the code examples, are simulators such as, SingleTransmonTestBackend() and AerSimulator(FakePerth()). From 3f24c15ebaefc5929fe9a69543376a92d1ee9770 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:01:59 +0900 Subject: [PATCH 079/171] removed: an example of StarkRamseyXYAmpScan in private-v3.2 (PR draft #1494) --- .../driven_freq_tuning/ramsey_amp_scan.py | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py index c2c6ec9164..494718e08d 100644 --- a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py +++ b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan.py @@ -92,39 +92,6 @@ class StarkRamseyXYAmpScan(BaseExperiment): # section: manual :doc:`/manuals/characterization/stark_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=198) - - .. jupyter-execute:: - - from qiskit import pulse - from qiskit_experiments.library.driven_freq_tuning import StarkRamseyXYAmpScan - - qubit = 0 - - exp = StarkRamseyXYAmpScan((qubit,), backend=backend) - exp.set_experiment_options( - stark_channel=pulse.ControlChannel(qubit), - stark_freq_offset=80e6, - stark_sigma=15e-9, - stark_risefall=2, - stark_length=50e-9, - min_stark_amp=-1.0, - max_stark_amp=1.0, - num_stark_amps=51, - stark_amps=None, - ) - - exp.set_run_options(shots=10000) - exp_data = exp.run().block_for_results() - result = exp_data.analysis_results() - display(exp_data.figure(0)) """ @deprecate_func( From 4361bf91efd55bdcbbbb40181dbff6c936018fc3 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:47:24 +0900 Subject: [PATCH 080/171] update releasenotes: removed StarkRamseyXYAmpScan --- .../add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml index 9bb50de162..627967e5f6 100644 --- a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -4,7 +4,6 @@ other: Added minimal working code examples to the API pages for Experiments, EFSpectroscopy, EFRabi, - StarkRamseyXYAmpScan, FineAmplitudeCal, FineXAmplitudeCal, FineSXAmplitudeCal, From bc28a49c89a79d8eb204f1d827202cd921698f7f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:16:04 +0900 Subject: [PATCH 081/171] update FineAmplitude-type experiment --- qiskit_experiments/library/calibration/fine_amplitude.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 596336dfae..80a148f460 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -190,7 +190,7 @@ def update_calibrations(self, experiment_data: ExperimentData): class FineXAmplitudeCal(FineAmplitudeCal): - r"""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:: @@ -269,7 +269,7 @@ def _pre_circuit(self, num_clbits: int) -> QuantumCircuit: class FineSXAmplitudeCal(FineAmplitudeCal): - r"""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:: From 049006974a6435693c03caf4e89dcf270a9376f4 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:17:30 +0900 Subject: [PATCH 082/171] update FineDrag-type experiments --- qiskit_experiments/library/calibration/fine_drag_cal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index 40910522b0..b2aaffacb4 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -30,7 +30,7 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): - r"""A calibration version of the fine DRAG experiment. + """A calibration version of the fine DRAG experiment. # section: example .. jupyter-execute:: @@ -177,7 +177,7 @@ def update_calibrations(self, experiment_data: ExperimentData): class FineXDragCal(FineDragCal): - r"""Fine DRAG calibration of X gate. + """Fine DRAG calibration of X gate. # section: example .. jupyter-execute:: @@ -239,7 +239,7 @@ def __init__( class FineSXDragCal(FineDragCal): - r"""Fine DRAG calibration of X gate. + """Fine DRAG calibration of X gate. # section: example .. jupyter-execute:: From db09f36cc44262307a86acebb752d045a799ff5c Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:19:18 +0900 Subject: [PATCH 083/171] update FineFrequencyCal-type experiments --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 40d60ffba1..e5f456d765 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -28,7 +28,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): - r"""A calibration version of the fine frequency experiment. + """A calibration version of the fine frequency experiment. # section: example .. jupyter-execute:: From e86a4eecc80e35f6c07e1484a8e7e9109a6bb1ae Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:20:46 +0900 Subject: [PATCH 084/171] update FrequencyCal-type experiments --- qiskit_experiments/library/calibration/frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index ef4d6e6c87..c52122d555 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -27,7 +27,7 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): - r"""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:: From 4bc9f8285cbb4bf979324221e0386ab54f1db840 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:21:58 +0900 Subject: [PATCH 085/171] update HalfAngleCal experiment --- qiskit_experiments/library/calibration/half_angle_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index 26075994c4..fb31958d75 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -28,7 +28,7 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): - r"""Calibration version of the :class:`.HalfAngle` experiment. + """Calibration version of the :class:`.HalfAngle` experiment. # section: example .. jupyter-execute:: From 8750882d80d386e2ea962ade1743c27d1099d417 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:23:20 +0900 Subject: [PATCH 086/171] update RoughAmplitudeCal-type experiments --- qiskit_experiments/library/calibration/rough_amplitude_cal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 43083666f4..0db0a71bc6 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -31,7 +31,7 @@ class RoughAmplitudeCal(BaseCalibrationExperiment, Rabi): - r"""A calibration version of the Rabi experiment. + """A calibration version of the Rabi experiment. # section: example .. jupyter-execute:: @@ -223,7 +223,7 @@ def update_calibrations(self, experiment_data: ExperimentData): class RoughXSXAmplitudeCal(RoughAmplitudeCal): - r"""A rough amplitude calibration of x and sx gates. + """A rough amplitude calibration of x and sx gates. # section: example .. jupyter-execute:: From 5846e516570242d3a2c57c1495abba364cae51bd Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:24:32 +0900 Subject: [PATCH 087/171] update RoughFrequencyCal experiment --- qiskit_experiments/library/calibration/rough_frequency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index efb95f8da1..04b84b698a 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -27,7 +27,7 @@ class RoughFrequencyCal(BaseCalibrationExperiment, QubitSpectroscopy): - r"""A calibration experiment that runs :class:`.QubitSpectroscopy` to calibrate the qubit + """A calibration experiment that runs :class:`.QubitSpectroscopy` to calibrate the qubit transition frequency. # section: example From b30b14f64cd575c279d12f6eb845e826e4f2578e Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:26:00 +0900 Subject: [PATCH 088/171] update EFSpectroscopy --- qiskit_experiments/library/characterization/ef_spectroscopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/characterization/ef_spectroscopy.py b/qiskit_experiments/library/characterization/ef_spectroscopy.py index 51107e47cb..400927a0d5 100644 --- a/qiskit_experiments/library/characterization/ef_spectroscopy.py +++ b/qiskit_experiments/library/characterization/ef_spectroscopy.py @@ -22,7 +22,7 @@ class EFSpectroscopy(QubitSpectroscopy): - r"""A spectroscopy experiment to obtain a frequency sweep of the qubit's e-f transition. + """A spectroscopy experiment to obtain a frequency sweep of the qubit's e-f transition. # section: overview The circuits produced by spectroscopy, i.e. From b310d0b5cc7fdd7a199ba8ce539f323ce442deb1 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:27:08 +0900 Subject: [PATCH 089/171] update QuantumVolume --- qiskit_experiments/library/quantum_volume/qv_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/quantum_volume/qv_experiment.py b/qiskit_experiments/library/quantum_volume/qv_experiment.py index f616d0d924..614db16510 100644 --- a/qiskit_experiments/library/quantum_volume/qv_experiment.py +++ b/qiskit_experiments/library/quantum_volume/qv_experiment.py @@ -28,7 +28,7 @@ class QuantumVolume(BaseExperiment): - r"""An experiment to measure the largest random square circuit that can be run on a processor. + """An experiment to measure the largest random square circuit that can be run on a processor. # section: overview Quantum Volume (QV) is a single-number metric that can be measured using a concrete protocol From 83423f78e0cb0c923492928ba7638b531acbec98 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:28:10 +0900 Subject: [PATCH 090/171] update InterleavedRB --- .../randomized_benchmarking/interleaved_rb_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index 9d77725a4f..afd5f57159 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -32,7 +32,7 @@ class InterleavedRB(StandardRB): - r"""An experiment to characterize the error rate of a specific gate on a device. + """An experiment to characterize the error rate of a specific gate on a device. # section: overview Interleaved Randomized Benchmarking (RB) is a method From 86c465d05e9c352f92e834cbaf7e0a783ffb6558 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:29:01 +0900 Subject: [PATCH 091/171] update StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index ed217b0e19..8d3c6c0950 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -54,7 +54,7 @@ class StandardRB(BaseExperiment, RestlessMixin): - r"""An experiment to characterize the error rate of a gate set on a device. + """An experiment to characterize the error rate of a gate set on a device. # section: overview From fd372eb76cae796a0515e0e6a547c4a90c0dafb0 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:30:19 +0900 Subject: [PATCH 092/171] update MitigatedProcessTomography --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index f0342d3f5b..87173b6bd2 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -25,7 +25,7 @@ class MitigatedProcessTomography(BatchExperiment): - r"""A batched experiment to characterize readout error then perform process tomography + """A batched experiment to characterize readout error then perform process tomography for doing readout error mitigated process tomography. # section: overview From e29a20f87875c51e1f4e58b78a75848d1ebe8859 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:31:15 +0900 Subject: [PATCH 093/171] update MitigatedStateTomography --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index 84ea5200e8..21d40806f8 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -25,7 +25,7 @@ class MitigatedStateTomography(BatchExperiment): - r"""A batched experiment to characterize readout error then perform state tomography + """A batched experiment to characterize readout error then perform state tomography for doing readout error mitigated state tomography. # section: overview From bc8cb84a9c04013a7b6d229ba7e456f91c4612f6 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:32:11 +0900 Subject: [PATCH 094/171] update ProcessTomography --- qiskit_experiments/library/tomography/qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index 237d10d1a6..48ec599a8d 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -27,7 +27,7 @@ class ProcessTomography(TomographyExperiment): - r"""An experiment to reconstruct the quantum channel from measurement data. + """An experiment to reconstruct the quantum channel from measurement data. # section: overview Quantum process tomography (QPT) is a method for experimentally From 33444a0c54c4f42aaf7e9edeae6189f02ded2714 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:33:06 +0900 Subject: [PATCH 095/171] update StateTomography --- qiskit_experiments/library/tomography/qst_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index c294519082..564f727b0b 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -26,7 +26,7 @@ class StateTomography(TomographyExperiment): - r"""An experiment to reconstruct the quantum state from measurement data. + """An experiment to reconstruct the quantum state from measurement data. # section: overview Quantum state tomography (QST) is a method for experimentally From 62d19e90c25031253fb839924ca3358a6242182f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:34:06 +0900 Subject: [PATCH 096/171] update TomographyExperiment --- qiskit_experiments/library/tomography/tomography_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/tomography_experiment.py b/qiskit_experiments/library/tomography/tomography_experiment.py index 6c07631390..b2b22b56fd 100644 --- a/qiskit_experiments/library/tomography/tomography_experiment.py +++ b/qiskit_experiments/library/tomography/tomography_experiment.py @@ -27,7 +27,7 @@ class TomographyExperiment(BaseExperiment): - r"""Base experiment for quantum state and process tomography. + """Base experiment for quantum state and process tomography. # section: analysis_ref :class:`TomographyAnalysis` From b92cdbe99babcc06d95525e6a22765987d2bea02 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:46:45 +0900 Subject: [PATCH 097/171] update FineFrequency --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index e5f456d765..d3549f4d57 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -50,7 +50,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): 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().block_for_results() + cal_data=exp_cal.run(backend_run=True).block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) """ From 36191e70aeb402f262ae4d93617d101b257cac31 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:47:49 +0900 Subject: [PATCH 098/171] update FrequencyCal --- qiskit_experiments/library/calibration/frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index c52122d555..cbbf829926 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -49,7 +49,7 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()]) exp_cal = FrequencyCal((0,), cals, backend=backend, auto_update=True) - cal_data=exp_cal.run().block_for_results() + cal_data=exp_cal.run(backend_run=True).block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) """ From 3e922f1aa303c6761b88cda06b0d7ee79d53dc0e Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:49:35 +0900 Subject: [PATCH 099/171] update FineFrequency --- qiskit_experiments/library/characterization/fine_frequency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/characterization/fine_frequency.py b/qiskit_experiments/library/characterization/fine_frequency.py index c01b17d5c7..26bedbda9e 100644 --- a/qiskit_experiments/library/characterization/fine_frequency.py +++ b/qiskit_experiments/library/characterization/fine_frequency.py @@ -74,7 +74,7 @@ class FineFrequency(BaseExperiment): repetitions=repetitions) exp.set_transpile_options(optimization_level=0, basis_gates=['sx', 'rz', 'delay']) - exp_data = exp.run().block_for_results() + exp_data = exp.run(backend_run=True).block_for_results() display(exp_data.figure(0)) exp_data.analysis_results(dataframe=True) """ From bd856bd168d3202d0edfe73a090b6507f060f297 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:55:45 +0900 Subject: [PATCH 100/171] update QuantumVolume --- qiskit_experiments/library/quantum_volume/qv_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/quantum_volume/qv_experiment.py b/qiskit_experiments/library/quantum_volume/qv_experiment.py index 614db16510..8cedba80a7 100644 --- a/qiskit_experiments/library/quantum_volume/qv_experiment.py +++ b/qiskit_experiments/library/quantum_volume/qv_experiment.py @@ -85,7 +85,7 @@ class QuantumVolume(BaseExperiment): qv_exp.set_transpile_options(optimization_level=3) qv_exp.set_run_options(shots=1000) - expdata = qv_exp.run(backend).block_for_results() + expdata = qv_exp.run(backend=backend, backend_run=True).block_for_results() display(expdata.figure(0)) for result in expdata.analysis_results(): From 02194c037ef8f3d4bd75a6324b7fd44be9e8a3d5 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:52 +0900 Subject: [PATCH 101/171] update InterleavedRB --- .../randomized_benchmarking/interleaved_rb_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index afd5f57159..2d63efa1cc 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -78,7 +78,7 @@ class InterleavedRB(StandardRB): int_exp2 = InterleavedRB( circuits.CXGate(), qubits, lengths, num_samples=num_samples, seed=seed) - int_expdata2 = int_exp2.run(backend).block_for_results() + int_expdata2 = int_exp2.run(backend=backend, backend_run=True).block_for_results() int_results2 = int_expdata2.analysis_results() display(int_expdata2.figure(0)) From d1c49a759af882ac6b325db630ccbe62305c1c76 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:57:58 +0900 Subject: [PATCH 102/171] update LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index 0cd2e6a1b1..a192478da9 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -115,7 +115,7 @@ class LayerFidelity(BaseExperiment, RestlessMixin): ) exp.set_run_options(shots=5000) - expdata = exp.run().block_for_results() + expdata = exp.run(backend_run=True).block_for_results() results = expdata.analysis_results() for i in range(4): From 9d566b5f44181b1bc22c9f5577d6da5baf31097b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:59:11 +0900 Subject: [PATCH 103/171] update StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 8d3c6c0950..03d2d4bcfc 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -115,14 +115,14 @@ class StandardRB(BaseExperiment, RestlessMixin): for qubit in qubits ] ) - expdata_1q = single_exps.run(backend).block_for_results() + expdata_1q = single_exps.run(backend=backend, backend_run=True).block_for_results() exp_2q = StandardRB(qubits, lengths_2_qubit, num_samples=num_samples, seed=seed) # Use the EPG data of the 1-qubit runs to ensure correct 2-qubit EPG computation exp_2q.analysis.set_options(epg_1_qubit=expdata_1q.analysis_results()) - expdata_2q = exp_2q.run(backend).block_for_results() + expdata_2q = exp_2q.run(backend=backend, backend_run=True).block_for_results() print("Gate error ratio: %s" % expdata_2q.experiment.analysis.options.gate_error_ratio) display(expdata_2q.figure(0)) From 0e7d3ffac69f897a2f5870dabd30760aa6c68e73 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:00:33 +0900 Subject: [PATCH 104/171] update MitigatedQPT --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 87173b6bd2..bb33998144 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -76,7 +76,7 @@ class MitigatedProcessTomography(BatchExperiment): mitqptexp = MitigatedProcessTomography(qc_ghz) mitqptexp.set_run_options(shots=1000) - mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100).block_for_results() + mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100, backend_run=True).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value # extracting a densitymatrix from mitigated_choi_out From 8f2a196c405b9a4296699727c8fe5a5a686f37a5 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:01:35 +0900 Subject: [PATCH 105/171] update MitigatedQST --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index 21d40806f8..7b7a9b0da1 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -83,7 +83,7 @@ class MitigatedStateTomography(BatchExperiment): mitqstexp = MitigatedStateTomography(qc_ghz) mitqstexp.set_run_options(shots=1000) - mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100).block_for_results() + mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100, backend_run=True).block_for_results() state_result = mitqstdata.analysis_results("state") plot_state_city(state_result.value, title="mitigated Density Matrix") """ From f5f5a7d02f446cca485ca4201a0f1f6e38584461 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:03:03 +0900 Subject: [PATCH 106/171] update ProcessTomography --- qiskit_experiments/library/tomography/qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index 48ec599a8d..5d7ed67eb8 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -71,7 +71,7 @@ class ProcessTomography(TomographyExperiment): qc_ghz.cx(0, i) qptexp = ProcessTomography(qc_ghz) - qptdata = qptexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + qptdata = qptexp.run(backend=backend, shots=1000, seed_simulator=100, backend_run=True).block_for_results() choi_out = qptdata.analysis_results("state").value # extracting a densitymatrix from choi_out From 7ea967d5f219387ce2bd35195ca53ac96f398970 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:03:56 +0900 Subject: [PATCH 107/171] update StateTomography --- qiskit_experiments/library/tomography/qst_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index 564f727b0b..8385e37e08 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -72,7 +72,7 @@ class StateTomography(TomographyExperiment): qc_ghz.cx(0, i) qstexp = StateTomography(qc_ghz) - qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100, backend_run=True).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From 84bc8d5cdb507ffaf7f481d0554e4c55ddc36b69 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:05:23 +0900 Subject: [PATCH 108/171] update TomographyExperiment --- qiskit_experiments/library/tomography/tomography_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/tomography_experiment.py b/qiskit_experiments/library/tomography/tomography_experiment.py index b2b22b56fd..ee407b4a08 100644 --- a/qiskit_experiments/library/tomography/tomography_experiment.py +++ b/qiskit_experiments/library/tomography/tomography_experiment.py @@ -64,7 +64,7 @@ class TomographyExperiment(BaseExperiment): measurement_basis=PauliMeasurementBasis(), ) - qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100).block_for_results() + qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100, backend_run=True).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From 5ec0c2ba78766a784747b49fe2d020a8b9003e53 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:23:10 +0900 Subject: [PATCH 109/171] update MitigatedQST --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index 7b7a9b0da1..e2f44c80ef 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -83,7 +83,8 @@ class MitigatedStateTomography(BatchExperiment): mitqstexp = MitigatedStateTomography(qc_ghz) mitqstexp.set_run_options(shots=1000) - mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100, backend_run=True).block_for_results() + mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100,\ + backend_run=True).block_for_results() state_result = mitqstdata.analysis_results("state") plot_state_city(state_result.value, title="mitigated Density Matrix") """ From 1538797a997d34c509b8db12191eabdcf529d567 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:44:58 +0900 Subject: [PATCH 110/171] update MitigatedQPT --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index bb33998144..29b1dae8a0 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -76,7 +76,8 @@ class MitigatedProcessTomography(BatchExperiment): mitqptexp = MitigatedProcessTomography(qc_ghz) mitqptexp.set_run_options(shots=1000) - mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100, backend_run=True).block_for_results() + mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100,\ + backend_run=True).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value # extracting a densitymatrix from mitigated_choi_out From 58f78814c39889bb8b1a09854ba7e9907fc103f7 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:46:13 +0900 Subject: [PATCH 111/171] update StateTomography --- qiskit_experiments/library/tomography/qpt_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index 5d7ed67eb8..a972bcbdcb 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -71,7 +71,8 @@ class ProcessTomography(TomographyExperiment): qc_ghz.cx(0, i) qptexp = ProcessTomography(qc_ghz) - qptdata = qptexp.run(backend=backend, shots=1000, seed_simulator=100, backend_run=True).block_for_results() + qptdata = qptexp.run(backend=backend, shots=1000, seed_simulator=100,\ + backend_run=True).block_for_results() choi_out = qptdata.analysis_results("state").value # extracting a densitymatrix from choi_out From c9c8135dc1fdbc50b90d8d0233b8d127de2eb78e Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:48:33 +0900 Subject: [PATCH 112/171] update StateTomograpy --- qiskit_experiments/library/tomography/qst_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index 8385e37e08..c66a170ae3 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -72,7 +72,8 @@ class StateTomography(TomographyExperiment): qc_ghz.cx(0, i) qstexp = StateTomography(qc_ghz) - qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100, backend_run=True).block_for_results() + qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100,\ + backend_run=True).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From 2f59a2705a967e9c48b5f63c69a3e7065c399484 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:50:15 +0900 Subject: [PATCH 113/171] update TomographyExperiment --- qiskit_experiments/library/tomography/tomography_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/tomography_experiment.py b/qiskit_experiments/library/tomography/tomography_experiment.py index ee407b4a08..5c551464dd 100644 --- a/qiskit_experiments/library/tomography/tomography_experiment.py +++ b/qiskit_experiments/library/tomography/tomography_experiment.py @@ -64,7 +64,8 @@ class TomographyExperiment(BaseExperiment): measurement_basis=PauliMeasurementBasis(), ) - qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100, backend_run=True).block_for_results() + qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100,\ + backend_run=True).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From bb22f8872c8ec21d2bafd2449da82de1d7a8ba02 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:43:06 +0900 Subject: [PATCH 114/171] updata FineFrequencyCal; auto_update=False --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index d3549f4d57..9b15bdba75 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -48,7 +48,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): 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") + exp_cal = FineFrequencyCal((0,), cals, backend=backend, auto_update=False, gate_name="sx") cal_data=exp_cal.run(backend_run=True).block_for_results() display(cal_data.figure(0)) From 61baf82141f05d0c27f88d7dcbf6aca78e46226c Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:44:51 +0900 Subject: [PATCH 115/171] update FrequencyCal; auto_update=False --- qiskit_experiments/library/calibration/frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index cbbf829926..d9336e49d1 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -47,7 +47,7 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): 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) + exp_cal = FrequencyCal((0,), cals, backend=backend, auto_update=False) cal_data=exp_cal.run(backend_run=True).block_for_results() display(cal_data.figure(0)) From df73d13e36c771a7af78b2b31724a8bc27ab9215 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 06:32:08 +0900 Subject: [PATCH 116/171] LayerFidelity revised --- .../randomized_benchmarking/layer_fidelity.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index a192478da9..b1442a6edd 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -95,13 +95,8 @@ class LayerFidelity(BaseExperiment, RestlessMixin): lengths = np.arange(1, 800, 200) two_qubit_layers=[[(0, 1), (3, 5)], [(1, 3), (5, 6)]] - for qpair in two_qubit_layers: - for qpair_ in backend.coupling_map: - if qpair_ == qpair: - pass - num_samples = 6 - seed = 1010 + seed = 106 exp = LayerFidelity( physical_qubits=[0, 1, 3, 5, 6], @@ -114,12 +109,12 @@ class LayerFidelity(BaseExperiment, RestlessMixin): one_qubit_basis_gates=None, ) - exp.set_run_options(shots=5000) - expdata = exp.run(backend_run=True).block_for_results() - results = expdata.analysis_results() + exp_data = exp.run(backend_run=True).block_for_results() + results = exp_data.analysis_results() + for i in range(num_samples): + display(exp_data.figure(i)) - for i in range(4): - display(expdata.figure(i)) + display(exp_data.analysis_results(dataframe=True)) """ def __init__( From 126da51a900e00b27580d0015d2b089642958019 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 06:42:11 +0900 Subject: [PATCH 117/171] update LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index b1442a6edd..3dbadd6cc0 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -114,7 +114,7 @@ class LayerFidelity(BaseExperiment, RestlessMixin): for i in range(num_samples): display(exp_data.figure(i)) - display(exp_data.analysis_results(dataframe=True)) + display(exp_data.analysis_results(dataframe=True)) """ def __init__( From 1c13ed2461e5a90e061b13f9f3eb2e4f2c27e786 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 08:36:19 +0900 Subject: [PATCH 118/171] a code example of TomographyExperiments removed --- .../tomography/tomography_experiment.py | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/qiskit_experiments/library/tomography/tomography_experiment.py b/qiskit_experiments/library/tomography/tomography_experiment.py index 5c551464dd..200ca6992f 100644 --- a/qiskit_experiments/library/tomography/tomography_experiment.py +++ b/qiskit_experiments/library/tomography/tomography_experiment.py @@ -32,42 +32,6 @@ class TomographyExperiment(BaseExperiment): # section: analysis_ref :class:`TomographyAnalysis` - # 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 import QuantumCircuit - from qiskit_experiments.library import TomographyExperiment - from qiskit_experiments.library.tomography.basis import PauliMeasurementBasis - from qiskit.visualization import plot_state_city - - nq = 2 - qc_ghz = QuantumCircuit(nq) - qc_ghz.h(0) - qc_ghz.s(0) - - for i in range(1, nq): - qc_ghz.cx(0, i) - - qstexp = TomographyExperiment( - circuit=qc_ghz, - backend=backend, - physical_qubits=(0,1), - measurement_basis=PauliMeasurementBasis(), - ) - - qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100,\ - backend_run=True).block_for_results() - state_result = qstdata.analysis_results("state") - plot_state_city(state_result.value, title="Density Matrix") """ @classmethod From 173b594c714793278b7300320de01d31fe36b649 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:13:30 +0900 Subject: [PATCH 119/171] update FineAmplitudeCal --- qiskit_experiments/library/calibration/fine_amplitude.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 80a148f460..1144d822dc 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -50,7 +50,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): from qiskit.circuit.library import XGate from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library \ - import FixedFrequencyTransmon +import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal library = FixedFrequencyTransmon() From 48c8bbafd076671050b298a018ba29b7e6e6f7a9 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:13:57 +0900 Subject: [PATCH 120/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 1144d822dc..fdff28b60b 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -49,8 +49,8 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): 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.calibration_management.basis_gate_library \\ + import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal library = FixedFrequencyTransmon() From 17b532484a68a5f866b4f5652b6784cf50041423 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:20:27 +0900 Subject: [PATCH 121/171] update MitigatedQPT --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 29b1dae8a0..69bff4a6eb 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -76,8 +76,9 @@ class MitigatedProcessTomography(BatchExperiment): mitqptexp = MitigatedProcessTomography(qc_ghz) mitqptexp.set_run_options(shots=1000) - mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100,\ - backend_run=True).block_for_results() + mitqptdata = mitqptexp.run(backend=backend, + seed_simulator=100, + backend_run=True).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value # extracting a densitymatrix from mitigated_choi_out From c0d4b7f7235b94af506fcd2cc2241614c33a2a5f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:21:05 +0900 Subject: [PATCH 122/171] update MitigatedQST --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index e2f44c80ef..c54916d6a5 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -83,8 +83,9 @@ class MitigatedStateTomography(BatchExperiment): mitqstexp = MitigatedStateTomography(qc_ghz) mitqstexp.set_run_options(shots=1000) - mitqstdata = mitqstexp.run(backend=backend, seed_simulator=100,\ - backend_run=True).block_for_results() + mitqstdata = mitqstexp.run(backend=backend, + seed_simulator=100, + backend_run=True).block_for_results() state_result = mitqstdata.analysis_results("state") plot_state_city(state_result.value, title="mitigated Density Matrix") """ From 54d2e9ce0c5f3b7fe9812d5920ae5ac20f0a0c66 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:21:57 +0900 Subject: [PATCH 123/171] update QPT --- qiskit_experiments/library/tomography/qpt_experiment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index a972bcbdcb..afbeccdf7d 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -71,8 +71,10 @@ class ProcessTomography(TomographyExperiment): qc_ghz.cx(0, i) qptexp = ProcessTomography(qc_ghz) - qptdata = qptexp.run(backend=backend, shots=1000, seed_simulator=100,\ - backend_run=True).block_for_results() + qptdata = qptexp.run(backend=backend, + shots=1000, + seed_simulator=100, + backend_run=True).block_for_results() choi_out = qptdata.analysis_results("state").value # extracting a densitymatrix from choi_out From 5ef862bfc4c449eb541bbc8dcfd7e921d4e4ba6f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:38:43 +0900 Subject: [PATCH 124/171] update QST --- qiskit_experiments/library/tomography/qst_experiment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index c66a170ae3..53f9ecb685 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -72,8 +72,10 @@ class StateTomography(TomographyExperiment): qc_ghz.cx(0, i) qstexp = StateTomography(qc_ghz) - qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100,\ - backend_run=True).block_for_results() + qstdata = qstexp.run(backend=backend, + shots=1000, + seed_simulator=100, + backend_run=True).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From 6f1adf08a3b8847ab12151fef211f510418d9ede Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:47:37 +0900 Subject: [PATCH 125/171] update Mitigated QPT --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 69bff4a6eb..5a09dcb0a5 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -78,7 +78,7 @@ class MitigatedProcessTomography(BatchExperiment): mitqptexp.set_run_options(shots=1000) mitqptdata = mitqptexp.run(backend=backend, seed_simulator=100, - backend_run=True).block_for_results() + backend_run=True).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value # extracting a densitymatrix from mitigated_choi_out From 794bd3cfc02bea811f8228a249c7905fcdb09e95 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:48:15 +0900 Subject: [PATCH 126/171] update QST --- qiskit_experiments/library/tomography/qst_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index 53f9ecb685..26136717af 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -75,7 +75,7 @@ class StateTomography(TomographyExperiment): qstdata = qstexp.run(backend=backend, shots=1000, seed_simulator=100, - backend_run=True).block_for_results() + backend_run=True).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From d52a2b6848d697ee14c841bcfc8159d42b5d370d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:02:46 +0900 Subject: [PATCH 127/171] update FineAmplitudeCal --- qiskit_experiments/library/calibration/fine_amplitude.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index fdff28b60b..80a148f460 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -49,7 +49,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): 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 \\ + from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal From 8143f72f011d11806387abbb1a4c4d5bca8b718e Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:12:55 +0900 Subject: [PATCH 128/171] update releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml --- ...experiments-api-docs-31f3e3c3369a6f3d.yaml | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml index 627967e5f6..e15a8e277a 100644 --- a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -1,32 +1,31 @@ --- other: - | - Added minimal working code examples to the API pages for Experiments, - EFSpectroscopy, - EFRabi, - FineAmplitudeCal, - FineXAmplitudeCal, - FineSXAmplitudeCal, - FineDragCal, - FineXDragCal, - FineSXDragCal, - FineFrequencyCal, - FrequencyCal, - HalfAngleCal, - RoughAmplitudeCal, - RoughXSXAmplitudeCal, - EFRoughXSXAmplitudeCal, - RoughDragCal, - RoughFrequencyCal, - QuantumVolume, - InterleavedRB, - LayerFidelity, - StandardRB, - MitigatedProcessTomography, - MitigatedStateTomography, - ProcessTomography, - StateTomography and - TomographyExperiment. - By default, the backend used in the code examples, are simulators - such as, SingleTransmonTestBackend() and - AerSimulator(FakePerth()). + Added minimal working code examples to the API pages for the experiments, + :class:`~.EFSpectroscopy`, + :class:`~.EFRabi`, + :class:`~.FineAmplitudeCal`, + :class:`~.FineXAmplitudeCal`, + :class:`~.FineSXAmplitudeCal`, + :class:`~.FineDragCal`, + :class:`~.FineXDragCal`, + :class:`~.FineSXDragCal`, + :class:`~.FineFrequencyCal`, + :class:`~.FrequencyCal`, + :class:`~.HalfAngleCal`, + :class:`~.RoughAmplitudeCal`, + :class:`~.RoughXSXAmplitudeCal`, + :class:`~.EFRoughXSXAmplitudeCal`, + :class:`~.RoughDragCal`, + :class:`~.RoughFrequencyCal`, + :class:`~.QuantumVolume`, + :class:`~.InterleavedRB`, + :class:`~.LayerFidelity`, + :class:`~.StandardRB`, + :class:`~.MitigatedProcessTomography`, + :class:`~.MitigatedStateTomography`, + :class:`~.ProcessTomography` and + :class:`~.StateTomography`. + The backend used in the code examples are simulators + such as, ``SingleTransmonTestBackend()`` and + ``AerSimulator(FakePerth())``. From ddaa7efe41a0b20b3985f821312c0548b67f0553 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Fri, 6 Dec 2024 05:09:59 +0900 Subject: [PATCH 129/171] LayerFidelity is added in Verification Experiments --- qiskit_experiments/library/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qiskit_experiments/library/__init__.py b/qiskit_experiments/library/__init__.py index 29770ed7b3..2e47b281e8 100644 --- a/qiskit_experiments/library/__init__.py +++ b/qiskit_experiments/library/__init__.py @@ -36,6 +36,7 @@ ~randomized_benchmarking.StandardRB ~randomized_benchmarking.InterleavedRB + ~randomized_benchmarking.LayerFidelity ~tomography.TomographyExperiment ~tomography.StateTomography ~tomography.ProcessTomography From 2908e864688f290d74d98568881adacd0d6527f8 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:01:19 +0900 Subject: [PATCH 130/171] update calibration/fine_drag_cal.py --- .../library/calibration/fine_amplitude.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 80a148f460..71ba788a97 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -42,7 +42,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend - backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=101) + backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=101) .. jupyter-execute:: @@ -53,7 +53,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): import FixedFrequencyTransmon from qiskit_experiments.library import FineAmplitudeCal - library = FixedFrequencyTransmon() + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.030}) cals = Calibrations.from_backend(backend=backend, libraries=[library]) exp_cal = FineAmplitudeCal(physical_qubits=(0,), calibrations=cals, @@ -65,7 +65,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): measurement_qubits=(0,)) # This option is necessary! exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, - "phase_offset" : np.pi/2}) + "phase_offset" : np.pi}) cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) @@ -207,7 +207,7 @@ class FineXAmplitudeCal(FineAmplitudeCal): import FixedFrequencyTransmon from qiskit_experiments.library import FineXAmplitudeCal - library = FixedFrequencyTransmon(default_values={"duration": 320}) + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.030}) cals = Calibrations.from_backend(backend, libraries=[library]) exp_cal = FineXAmplitudeCal((0,), @@ -218,6 +218,8 @@ class FineXAmplitudeCal(FineAmplitudeCal): auto_update=True, ) + exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, "phase_offset" : np.pi / 2}) + exp_data = exp_cal.run().block_for_results() display(exp_data.figure(0)) exp_data.analysis_results(dataframe=True) @@ -286,7 +288,7 @@ class FineSXAmplitudeCal(FineAmplitudeCal): import FixedFrequencyTransmon from qiskit_experiments.library import FineSXAmplitudeCal - library = FixedFrequencyTransmon(default_values={"duration": 320}) + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.015}) cals = Calibrations.from_backend(backend, libraries=[library]) exp_cal = FineSXAmplitudeCal((0,), @@ -297,6 +299,8 @@ class FineSXAmplitudeCal(FineAmplitudeCal): auto_update=True, ) + exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi / 2, "phase_offset" : np.pi}) + cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) From c751343af5b1785d7f9c736881dc553d8ae102f2 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:03:03 +0900 Subject: [PATCH 131/171] update calibration/fine_drag_cal.py --- .../library/calibration/fine_drag_cal.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index b2aaffacb4..cc2556857d 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -47,11 +47,11 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): import FixedFrequencyTransmon from qiskit_experiments.library import FineDragCal - library = FixedFrequencyTransmon(default_values={"duration": 320}) + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.030, "beta": 0.0}) cals = Calibrations.from_backend(backend, libraries=[library]) exp_cal = FineDragCal((0,), - cals, + calibrations=cals, backend=backend, schedule_name="sx", cal_parameter_name="β", @@ -194,11 +194,11 @@ class FineXDragCal(FineDragCal): import FixedFrequencyTransmon from qiskit_experiments.library import FineXDragCal - library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.4}) + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.030, "beta": 0.0}) cals = Calibrations.from_backend(backend, libraries=[library]) exp_cal = FineXDragCal((0,), - cals, + calibrations=cals, backend=backend, cal_parameter_name="β", auto_update=True, @@ -256,11 +256,11 @@ class FineSXDragCal(FineDragCal): import FixedFrequencyTransmon from qiskit_experiments.library import FineSXDragCal - library = FixedFrequencyTransmon(default_values={"duration": 320}) + library = FixedFrequencyTransmon(default_values={"duration": 320, "amp": 0.030, "beta": 0.0}) cals = Calibrations.from_backend(backend=backend, libraries=[library]) exp_cal = FineSXDragCal((0,), - cals, + calibrations=cals, backend=backend, cal_parameter_name="β", auto_update=True, From 7d874c4c49547b527d408af1eecb20ba3d0b6652 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:30:12 +0900 Subject: [PATCH 132/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 71ba788a97..2a6a1e65aa 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -202,6 +202,7 @@ class FineXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: + import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon @@ -283,6 +284,7 @@ class FineSXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: + import numpy as np from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon From 9f15b35bb4f14e9156ad8583077e81c45fd20068 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:53:29 +0900 Subject: [PATCH 133/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 2a6a1e65aa..2b395007ac 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -219,7 +219,8 @@ class FineXAmplitudeCal(FineAmplitudeCal): auto_update=True, ) - exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, "phase_offset" : np.pi / 2}) + exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, + "phase_offset" : np.pi / 2}) exp_data = exp_cal.run().block_for_results() display(exp_data.figure(0)) @@ -301,7 +302,8 @@ class FineSXAmplitudeCal(FineAmplitudeCal): auto_update=True, ) - exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi / 2, "phase_offset" : np.pi}) + exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi / 2, + "phase_offset" : np.pi}) cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) From 390b93dc8b9aa5f93b5cdba6e2c1d338b237d628 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:58:58 +0900 Subject: [PATCH 134/171] backend_run=True is removed in FineFrequency --- qiskit_experiments/library/characterization/fine_frequency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/characterization/fine_frequency.py b/qiskit_experiments/library/characterization/fine_frequency.py index ea6aadb8c7..ce39417d67 100644 --- a/qiskit_experiments/library/characterization/fine_frequency.py +++ b/qiskit_experiments/library/characterization/fine_frequency.py @@ -70,7 +70,7 @@ class FineFrequency(BaseExperiment): repetitions=repetitions) exp.set_transpile_options(optimization_level=0, basis_gates=['sx', 'rz', 'delay']) - exp_data = exp.run(backend_run=True).block_for_results() + exp_data = exp.run().block_for_results() display(exp_data.figure(0)) exp_data.analysis_results(dataframe=True) """ From 508b1137b5bb9f79525ab165aff547fae6fddb23 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:36:45 +0900 Subject: [PATCH 135/171] backend_run=True is removed in FrequencyCal --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 9b15bdba75..65c6a4b10e 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -50,7 +50,7 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()]) exp_cal = FineFrequencyCal((0,), cals, backend=backend, auto_update=False, gate_name="sx") - cal_data=exp_cal.run(backend_run=True).block_for_results() + cal_data=exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) """ From 39f5ba08e56eaf127758a73d70d7727a7acf9e81 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:37:41 +0900 Subject: [PATCH 136/171] backend_run=True is removed in QuantumVolume --- qiskit_experiments/library/quantum_volume/qv_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/quantum_volume/qv_experiment.py b/qiskit_experiments/library/quantum_volume/qv_experiment.py index 8cedba80a7..ae8406c928 100644 --- a/qiskit_experiments/library/quantum_volume/qv_experiment.py +++ b/qiskit_experiments/library/quantum_volume/qv_experiment.py @@ -85,7 +85,7 @@ class QuantumVolume(BaseExperiment): qv_exp.set_transpile_options(optimization_level=3) qv_exp.set_run_options(shots=1000) - expdata = qv_exp.run(backend=backend, backend_run=True).block_for_results() + expdata = qv_exp.run(backend=backend).block_for_results() display(expdata.figure(0)) for result in expdata.analysis_results(): From b224e1fc2c2d4b7d83c7f7e730d3dc54f8b999e3 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:38:58 +0900 Subject: [PATCH 137/171] backend_run=True is removed in InterLeavedRB --- .../randomized_benchmarking/interleaved_rb_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index 2d63efa1cc..dd23854331 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -78,7 +78,7 @@ class InterleavedRB(StandardRB): int_exp2 = InterleavedRB( circuits.CXGate(), qubits, lengths, num_samples=num_samples, seed=seed) - int_expdata2 = int_exp2.run(backend=backend, backend_run=True).block_for_results() + int_expdata2 = int_exp2.run(backend=backend).block_for_results() int_results2 = int_expdata2.analysis_results() display(int_expdata2.figure(0)) From 18780e50fc460c71d360cf06ab950e38e903a27b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:40:00 +0900 Subject: [PATCH 138/171] backend_run=True is removed in LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index 3dbadd6cc0..c364d7d94c 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -109,7 +109,7 @@ class LayerFidelity(BaseExperiment, RestlessMixin): one_qubit_basis_gates=None, ) - exp_data = exp.run(backend_run=True).block_for_results() + exp_data = exp.run().block_for_results() results = exp_data.analysis_results() for i in range(num_samples): display(exp_data.figure(i)) From 6f5d32101319f0eb25383ac6ce544cb627d7f863 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:40:47 +0900 Subject: [PATCH 139/171] backend_run=True is removed in StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 03d2d4bcfc..57419ad170 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -115,14 +115,14 @@ class StandardRB(BaseExperiment, RestlessMixin): for qubit in qubits ] ) - expdata_1q = single_exps.run(backend=backend, backend_run=True).block_for_results() + expdata_1q = single_exps.run(backend=backend).block_for_results() exp_2q = StandardRB(qubits, lengths_2_qubit, num_samples=num_samples, seed=seed) # Use the EPG data of the 1-qubit runs to ensure correct 2-qubit EPG computation exp_2q.analysis.set_options(epg_1_qubit=expdata_1q.analysis_results()) - expdata_2q = exp_2q.run(backend=backend, backend_run=True).block_for_results() + expdata_2q = exp_2q.run(backend=backend).block_for_results() print("Gate error ratio: %s" % expdata_2q.experiment.analysis.options.gate_error_ratio) display(expdata_2q.figure(0)) From 988ffe655531d757efbb4e7bb19e58ddf4bbbc35 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:41:33 +0900 Subject: [PATCH 140/171] backend_run=True is removed in FrequencyCal --- qiskit_experiments/library/calibration/frequency_cal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index d9336e49d1..229d4ce757 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -49,7 +49,7 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): cals = Calibrations.from_backend(backend=backend, libraries=[FixedFrequencyTransmon()]) exp_cal = FrequencyCal((0,), cals, backend=backend, auto_update=False) - cal_data=exp_cal.run(backend_run=True).block_for_results() + cal_data=exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) """ From c3a39f0297940f4e748a7633a20119c368b82495 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:23:10 +0900 Subject: [PATCH 141/171] backend_run=True is removed in MitigatedQPT --- qiskit_experiments/library/tomography/mit_qpt_experiment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/mit_qpt_experiment.py b/qiskit_experiments/library/tomography/mit_qpt_experiment.py index 5a09dcb0a5..8a9a000302 100644 --- a/qiskit_experiments/library/tomography/mit_qpt_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qpt_experiment.py @@ -77,8 +77,7 @@ class MitigatedProcessTomography(BatchExperiment): mitqptexp = MitigatedProcessTomography(qc_ghz) mitqptexp.set_run_options(shots=1000) mitqptdata = mitqptexp.run(backend=backend, - seed_simulator=100, - backend_run=True).block_for_results() + seed_simulator=100,).block_for_results() mitigated_choi_out = mitqptdata.analysis_results("state").value # extracting a densitymatrix from mitigated_choi_out From 19829ab3bdbbee7a1732f3cc5b10e4d09ba74ca9 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:23:44 +0900 Subject: [PATCH 142/171] backend_run=True is removed in MitigatedQST --- qiskit_experiments/library/tomography/mit_qst_experiment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/mit_qst_experiment.py b/qiskit_experiments/library/tomography/mit_qst_experiment.py index c54916d6a5..7256f90f5e 100644 --- a/qiskit_experiments/library/tomography/mit_qst_experiment.py +++ b/qiskit_experiments/library/tomography/mit_qst_experiment.py @@ -84,8 +84,7 @@ class MitigatedStateTomography(BatchExperiment): mitqstexp = MitigatedStateTomography(qc_ghz) mitqstexp.set_run_options(shots=1000) mitqstdata = mitqstexp.run(backend=backend, - seed_simulator=100, - backend_run=True).block_for_results() + seed_simulator=100,).block_for_results() state_result = mitqstdata.analysis_results("state") plot_state_city(state_result.value, title="mitigated Density Matrix") """ From 6fb0b2b09a8625790d5269eb6280a1f0c744ca24 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:24:27 +0900 Subject: [PATCH 143/171] backend_run=True is removed in QST --- qiskit_experiments/library/tomography/qst_experiment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/qst_experiment.py b/qiskit_experiments/library/tomography/qst_experiment.py index 26136717af..4d63ba071e 100644 --- a/qiskit_experiments/library/tomography/qst_experiment.py +++ b/qiskit_experiments/library/tomography/qst_experiment.py @@ -74,8 +74,7 @@ class StateTomography(TomographyExperiment): qstexp = StateTomography(qc_ghz) qstdata = qstexp.run(backend=backend, shots=1000, - seed_simulator=100, - backend_run=True).block_for_results() + seed_simulator=100,).block_for_results() state_result = qstdata.analysis_results("state") plot_state_city(state_result.value, title="Density Matrix") """ From e725912ecdc3dc1173d00d66373f9ea147de7af9 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:24:52 +0900 Subject: [PATCH 144/171] backend_run=True is removed in QPT --- qiskit_experiments/library/tomography/qpt_experiment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qiskit_experiments/library/tomography/qpt_experiment.py b/qiskit_experiments/library/tomography/qpt_experiment.py index afbeccdf7d..72faf2a2ca 100644 --- a/qiskit_experiments/library/tomography/qpt_experiment.py +++ b/qiskit_experiments/library/tomography/qpt_experiment.py @@ -73,8 +73,7 @@ class ProcessTomography(TomographyExperiment): qptexp = ProcessTomography(qc_ghz) qptdata = qptexp.run(backend=backend, shots=1000, - seed_simulator=100, - backend_run=True).block_for_results() + seed_simulator=100,).block_for_results() choi_out = qptdata.analysis_results("state").value # extracting a densitymatrix from choi_out From b65d543e7c9ac1b40c99a05311417850f0a7cdba Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 05:36:34 +0900 Subject: [PATCH 145/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 2b395007ac..dbdb66d70b 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -219,9 +219,6 @@ class FineXAmplitudeCal(FineAmplitudeCal): auto_update=True, ) - exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, - "phase_offset" : np.pi / 2}) - exp_data = exp_cal.run().block_for_results() display(exp_data.figure(0)) exp_data.analysis_results(dataframe=True) @@ -302,9 +299,6 @@ class FineSXAmplitudeCal(FineAmplitudeCal): auto_update=True, ) - exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi / 2, - "phase_offset" : np.pi}) - cal_data = exp_cal.run().block_for_results() display(cal_data.figure(0)) cal_data.analysis_results(dataframe=True) From 8fc00875f7e3818fed744149afb04bd487c67de1 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:42:36 +0900 Subject: [PATCH 146/171] update InterLeavedRB --- .../randomized_benchmarking/interleaved_rb_experiment.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index dd23854331..8e4c26536f 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -80,10 +80,9 @@ class InterleavedRB(StandardRB): int_expdata2 = int_exp2.run(backend=backend).block_for_results() int_results2 = int_expdata2.analysis_results() - display(int_expdata2.figure(0)) - for result in int_results2: - print(result) + + print(int_results2[0].name) """ def __init__( From 39c2e6fbc3dfb5d0ecb99d7796b33d66a29854fd Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:43:25 +0900 Subject: [PATCH 147/171] update LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index c364d7d94c..17dd9c2787 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -110,11 +110,9 @@ class LayerFidelity(BaseExperiment, RestlessMixin): ) exp_data = exp.run().block_for_results() - results = exp_data.analysis_results() - for i in range(num_samples): - display(exp_data.figure(i)) - - display(exp_data.analysis_results(dataframe=True)) + + display(exp_data.figure(0)) # one of 6 figures + display(exp_data.analysis_results("EPLG", dataframe=True)) """ def __init__( From c367c12b639b0379dcc8345cb83f6bb2c60abde9 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:44:28 +0900 Subject: [PATCH 148/171] update StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 57419ad170..25be24b7db 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -126,8 +126,8 @@ class StandardRB(BaseExperiment, RestlessMixin): print("Gate error ratio: %s" % expdata_2q.experiment.analysis.options.gate_error_ratio) display(expdata_2q.figure(0)) - for result in expdata_2q.analysis_results(): - print(result) + + print(expdata_2q.analysis_results()[0].name) """ def __init__( From 4865d1184051e1cb66807531e092ff418fff2592 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:51:11 +0900 Subject: [PATCH 149/171] update LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index 17dd9c2787..5dddf7ba50 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -110,7 +110,7 @@ class LayerFidelity(BaseExperiment, RestlessMixin): ) exp_data = exp.run().block_for_results() - + display(exp_data.figure(0)) # one of 6 figures display(exp_data.analysis_results("EPLG", dataframe=True)) """ From 788296370036bb9cdd1842833415846d0fc30138 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:56:02 +0900 Subject: [PATCH 150/171] update releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml --- .../add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml index e15a8e277a..4cc833152f 100644 --- a/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml +++ b/releasenotes/notes/add-examples-to-experiments-api-docs-31f3e3c3369a6f3d.yaml @@ -26,6 +26,6 @@ other: :class:`~.MitigatedStateTomography`, :class:`~.ProcessTomography` and :class:`~.StateTomography`. - The backend used in the code examples are simulators + The backends used in the code examples are simulators such as, ``SingleTransmonTestBackend()`` and ``AerSimulator(FakePerth())``. From aceeff6d158eafe3a82471e20d0633140373d855 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:59:49 +0900 Subject: [PATCH 151/171] update FineAmplitudeCal(SXGate) --- qiskit_experiments/library/calibration/fine_amplitude.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index dbdb66d70b..d5f340e856 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -47,7 +47,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): .. jupyter-execute:: import numpy as np - from qiskit.circuit.library import XGate + from qiskit.circuit.library import SXGate from qiskit_experiments.calibration_management.calibrations import Calibrations from qiskit_experiments.calibration_management.basis_gate_library \ import FixedFrequencyTransmon @@ -57,14 +57,14 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): cals = Calibrations.from_backend(backend=backend, libraries=[library]) exp_cal = FineAmplitudeCal(physical_qubits=(0,), calibrations=cals, - schedule_name="x", + schedule_name="sx", backend=backend, cal_parameter_name="amp", auto_update=True, - gate=XGate(), + gate=SXGate(), measurement_qubits=(0,)) # This option is necessary! - exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi, + exp_cal.analysis.set_options(fixed_parameters={"angle_per_gate" : np.pi / 2, "phase_offset" : np.pi}) cal_data = exp_cal.run().block_for_results() From 7ea68e98bad8b3ea877c0c5afa2828d633d74a96 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:50:02 +0900 Subject: [PATCH 152/171] update warnings.filterwarnings() in calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index d5f340e856..0e49243c60 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -40,6 +40,8 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): .. jupyter-execute:: :hide-code: + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=101) @@ -196,6 +198,8 @@ class FineXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: :hide-code: + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=111) @@ -276,6 +280,8 @@ class FineSXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: :hide-code: + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=105) From d5e06c11c07a7c9d8732266517a483e72a13f8a4 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:05:56 +0900 Subject: [PATCH 153/171] update calibration/fine_amplitude.py --- qiskit_experiments/library/calibration/fine_amplitude.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit_experiments/library/calibration/fine_amplitude.py b/qiskit_experiments/library/calibration/fine_amplitude.py index 0e49243c60..3055d6fedb 100644 --- a/qiskit_experiments/library/calibration/fine_amplitude.py +++ b/qiskit_experiments/library/calibration/fine_amplitude.py @@ -40,6 +40,7 @@ class FineAmplitudeCal(BaseCalibrationExperiment, FineAmplitude): .. jupyter-execute:: :hide-code: + import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) # backend @@ -198,6 +199,7 @@ class FineXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: :hide-code: + import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) # backend @@ -280,6 +282,7 @@ class FineSXAmplitudeCal(FineAmplitudeCal): .. jupyter-execute:: :hide-code: + import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) # backend From 4eec921b0a666136a57fafb1dfb37dcec331b265 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:19:01 +0900 Subject: [PATCH 154/171] update warnings.filterwarnings('ignore', ...) in calibration/fine_drag_cal.py --- qiskit_experiments/library/calibration/fine_drag_cal.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qiskit_experiments/library/calibration/fine_drag_cal.py b/qiskit_experiments/library/calibration/fine_drag_cal.py index cc2556857d..883a69fd66 100644 --- a/qiskit_experiments/library/calibration/fine_drag_cal.py +++ b/qiskit_experiments/library/calibration/fine_drag_cal.py @@ -36,6 +36,9 @@ class FineDragCal(BaseCalibrationExperiment, FineDrag): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + #backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=108) @@ -183,6 +186,9 @@ class FineXDragCal(FineDragCal): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + #backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=118) @@ -245,6 +251,9 @@ class FineSXDragCal(FineDragCal): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + #backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=118) From 0afd1d8327131e22d5e0b34b02614e00e9864d16 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:20:08 +0900 Subject: [PATCH 155/171] update warnings.filterwarnings('ignore', ...) calibration/fine_frequency_cal.py --- qiskit_experiments/library/calibration/fine_frequency_cal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit_experiments/library/calibration/fine_frequency_cal.py b/qiskit_experiments/library/calibration/fine_frequency_cal.py index 65c6a4b10e..ed9652af86 100644 --- a/qiskit_experiments/library/calibration/fine_frequency_cal.py +++ b/qiskit_experiments/library/calibration/fine_frequency_cal.py @@ -34,6 +34,9 @@ class FineFrequencyCal(BaseCalibrationExperiment, FineFrequency): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_ibm_runtime.fake_provider import FakePerth from qiskit_aer import AerSimulator From 9b5389049f207147322a6003a638652ca7eaeeb2 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:21:58 +0900 Subject: [PATCH 156/171] update warnings.filterwarnings('ignore', ...) in calibration/frequency_cal.py --- qiskit_experiments/library/calibration/frequency_cal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit_experiments/library/calibration/frequency_cal.py b/qiskit_experiments/library/calibration/frequency_cal.py index 229d4ce757..8f8bd48848 100644 --- a/qiskit_experiments/library/calibration/frequency_cal.py +++ b/qiskit_experiments/library/calibration/frequency_cal.py @@ -33,6 +33,9 @@ class FrequencyCal(BaseCalibrationExperiment, RamseyXY): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_ibm_runtime.fake_provider import FakePerth from qiskit_aer import AerSimulator From ff2e86d7cf41fac81cf6b87f8828891d82dc3ff7 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:22:48 +0900 Subject: [PATCH 157/171] update warnings.filterwarnings('ignore', ...) in calibration/half_angle_cal.py --- qiskit_experiments/library/calibration/half_angle_cal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index fb31958d75..eddc1eb86b 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -34,6 +34,9 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=199) From 24b14752e463ec0d8d2b55f5397a2203af49c06d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:23:38 +0900 Subject: [PATCH 158/171] update warnings.filterwarnings('ignore', ...) in calibration/rough_amplitude_cal.py --- .../library/calibration/rough_amplitude_cal.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 0db0a71bc6..69b071b056 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -37,6 +37,9 @@ class RoughAmplitudeCal(BaseCalibrationExperiment, Rabi): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=106) @@ -229,6 +232,9 @@ class RoughXSXAmplitudeCal(RoughAmplitudeCal): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=180) @@ -288,6 +294,9 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=180) From cf532b1452ea5875883e847278b0d743d3f28b36 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:24:28 +0900 Subject: [PATCH 159/171] update warnings.filterwarnings('ignore', ...) in calibration/rough_drag_cal.py --- qiskit_experiments/library/calibration/rough_drag_cal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit_experiments/library/calibration/rough_drag_cal.py b/qiskit_experiments/library/calibration/rough_drag_cal.py index 623e521ee8..4628472223 100644 --- a/qiskit_experiments/library/calibration/rough_drag_cal.py +++ b/qiskit_experiments/library/calibration/rough_drag_cal.py @@ -33,6 +33,9 @@ class RoughDragCal(BaseCalibrationExperiment, RoughDrag): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + #backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=161) From fe0c581828650e06a33da900e4a9c39df9bc816b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:25:07 +0900 Subject: [PATCH 160/171] update warnings.filterwarnings('ignore', ...) in calibration/rough_frequency.py --- qiskit_experiments/library/calibration/rough_frequency.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit_experiments/library/calibration/rough_frequency.py b/qiskit_experiments/library/calibration/rough_frequency.py index 04b84b698a..da675df742 100644 --- a/qiskit_experiments/library/calibration/rough_frequency.py +++ b/qiskit_experiments/library/calibration/rough_frequency.py @@ -34,6 +34,9 @@ class RoughFrequencyCal(BaseCalibrationExperiment, QubitSpectroscopy): .. jupyter-execute:: :hide-code: + import warnings + warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=100) From 4aba362edcb826d1ad0c8c8a4bac062e955f8cf1 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:59:13 +0900 Subject: [PATCH 161/171] update warnings.filterwarnings('ignore', ...) in calibration/half_angle_cal.py --- qiskit_experiments/library/calibration/half_angle_cal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index eddc1eb86b..f324f97af7 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -37,6 +37,8 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + warnings.filterwarnings("ignore", ".*entire Qiskit Pulse package is being deprecated.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=False, seed=199) From 51b70fc98f69f1df0f99e99c349d21da3aae6a8c Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:00:27 +0900 Subject: [PATCH 162/171] update warnings.filterwarnings('ignore', ...) in calibration/rough_amplitude_cal.py --- qiskit_experiments/library/calibration/rough_amplitude_cal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index 69b071b056..a170b014da 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -297,6 +297,8 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) + warnings.filterwarnings("ignore", ".*entire Qiskit Pulse package is being deprecated.*", UserWarning) + # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend backend = SingleTransmonTestBackend(5.2e9,-.25e9, 1e9, 0.8e9, 1e4, noise=True, seed=180) From 8c642c441018704046e3c4ae206a1e2919206f4d Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:20:10 +0900 Subject: [PATCH 163/171] update warnings.filterwarnings('ignore', ...) in calibration/rough_amplitude_cal.py --- qiskit_experiments/library/calibration/half_angle_cal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index f324f97af7..5c1149c382 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -37,7 +37,10 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) - warnings.filterwarnings("ignore", ".*entire Qiskit Pulse package is being deprecated.*", UserWarning) + warnings.filterwarnings("ignore", + ".*entire Qiskit Pulse package is being deprecated.*", + UserWarning + ) # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend From 35c0af898dd4e086060bd72e0a605b7498e7c542 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:21:16 +0900 Subject: [PATCH 164/171] update warnings.filterwarnings('ignore', ...) in calibration/rough_amplitude_cal.py --- .../library/calibration/rough_amplitude_cal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index a170b014da..a5b17c3ef1 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -297,7 +297,10 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): import warnings warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) - warnings.filterwarnings("ignore", ".*entire Qiskit Pulse package is being deprecated.*", UserWarning) + warnings.filterwarnings("ignore", + ".*entire Qiskit Pulse package is being deprecated.*", + UserWarning + ) # backend from qiskit_experiments.test.pulse_backend import SingleTransmonTestBackend From c8f2648e9b62099c0839aea7d7747064db61d79f Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:20:02 +0900 Subject: [PATCH 165/171] update warnings.filterwarnings() in HalfAngleCal --- qiskit_experiments/library/calibration/half_angle_cal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/half_angle_cal.py b/qiskit_experiments/library/calibration/half_angle_cal.py index 5c1149c382..b298cb552e 100644 --- a/qiskit_experiments/library/calibration/half_angle_cal.py +++ b/qiskit_experiments/library/calibration/half_angle_cal.py @@ -38,8 +38,8 @@ class HalfAngleCal(BaseCalibrationExperiment, HalfAngle): warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) warnings.filterwarnings("ignore", - ".*entire Qiskit Pulse package is being deprecated.*", - UserWarning + message=".*entire Qiskit Pulse package is being deprecated.*", + category=DeprecationWarning, ) # backend From 3097980579896528b720f704700304f693c644f4 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:21:45 +0900 Subject: [PATCH 166/171] update warnings.filterwarnings() in EFRoughXSXAmplitudeCal --- qiskit_experiments/library/calibration/rough_amplitude_cal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_experiments/library/calibration/rough_amplitude_cal.py b/qiskit_experiments/library/calibration/rough_amplitude_cal.py index a5b17c3ef1..65251c912a 100644 --- a/qiskit_experiments/library/calibration/rough_amplitude_cal.py +++ b/qiskit_experiments/library/calibration/rough_amplitude_cal.py @@ -298,8 +298,8 @@ class EFRoughXSXAmplitudeCal(RoughAmplitudeCal): warnings.filterwarnings("ignore", ".*Could not determine job completion time.*", UserWarning) warnings.filterwarnings("ignore", - ".*entire Qiskit Pulse package is being deprecated.*", - UserWarning + message=".*entire Qiskit Pulse package is being deprecated.*", + category=DeprecationWarning, ) # backend From c982b187ca3e7e461e39ef9a19e22856ccf42b70 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 18 Dec 2024 06:22:02 +0900 Subject: [PATCH 167/171] update a code example in StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index 25be24b7db..a9140c68f3 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -126,8 +126,6 @@ class StandardRB(BaseExperiment, RestlessMixin): print("Gate error ratio: %s" % expdata_2q.experiment.analysis.options.gate_error_ratio) display(expdata_2q.figure(0)) - - print(expdata_2q.analysis_results()[0].name) """ def __init__( From 10f52a0bc5c3467094cb90bdabd2ef5c59af5a17 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 18 Dec 2024 06:23:25 +0900 Subject: [PATCH 168/171] update a code example in InterLeavedRB --- .../randomized_benchmarking/interleaved_rb_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index 8e4c26536f..9cd8590300 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -82,7 +82,8 @@ class InterleavedRB(StandardRB): int_results2 = int_expdata2.analysis_results() display(int_expdata2.figure(0)) - print(int_results2[0].name) + names = {int_results2[i].name for i in range(len(int_results2))} + print(f"Available results: {names}") """ def __init__( From 103d36ac5b3d805523f0eb60657c70cb26756c66 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:23:35 +0900 Subject: [PATCH 169/171] update a code example in InterLeavedRB --- .../randomized_benchmarking/interleaved_rb_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py index 9cd8590300..5da2024973 100644 --- a/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py +++ b/qiskit_experiments/library/randomized_benchmarking/interleaved_rb_experiment.py @@ -82,7 +82,7 @@ class InterleavedRB(StandardRB): int_results2 = int_expdata2.analysis_results() display(int_expdata2.figure(0)) - names = {int_results2[i].name for i in range(len(int_results2))} + names = {result.name for result in int_results2} print(f"Available results: {names}") """ From 9076823c04e24f5e304fdbdc174d69bbf4684336 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:24:15 +0900 Subject: [PATCH 170/171] update a code example in StandardRB --- .../library/randomized_benchmarking/standard_rb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py index a9140c68f3..7c29059960 100644 --- a/qiskit_experiments/library/randomized_benchmarking/standard_rb.py +++ b/qiskit_experiments/library/randomized_benchmarking/standard_rb.py @@ -123,9 +123,13 @@ class StandardRB(BaseExperiment, RestlessMixin): exp_2q.analysis.set_options(epg_1_qubit=expdata_1q.analysis_results()) expdata_2q = exp_2q.run(backend=backend).block_for_results() + results_2q = expdata_2q.analysis_results() print("Gate error ratio: %s" % expdata_2q.experiment.analysis.options.gate_error_ratio) display(expdata_2q.figure(0)) + + names = {result.name for result in results_2q} + print(f"Available results: {names}") """ def __init__( From 6de9abf70915ccfd7b5632258deb6f7c22c20cd2 Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:24:54 +0900 Subject: [PATCH 171/171] update a code example in LayerFidelity --- .../library/randomized_benchmarking/layer_fidelity.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py index 5dddf7ba50..1d274ca550 100644 --- a/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py +++ b/qiskit_experiments/library/randomized_benchmarking/layer_fidelity.py @@ -110,9 +110,13 @@ class LayerFidelity(BaseExperiment, RestlessMixin): ) exp_data = exp.run().block_for_results() + results = exp_data.analysis_results() display(exp_data.figure(0)) # one of 6 figures display(exp_data.analysis_results("EPLG", dataframe=True)) + + names={result.name for result in results} + print(f"Available results: {names}") """ def __init__(