Release Notes¶
0.8.0¶
Prelude¶
In this release we added support for the Qiskit primitives. Qiskit Experiments will execute circuits using qiskit_ibm_runtime.SamplerV2
by default.
Upgrade Notes¶
When only a
backend
is set on an experiment,qiskit_experiments.framework.BaseExperiment.run()
now defaults to wrapping thebackend
in aqiskit_ibm_runtime.SamplerV2
and using that to execute the circuits. A newsampler
argument is also accepted byrun()
to allow for a customqiskit.primitives.BaseSamplerV2
instance to be used for circuit execution.run()
also accepts abackend_run
option which will cause the oldbackend.run
path to be used for circuit execution. However, thebackend.run()
method is scheduled to be removed from qiskit-ibm-runtime in the near future.
Deprecation Notes¶
Experiments involving pulse gate calibrations have been deprecated, due to the upcoming deprecation of Qiskit Pulse in Qiskit 2.0. These experiments include
QubitSpectroscopy
,EFSpectroscopy
,Rabi
,EFRabi
,ResonatorSpectroscopy
,RoughDrag
,StarkRamseyXY
,StarkRamseyXYAmpScan
,StarkP1Spectroscopy
,CrossResonanceHamiltonian
,EchoedCrossResonanceHamiltonian
,RoughFrequencyCal
,RoughEFFrequencyCal
,FrequencyCal
,FineFrequencyCal
,RoughDragCal
,FineXDragCal
,FineSXDragCal
,FineDragCal
,FineAmplitudeCal
,FineXAmplitudeCal
,FineSXAmplitudeCal
,HalfAngleCal
,RoughAmplitudeCal
,RoughXSXAmplitudeCal
, andEFRoughXSXAmplitudeCal
.
Also due to the deprecation of Qiskit Pulse, support for providing pulse gate calibrations to excite higher levels has been deprecated from
MultiStateDiscrimination
.
The
Calibrations
class and all of Qiskit Experiments’ calibration support is deprecated. The calibrations features were based on adjusting parameters of pulses used in gates. With the deprecation of Qiskit Pulse, these features are now also deprecated.
Support for running experiments in restless mode using the
RestlessMixin
is deprecated. With improvements in the reliability of IBM Quantum’s qubit initialization, circuit exectuion has already become reasonably fast and restless measurements do not add much performance improvement. It is expected that the restless features are little used as there has been no recent user feedback about them.
Bug Fixes¶
Qiskit Experiments was updated to be compatible with Qiskit 1.2, including removing references to
QuantumCircuit._parameter_table
which prevented randomized benchmarking and layer fidelity experiments from running.
0.7.0¶
Prelude¶
The Qiskit Experiments 0.7 release adds the Layer Fidelity experiment and makes some fixes and improvements.
New Features¶
Add a new experiment class
LayerFidelity
to measure layer fidelity and EPLG (error per layered gate), which is a holistic benchmark to characterize the full quality of the devices at scale.It has an experimental feature: its
circuits()
exceptionally returns circuits on physical qubits (not virtual qubits as usual). Its analysis classLayerFidelityAnalysis
returnsAnalysisResultData
which contains severalextra
entries to help additional analyses: e.g.qubits
to ease the query of sub-analysis results andreason
to tell users why thequality
of the analysis was"bad"
.For example, the syntax for pulling out the individual fidelities looks like below.
df = exp_data.analysis_results(dataframe=True) df[(df.name=="ProcessFidelity") & (df.qubits==(59, 60))].value
See an example notebook for more examples such as how to select a best possible qubit chain to measure and how to plot EPLG as a function of (sub)chain length.
Added an option to plot residuals for single-figure experiments, which is enable by setting
plot_residuals
toTrue
.
Introduced
sub_plot_heights_list
andsub_plot_widths_list
attributes inPlotStyle
for customizable subplot sizes where each list needs to sum up to 1. This feature currently works only for experiments with no subplots.
Known Issues¶
Fit parameters are not populated in composite curve analysis results and are found only in the fit summary artifact. In a future release, they will be removed from all analysis result objects and live in the artifacts only.
Upgrade Notes¶
Changes in behavior that users should be aware of when upgrading Qiskit Experiments to this version are listed below in subsections by functional area.
Package Upgrades¶
Several deprecated modules, methods, functions, and options have been removed and will no longer work:
The visualization module of
CurveAnalysis
has been replaced by the standalonevisualization
module. TheLegacyCurveCompatDrawer
has been removed fromvisualization
.The
curve_drawer
option toCompositeCurveAnalysis
has been replaced by the plotter in the visualization module.The
SeriesDef
dataclass has been removed and replaced by theLMFIT
module.The
CurveData
dataclass has been removed and replaced byScatterTable
’s DataFrame representation.random_cliffords()
andrandom_clifford_circuits()
have been removed fromCliffordUtils
and replaced byStandardRB.__sample_sequence()
.beta
has been renamed tooutcome_prior
in the tomography utility functionbinomial_weights()
.The
return_data_points
option has been removed from curve analysis. Data points are now automatically provided inExperimentData
objects via thecurve_data
artifact.The default value of
flatten_results
in composite experiments has changed toTrue
.
Deprecation Notes¶
Accessing experiment data artifacts by numerical index has been deprecated. Use the name or ID of the artifact instead.
Bug Fixes¶
Fixed a bug in EPG (error per gate) computation in
RBAnalysis
where it fails with aTypeError
for backends with ECR gate as a 2-qubit basis gate (e.g. IBM Eagle processors). See #1419. for the details of the bug.
The gate counting for EPG in the RB analysis code was not including the inverse, so that the total number of operations per Clifford was incorrect, leading to incorrect reporting of EPG from EPC. Fixed by adding +1 for the inverse gate.
Other Notes¶
Added minimal working code examples to many experiment API pages, especially characterization experiments. The minimal working code example is a code snippet which users can copy and paste to run the experiment. Users are required to specify a backend to use the code example. By default, the backend used in the examples is a simulator such as
FakeManilaV2
.
0.6.1¶
Prelude¶
Qiskit Experiments 0.6.1 is a minor bug fixes release.
Bug Fixes¶
SingleTransmonTestBackend
was updated to be compatible withqiskit_dynamics
version 0.5.0. The updates accounted for changes in the expected arguments to Dynamics API’s and did not change behavior. See #1427.
ExperimentData
was updated so that running analysis a second time withreplace_results=True
does not result in thefigure_names
property having incorrect data (both old and new figure names if the names changed). See #1430.
BaseAnalysis
was updated to respectfigure_names
as a keyword argument to therun()
method. Previously, this argument was ignored andfigure_names
could only be set as an analysis option prior to callingrun()
. See #1430.
MockIQBackend
was refactored so that it does not importqiskit_ibm_runtime
since qiskit-ibm-runtime is not a required dependency of Qiskit Experiments.
Removed a
FakeBackendV2
import path which would have been incompatible with Qiskit 1.1 and above. See #1420.
0.6.0¶
Prelude¶
Qiskit Experiments 0.6 introduces numerous features and improvements. It is
compatible with Qiskit 1.0. Notable changes include: refactoring the analysis
results to a pandas DataFrame
-based
AnalysisResultTable
, the ability to add artifacts of serializable data
to ExperimentData
, and refactoring curve fit data into a new
DataFrame
-based ScatterTable
container that is
stored by default as an artifact in ExperimentData
along with the
summary of fit results. New experiments include StarkP1Spectroscopy
,
StarkRamseyXY
, and StarkRamseyXYAmpScan
.
StandardRB
and InterleavedRB
were significantly improved.
The supported provider for running jobs on IBM backends is now
qiskit-ibm-runtime. Using
qiskit-ibm-provider
is still supported but its use is deprecated.
New Features¶
New features are listed below in subsections by functional area.
New Experiments¶
New experiment
StarkRamseyXY
has been added. This is a variant of theRamseyXY
experiment that characterizes the qubit frequency offset under a Stark tone drive.
New experiment
StarkRamseyXYAmpScan
has been added. This is a variant of theStarkRamseyXY
experiment to estimate the required tone amplitude to cause a particular Stark shift. This experiment scans tone amplitude while fixing the Stark tone length, and fits the result with the dedicated fitterStarkRamseyXYAmpScanAnalysis
.
New experiment
StarkP1Spectroscopy
has been added. This is a variant ofT1
experiment to conduct spectroscopy of qubit relaxation at different qubit frequencies. The spectroscopy data is just visualized with the dedicated analysisStarkP1SpectAnalysis
. A developer may subclass this analysis class to perform custom analysis on the spectroscopy data.
Experiment Library Features¶
Added a new experiment option
clifford_synthesis_method
to RB experiments, e.g.StandardRB
andInterleavedRB
so that users can plug in a custom Clifford synthesis algorithm used for generating RB circuits. Such a plugin should be implemented as aHighLevelSynthesisPlugin
(seeRBDefaultCliffordSynthesis
for example).
Updated
InterleavedRB
so that it only acceptsinterleaved_element
consisting only of instructions supported by the backend of interest.
Experiment Class Features¶
A new method
BaseExperiment.job_info()
has been added that will output the number of jobs the experiment is expected to be split into based on the provided backend. Refer to issue #1247 for more details.
Added
experiment_type
as optional__init__
kwarg inBatchExperiment
andParallelExperiment
.
experiment_type
can now be easily set and retrieved from the experiment object post-construction using theexperiment_type
property and setter.
Analysis Class Features¶
Added a
broadcast
option toCompositeAnalysis
. Whenbroadcast=True
is passed, this option will be applied to child experiment analyses within the class. This means it will iterate through the child analysis classes and apply the given option to each of them.
The
generate_figures
parameter has been added toCompositeAnalysis
to control figure generation. By default,generate_figures
isalways
, meaning figures will always be generated. Ifgenerate_figures
is set toselective
, then only figures for analysis results of bad quality will be generated. Ifgenerate_figures
is set tonever
, then figures will never be generated. This behavior can be overridden for individual analyses by setting the analysis optionplot
forCurveAnalysis
.
Experiment Data Features¶
Figures in
ExperimentData
objects can now be accessed without the.svg
extension.
ExperimentData
has been upgraded to store analysis result data in a table format with the new inline containerAnalysisResultTable
. In this release, theExperimentData.analysis_results()
method still returns a conventional list ofAnalysisResult
for backward compatibility, however, when you call the method with new argumentdataframe=True
it returns analysis results all in one piece with the table format. For example,exp = StandardRB((0,), lengths, backend) experiment_data = exp.run().block_for_results() experiment_data.analysis_results(dataframe=True, columns="default")
Information contained in the returned table can be filtered with
columns
argument, which may take eitherall
,default
,minimal
, or list of column names. Returning a list ofAnalysisResult
will be deprecated in a future release along with thedataframe
option.Related to this update,
ExperimentData.add_analysis_results()
method now takes keyword arguments keyed on the table column names, in addition to the argument ofresults
which is eitherAnalysisResult
or a list of it. This allows users and developers to bypass creation ofAnalysisResult
instance for registering new entry in theExperimentData
instance.Note that the conventional
AnalysisResult
is originally a payload object for saving an analysis result in a remote database, as it implements a REST API for the IBM Experiment Service, which is not necessary at all in the context of experiment data analysis. In a future release,AnalysisResult
will be hidden from Qiskit Experiments users.
An artifact class has been introduced to store long-form data generated by experiments. The
CurveFitResult
andScatterTable
generated by experiments are now stored in artifacts in theExperimentData
class.add_artifacts()
anddelete_artifact()
have been added to manipulate the artifacts. These will be uploaded to the cloud service in JSON form along with the rest of theExperimentData
object when saved. For more information, see the artifacts how-to.
ExperimentData.save()
now uses the multithreading capability of the experiment service to enable faster saving times.
ExperimentData
now supports the new methodExperimentData.get_service_from_provider()
enabling the automatic setting of the experiment database service via passing the provider.
The
start_datetime
property ofExperimentData
is now being set to the time the experiment data was created.
The
end_datetime
property ofExperimentData
is now being set to the latest time a successful job terminated.
The
creation_datetime
andupdated_datetime
properties ofExperimentData
are now being read from the server when saving the experiment.
All the datetime properties are now stored in UTC and converted to local time when using getters.
ExperimentData.save()
can now raise exceptions when saving fails, unless thesuppress_errors
flag is set (on by default).
Experiments run via the qiskit-ibm-runtime provider can now be saved to and loaded from the cloud service.
Curve Fit Features¶
ScatterTable
has been introduced as a drop-in replacement ofCurveData
.This is a data format to store intermediate data in curve analysis built on top of the pandas
DataFrame
. Each table row corresponds to a single data point, and the table contains all data points generated by theCurveAnalysis
. All properties and methods ofCurveData
are implemented for backward compatibility, but these will be removed in the future release.
New analysis option
fit_category
is added toCurveAnalysis
subclasses. This option controls which data subset within theScatterTable
is used for the curve fitting.
Calibration Features¶
A JSON data format has been added for saving a
Calibrations
instance. This leverages a custom JSON encoder and decoder to serialize the entire calibration data including user provided schedule templates. Output JSON data is formatted into the standard data model which is intentionally agnostic to the calibration data structure.
Visualization Features¶
The
MplDrawer
visualization backend has been upgraded so that it can take list of options forxlim
,ylim
,xval_unit
,yval_unit
,xval_unit_scale
, andyval_unit_scale
. New figure optionssharex
andsharey
are also added. The new options are used to unkink the configuration of sub axes, and default toTrue
for backward compatibility. By disabling these options, an experiment author can write an analysis class that generates a multi-axes figure with different plot ranges.
An
hline()
method was added toBaseDrawer
for generating horizontal lines. See #1348.
The
QuantumVolumeAnalysis
analysis class was updated to useQuantumVolumePlotter
for its figure generation. The appearance of the figure should be the same as in previous releases, but now it is easier to customize the figure by setting options on the plotter object. See #1348.
New figure options were added to the visualization module:
xscale
andyscale
. They represent parameters to the Matplotlib functionsset_xscale
andset_yscale
:log
,linear
,symlog
,logit
, andquadratic
(the latter is an additional support for quadratic scaling).
Known Issues¶
Copied
ExperimentData
objects don’t save their analysis results to the cloud service. See #1396.
Upgrade Notes¶
Changes in behavior that users should be aware of when upgrading Qiskit Experiments to this version are listed below in subsections by functional area.
Package Upgrades¶
Several deprecated methods and options have been removed and will no longer work:
Passing the
qubits
keyword argument or an integer qubit index to experiments is no longer allowed. Usephysical_qubits
keyword argument with a sequence type input.The
scipy_linear_lstsq
andscipy_gaussian_lstsq
fitters for theStateTomographyAnalysis
andProcessTomographyAnalysis
classes have been removed. Use thecvxpy_linear_lstsq()
andcvxpy_gaussian_lstsq()
fitters instead.Curve fit solvers
curve_fit()
andmulti_curve_fit()
as well as fit functionsbloch_oscillation_x()
,bloch_oscillation_y()
, andbloch_oscillation_z()
have been removed. Use the LMFIT library instead.The
flat_top_widths
argument and experiment option of theCrossResonanceHamiltonian
experiment and its subclass have been removed. Usedurations
instead.The
DumpedOscillationAnalysis
class has been renamed toDampedOscillationAnalysis
.
Dropped support for Python 3.7 and added support for Python 3.12.
The dependency on
qiskit-terra
was replaced with a dependency onqiskit
. This change follows the move in upstream Qiskit to renameqiskit-terra
toqiskit
. The minimum required version was increased from 0.24 forqiskit-terra
to 0.45 forqiskit
. For more information on the renaming of Qiskit, see the Qiskit repository renaming plan and the Qiskit 1.0 migration guide.
With the impending deprecation of the
qiskit-ibm-provider
package, support forqiskit-ibm-provider
is now deprecated and will be removed in the next release. Users should migrate to qiskit-ibm-runtime following the runtime migration guide. qiskit-ibm-runtime is not listed as a dependency for compatibility reasons, but users will need it to run experiments on IBM backends.
Experiment Library Upgrades¶
HalfAngleCal
was changed from updating the complex amplitude of the pulse, to updating the angle in the (amp
,angle
) representation. When used with theFixedFrequencyTransmon
library, it will continue to work seamlessly in the new representation. However, when the experiment is used with custom built pulses, which rely on the old convention of complexamp
(with no angle parameter) - the experiment will fail. Most reasonable cases will raise a detailedCalibrationError
explaining the change and the way to adjust to it. Some edge cases - like a custom built pulse with anangle
parameter which doesn’t conform to the naming convention of Qiskit’sScalableSymbolicPulse
class, or using a loaded calibration withcomplex
amp
- will result in updating the wrong parameter.
Experiment Class Upgrades¶
Removed unnecessary circuit metadata from the builtin experiment classes. Circuit metadata such as the associated qubit indices and experiment type are separately stored in the experiment metadata, and never used in the analysis. Removal of unnecessary circuit metadata compresses the job payload and thus is expected to benefit scalability.
Curve Fit Upgrades¶
The behavior of
CurveAnalysis
data processing was changed. It used to raiseDataProcessorError
error when it encounters an experiment result which cannot be classified into any fit model, but this restriction was relaxed and the analysis continues with unclassified data. Unclassified data is just stored as-is in theScatterTable
with the null class ID assigned. Such data is ignored in the rest of analysis steps such as formatting, fitting, and visualization.
Calibration Upgrades¶
The representation of pulses in the
FixedFrequencyTransmon
library was changed from complex amplitude to (amp
,angle
) representation. All pulses now include anangle
parameter, and the default values ofamp
are set as typefloat
instead ofcomplex
.
The variables
__drive_freq_parameter__
and__readout_freq_parameter__
have been removed fromCalibrations
. These variables were given special treatment which is inconsistent with the framework. To replace them a mechanism to define and add parameters without a schedule has been added to the basis gate library. This has the added benefit of making the API of frequency calibration experiments more consistent with the other calibration experiments. Calibration developers can now add parameters to their library that are not attached to a schedule in a meaningful way.
Deprecation Notes¶
Executing composite experiment and composite analysis with
flatten_results=False
by default was deprecated. To create child experiment data, please explicitly setflatten_results=False
. The default value offlatten_results
will be changed toTrue
in the next release.
BackendData.is_simulator
has been deprecated.BackendV2
does not provide a standard interface for determining if a backend uses a simulator. Calling code must determine if a backend uses a simulator through some other means. Qiskit Experiments does not treat simulator-backed backends differently from hardware backed ones.
Setting the option
return_data_points
toTrue
in curve analysis has been deprecated. Data points are now automatically provided inExperimentData
objects via thecurve_data
artifact.
Direct access to the curve fit summary in
ExperimentData
has moved fromanalysis_results()
toartifacts()
, where values are stored in thedata
attribute ofArtifactData
objects. For example, to access the chi-squared of the fit,expdata.analysis_results(0).chisq
is deprecated in favor ofexpdata.artifacts("fit_summary").data.chisq
. In a future release, the curve fit summary will be removed fromanalysis_results()
and the optionreturn_fit_parameters
will be removed. For more information on artifacts, see the artifacts how-to.
Using numerical indices with
ExperimentData.analysis_results()
, including both integers and slices, is now deprecated. Access analysis results by analysis result name or ID instead.
Saving
Calibrations
instance into CSV file was deprecated. This only provides serialization for limited set of calibration data, and loading from the local file is not supported.
Calibrations.schedule_information()
was deprecated. This method returns attached calibration templates in the string format, but this cannot be converted back to the original Qiskit representation. Now better serialization is provided withCalibrations.save()
with JSON mode and it internally dumps these schedule in through QPY format.
Calibrations.load_parameter_values()
was deprecated. Since savingCalibrations
instance into the CSV format was deprecated, the required data file to invoke this method will be no longer generated in future calibrations instance. Full calibration instance roundtrip is now supported with the save and load method.
Calibrations.config()
andCalibrations.from_config()
were deprecated. Now canonical data representation is generated for calibration by the newly introducedsave_utils
module, and the legacy configuration dictionary is no longer used for JSON encoding.
Bug Fixes¶
Bug fixes are listed below in subsections by functional area.
Experiment Library Fixes¶
Fixed a bug in
rb_decay()
where it unintentionally raises anIndexError
if ally
values are belowb
value so that it returns0
for the case.
The
HalfAngle
experiment’s circuits were changed so that they use combinations ofrz
andx
instead of the less standardy
gate. This change allowsHalfAngle
to be run on IBM backends directly. Previously, it could only be run through theHalfAngleCal
subclass in combination with aCalibrations
instance containing a custom calibration for they
gate. Fixes issue #1233.
Fixed a bug in circuit generation for three or more qubit Randomized Benchmarking where sampled Cliffords may be changed during their circuits synthesis (in the worst case, the resulting circuits may use qubits not in
physical_qubits
). See issue #1279 for additional details.
Resolved a serialization issue that affected Rabi experiments when running it through the backend provider using custom amplitudes provided as a numpy array.
Resolved an issue that caused QV experiments to fail when executed via the backend provider using Qiskit for calculating ideal probabilities instead of Aer.
Resolved a serialization issue that affected DRAG experiments with integral beta values specified.
Experiment Data Fixes¶
The
ExperimentData.copy()
method now copies the provider.
Fixed
pickle
deserialization ofExperimentData
objects. Previously,ExperimentData
objects could be serialized and deserialized using Python’spickle
module, but deserialized objects were not completely restored and an exception would be raised when doing some operations like running analysis on the restored object. See #1326.
Fixed a bug in
ExperimentData._add_job_data()
that caused job id related test fails.
Fixed a bug in
ExperimentData
which caused experiment saves to the cloud service to fail when the metadata is large.
The
ExperimentData.auto_save
setter no longer saves sub-experiments twice.
ExperimentData.save()
now handles correctly figures in sub-experiments whenflatten_results=True
.
Visualization Fixes¶
Figures loaded from the experiment service are now rendered correctly in Jupyter Notebook.
Other Notes¶
Display a warning when running an analysis on
ExperimentData
objects which do not contain data.
Qiskit 0.23.0 began phasing out support of complex parameters in the Pulse module. Mainly, all library symbolic pulses were converted from complex amplitude representation to a duo of real (float) parameters (
amp
,angle
). To avoid problems, Qiskit Experiments adopted this convention.Changes were made to
FixedFrequencyTransmon
andHalfAngleCal
(see upgrade section). With the exception ofHalfAngleCal
, all library experiments should continue to function as they did before (even with complexamp
). When used with theFixedFrequencyTransmon
library,HalfAngleCal
will also continue working as before.Eventually, support for complex parameters will be dropped altogether, and it is thus pending deprecation - including for saving and loading calibration data with complex values.
A new set of optional dependencies have been split off from the developer dependencies and can be installed separately as
qiskit-experiments[extras]
. These are packages that enable optional experiment features such asscikit-learn
-based discriminators. Qiskit Dynamics and Qiskit Aer have also been marked as optional in this manner.
Figure names have been updated to include qubit indices up to the first five device components in the experiment, with format
StandardRB_Q0_Q1_Q2_Q3_Q5_b4f1d8ad.svg
. For composite experiments whereflatten_results
is set toTrue
, the head of the figure name is now the class name of the experiment instead ofParallelExperiment
orBatchExperiment
, such that the figure name is the same whenflatten_results
isFalse
. The behavior when a figure name is repeated andoverwrite
isFalse
has changed from throwing an exception to appending a numerical suffix to the figure name likeStandardRB_Q0_Q1_Q2_Q3_Q5_b4f1d8ad-1.svg
.
Figure metadata now includes
experiment_type
anddevice_components
.
0.5.4¶
Prelude¶
Qiskit Experiments 0.5.4 is a minor improvement and fixes release.
Bug Fixes¶
Fixed calculation of weight for curve fitting. Previously the weights of data points to obtain the residual of fit curve were computed by the inverse of the error bars of y data. This may yield significant weights on certain data points when their error bar is small or zero, and this can cause the local overfit to these data points. To avoid this edge case of small error bars, computed weights are now clipped at 90 percentile. This update might slightly change the outcome of fit.
Changed
StandardRB
to treat two qubit operations in theqiskit.transpiler.Target
as having all-to-all connectivity if there is no set of specific pairs of coupled qubits. Most importantly, this change allowsStandardRB
to work withqiskit_aer.AerSimulator
for multi-qubit benchmarking afterqiskit-aer
0.13.0. Version 0.13.0 ofqiskit-aer
changed the defaultqiskit_aer.AerSimulator
to have such aqiskit.transpiler.Target
without specific coupled pairs. See #1292.
Other Notes¶
Removed the reset instruction from the beginning of tomography experiments. Since qubits are usually reset between circuits, this change should have no impact on tomography experiments, but it should allow backends that do not provide a reset instruction to run tomography experiments. See #1250.
0.5.3¶
Prelude¶
Qiskit Experiments 0.5.3 is a minor improvement and fixes release.
New Features¶
A new experiment option
circuit_order
was added toInterleavedRB
. It allows to change the order of the reference and the interleaved circuits and hence slightly alter the impact of noise on interleaved RB results. The default value is set to"RIRIRI"
that alternate a reference and an interleaved circuit.
Bug Fixes¶
Changed the ordering of circuits generated by
InterleavedRB
back to RIRIRI (R: Reference, I: Interleaved) order. It was accidentally changed into RRRIII order in #898. Before that, it had been RIRIRI order.
0.5.2¶
Prelude¶
Qiskit Experiments 0.5.2 is a minor bug fix and performance improvement release.
New Features¶
A new method
qiskit_experiments.calibration_management.Calibrations.has_template()
has been added toCalibrations
to check if a template schedule exists for a particular set of qubits.
Bug Fixes¶
FineXDragCal
andEFRoughXSXAmplitudeCal
were updated to attachsx
andx
calibrations to their circuits, respectively. Previously, they only attached thex
andx12
calibrations that they were calibrating. See issue #1158.
Other Notes¶
The performance of experiment analysis for parallel experiments has been improved significantly due to improved results marginalization. See PR #1144 for more details.
0.5.1¶
Prelude¶
Qiskit Experiments 0.5.1 is a minor bug fix release.
Bug Fixes¶
Added a missing
backend
parameter toRoughEFFrequencyCal
and exposed it in the experiment library.
Fixed error generating circuits for
BaseCalibrationExperiment
subclasses when the backend instance had no coupling map. Fixed #1116.
Fixed a deprecated Matplotlib
MarkerStyle
usage in the visualization module that was causing warnings in Matplotlib 3.6+.
0.5.0¶
Prelude¶
The Qiskit Experiments 0.5 release brings various improvements and bug fixes. Notable changes include the visualization module for drawing figures, which replaces the previous plotting functionality. The speed of randomized benchmarking experiments has been significantly improved. The qubit
and qubits
input to experiments has been regularized to physical_qubits
, and support for qiskit-ibmq-provider
has been deprecated in favor of qiskit-ibm-provider
. New experiments added include MultiStateDiscrimination
, ZZRamsey
, MitigatedStateTomography
, and MitigatedProcessTomography
, along with significant improvements to other tomography experiments. The documentation has been significantly refactored and introductory tutorials have been added.
New Features¶
Added new class
T1KerneledAnalysis
. This class is used for theT1
experiment with the optionmeas_level=MeasLevel.KERNELED
. The analysis normalizes the data and fixes its orientation.
Added a new visualization module to plot figures and draw onto figure canvases. The new module contains plotters and drawers, which integrate with
CurveAnalysis
but can be used independently of the analysis classes. This module replaces the old and now deprecatedqiskit_experiments.curve_analysis.visualization
submodule.
Added a new IQ plotting class
IQPlotter
for plotting IQ/level-1 data (individual shots and their average) and a discriminator that classifies the data into states.
Added a new
image()
method toBaseDrawer
andMplDrawer
to plot two-dimensional images on a figure canvas.
Introduced a new class
qiskit_experiments.framework.BackendTiming
, which provides helper methods for rounding pulse and delay times to values compatible with a backend’s timing constraints.
New
BaseCurveAnalysis
optionaverage_method
has been added. This option modifies an averaging technique for y values over the same x values. It defaults tosample
for the RB experiments andshots_weighted
for the rest of analysis. Previously the setup was hardcoded in the_format_data
method of the analysis class, and no statistical difference has been introduced with introduction of this option.
A new basis gate library called
EchoedCrossResonance
has been added.
Added a new
initial_circuit
option toResonatorSpectroscopy
for appending before measurements. This can be used to run resonator spectroscopy with different qubit states.
Added a new experiment
MultiStateDiscrimination
for classifying IQ clusters of multi-level energy states.
Added a new sklearn discriminator class
SkQDA
.
Added pulse simulator backends
PulseBackend
and subclassSingleTransmonTestBackend
that use Qiskit Dynamics to simulate pulse schedules included in the calibrations attached to transpiled quantum circuits. The backend is capable of simulating level one (IQ) and level two (counts) data. The main purpose of this backend is to make the test suite more realistic and allow for tutorials that do not require hardware backends.
qiskit-experiments has been marked as compatible with Python 3.11 in the package metadata. qiskit-experiments currently tests against Python 3.7, 3.8, 3.9, 3.10, and 3.11.
The algorithm to estimate fit parameter guesses in
RamseyXYAnalysis
has been upgraded. The previous algorithm was not robust to experiment outcomes with low frequency, where Ramsey X and Y curves almost remain at P=1.0 and 0.5, respectively. The new algorithm also offers reliable initial guesses for such situations. In addition, the number of frequency guesses has been increased to cover the uncertainty of FFT.
Added a
backend
init kwarg to theLocalReadoutError
andCorrelatedReadoutError
experiments, and thephysical_qubits
kwarg has been made optional. If a backend is supplied without specifying physical qubits, the experiment will be initialized on all qubits for the backend.
Added a new experiment option for batch experiments called
separate_jobs
. If set toTrue
, then circuits of different sub-experiments will be routed to different jobs. Default value isFalse
.
Added a
max_circuits
experiment option toBaseExperiment
to allow specifying the max number of circuits per job when running an experiment. If set toNone
(default), the max circuits per job is determined by the backend. If both the option value and backend value are notNone
, the miniminum of the two values will be used for job splitting.
Added
backend
,analysis
, andtarget
init kwargs to theStateTomography
andProcessTomography
experiments. These allow specifying the intended backend, a custom analysis class, or a custom target for fidelity calculations when initializing the experiments.
Improved
LocalMeasurementBasis
andLocalPreparationBasis
tomography basis classes support for initializing a noisy basis for performing state preparation and measurement error mitigatedStateTomography
andProcessTomography
experiments.For preparation bases, a noisy reset operation on a specific qubit, or subset of qubits, can now be input as a quantum channel, and the noisy prepared states are generated by applying the ideal instructions to the noisy initial state.
For measurement bases, a noisy POVM or quantum channel can be supplied for the 0-index basis (typically the Z-basis), and other bases index POVMs will be generated by applying the ideal inverse instructions to the noisy POVMS.
Added an optional
mitigator
kwarg toPauliMeasurementBasis
which can be used to initialize the basis with aLocalReadoutMitigator
to construct a readout error mitigated basis for use withStateTomography
andProcessTomography
experiments.The
LocalReadoutError
experiment can be run to obtain theLocalReadoutMitigator
from its analysis results.
Added readout error mitigated tomography experiments
MitigatedStateTomography
andMitigatedProcessTomography
. These are both implemented as aBatchExperiment
consisting of aLocalReadoutError
characterization experiment followed by either aStateTomography
orProcessTomography
experiment.
Added support for conditional tomographic reconstruction to the
StateTomography
andProcessTomography
experiments.There are three types of conditioning that can be used independently or together in any combination for reconstruction of a state or channel as a list of components conditional on these values.
The
conditional_circuit_clbits
init option can be used to specify any subset of clbits in an tomography circuit containing clbits to be conditioned on when peforming the tomographic reconstruction. The conditioning outcome value of the clbits is stored in the analysis resultsextra
field.The
conditional_measurement_indices
analysis option can be used to condition on the measurement basis index and outcome value of a specific subset of tomographic basis measurements. The conditioning basis index and outcome value are both stored in the analysis resultsextra
field.The
conditional_preparation_indices
analysis option can be used to condition on the preparation basis index of a specific subset of tomographic basis preprations. The conditioning basis index is stored in the analysis resultsextra
field.
Adds an option to
StateTomographyAnalysis
andProcessTomographyAnalysis
to bootstrap error bars on state and process fidelity analysis results. This can be activated by setting thetarget_bootstrap_samples
analysis option to a value.Note that bootstrapping involves re-running the full tomography fit on re-samples of tomography outcome data for each measurement basis and hence the total analysis time will increase linearly with the number of bootstrap samples.
The
CrossResonanceHamiltonian
experiment and its subclass now acceptdurations
with default values. Note that values should be provided in units of seconds rather than samples, and must include pulse ramps at edges. Default values with linear increment are generated according to new experiment options,min_duration
,max_duration
, andnum_durations
, when the durations are not explicitly provided. The default values are chosen by assuming a ZX rate of around 1 MHz which is typical for IBM Quantum backends. User can update these option values as well as provide fulldurations
to tailor experiment settings to their device. Total durations should be carefully chosen not to overflow the waveform memory when the experiment is run on a real hardware. With this update, the minimum example code to run this experiment might befrom qiskit_experiments.library.characterization import CrossResonanceHamiltonian expr = CrossResonanceHamiltonian(qubits=(0, 1), amp=0.3, backend=backend) exp_data = expr.run()
where the durations to scan are implicitly set by experiment options.
A new experiment
ZZRamsey
has been added to measure the ZZ coefficient between a pair of qubits.
Known Issues¶
The
PulseBackend
only supports single qubit operations and will be upgraded in the future.
Upgrade Notes¶
Several deprecated methods and options have been removed and will no longer work:
BaseExperiment.analysis_options
has been removed.experiment.analysis.options
should be used instead.The
__analysis_class__
attribute ofBaseAnalysis
has been removed. Use theanalysis
kwarg ofBaseExperiment.__init__
to specify a default analysis class.The
component_experiment_data()
method has been removed fromExperimentData
and replaced byExperimentData.child_data()
.The
CompositeExperiment.component_analysis
method has been removed. Component analysis classes should be directly accessed usingCompositeAnalysis.component_analysis()
.The
library
argument toCalibrations
has been removed and replaced bylibraries
.The class attribute
CurveAnalysis.__fixed_parameters__
has been removed. Thefixed_parameters
analysis option should be set instead.The method
CurveAnalysis._data()
has been removed.The
CurveAnalysis
attribute__series__
has been removed and is replaced by the constructor argument.The
FineDragAnalysis
,FineFrequencyAnalysis
, andFineHalfAngleAnalysis
analysis classes have been removed and replaced byErrorAmplificationAnalysis
.Randomized benchmarking utility functions
get_error_dict_from_backend()
,count_ops()
,gates_per_clifford()
,calculate_1q_epg()
, andcalculate_2q_epg()
have been removed fromRBUtils
and replaced by methods in the RB experiment and analysis themselves.The
error_dict
analysis option ofRBAnalysis
has been removed and merged into the analysis optiongate_error_ratio
.
Transpilation in the calibration experiments has been upgraded. Calibration experiments define a carefully chosen set of gates and pulses that the transpiler should not modify. If these gates are modified by transpilation the results may be unusable.
BaseCalibrationExperiment
now defines its own transpilation to ensure a proper execution of the experiments. Transpile options are no longer needed for calibration experiments.
The default transpile option value of
optimization_level
for RB experiments (StandardRB
andInterleavedRB
) was changed from0
to1
in order to reduce the number of gates in transpiled circuit and hence circuit generation/excution time and circuit sample variance in P(0) value. This is not an API change but, after this change, you will observe slower decay curves than before if you use the default configuration. And if you want to reproduce the results you obtained before this change, you may need to setoptimization_level=0
withset_transpile_options()
.
qiskit-ibmq-provider
is deprecated and has been dropped as a requirement. Interactions with IBM backends should use theqiskit-ibm-provider
package instead (must be installed separately; see the migration guide for more details).
The
qiskit_experiments.test.t2hahn_backend.T2HahnBackend
was refactored to use the simulator from qiskit-aer which provides better performance. As part of the refactoring, support was removed for passing qubit parameters (e.g.t2hahn
,frequency
,initialization_error
, etc.) as single element lists when the backend has more than one qubit. These arguments need to be passed as numbers that apply to all qubits or sequences of numbers with one entry for each qubit. If passing numbers for a backend to represent more than one qubit, at least one parameter must be passed as a sequence or thenum_qubits
parameter must be passed to indicate how many qubits the backend should simulate. Additionally, passingNone
for these arguments was deprecated. The value that makes that option have no effect should be used instead (for example,0.0
forinitialization_error
).
Renamed the
qubits
,measurement_qubits
, andpreparation_qubits
init kwargs ofStateTomography
,ProcessTomography
, andTomographyExperiment
tophysical_qubits
,measurement_indices
andpreparation_indices
respectively. This is to make the intended use of these kwargs more clear as the measurement and preparation args refer to the index of circuit qubits in the physical qubits list, not the physical qubit values themselves.
The automatic overriding of the default CVXPY SDP solver for the
cvxpy_gaussian_lstsq()
andcvxpy_linear_lstsq()
has been disabled and will now use the default SDP solver of CVXPY unless a custom solver is set using thefitter_options
analysis options.
The
weights
kwarg of thecvxpy_linear_lstsq()
andscipy_linear_lstsq()
tomography fitters has been changed to accept a weights array the same shape as the suppliedoutcome_data
array.
The
Tphi
has been changed to useT2Hahn
as the default T2 estimate because it provides a more meaningful measurement on superconducting devices. An optiont2type
has been added to allow the user to toggle between using \(T_2^*\) fromT2Ramsey
by specifying “ramsey” or \(T_2\) fromT2Hahn
, which is the default value “hahn”.
Deprecation Notes¶
Deprecated the
qiskit_experiments.curve_analysis.visualization
submodule and replaced it with the newqiskit_experiments.visualization
submodule.
Providing
data_sort_key
directly to the LMFIT model to instantiateCurveAnalysis
has been deprecated. This option is not officially supported by the LMFIT, and thus curve analysis cannot guarantee this option is properly managed in all LMFIT model subclasses.
MockIQRabiHelper
is now deprecated and should be replaced withSingleTransmonTestBackend
.
Experiment constructor arguments
qubit
andqubits
have been renamedphysical_qubits
. For thequbit
case, the argument type has changed from an integer to a sequence with a single integer. For example,FineXAmplitude(0)
becomesFineXAmplitude([0])
.
The
qubits
,measurement_qubits
, andpreparation_qubits
init kwargs ofStateTomography
,ProcessTomography
, andTomographyExperiment
have been deprecated. They have been replaced with kwargsphysical_qubits
,measurement_indices
andpreparation_indices
respectively. The renamed kwargs have the same functionality as the deprecated kwargs.
The
flat_top_widths
argument and experiment option ofCrossResonanceHamiltonian
experiment and its subclass have been deprecated and will be removed in Qiskit Experiments 0.6.
Two helper methods
CliffordUtils.random_cliffords()
andCliffordUtils.random_clifford_circuits()
have been deprecated. Their functionality are now incorporated intoStandardRB.__sample_sequence()
.
Bug Fixes¶
Fixed a bug where old analysis results were saved in the case of a failed analysis. Now analysis results will be cleared before running
_run_analysis()
. As a result, when analysis fails, an empty analysis result will be saved to the database service.
Updated querying of
Backend
metadata to support the look up of qubit T1 and measurement drive frequency, in order to supportBackendV2
backends. The look up of the latter isqiskit-ibm-provider
specific. This change fixed errors failing to find these properties when usingResonatorSpectroscopy
(issue #1099) and when using restless measurements withBackendV2
backends.
Fixed a bug where redoing
DragCalAnalysis.run()
generated wrong fit models.
Fixed a bug where
CurveAnalysis
tests would fail with matplotlib 3.6.0 owing to a deprecated function call used inMplCurveDrawer
. The newMplCurveDrawer
no longer uses the deprecated function.
Fixed a bug where
Calibrations
was not updated when calibration experiments were run through the composite experiment framework.
Fixed a bug in the
LocalReadoutError
experiment where analysis would fail when run on an ideal simulator with no readout error. See Issue #992 for additional details.
The importing of
scikit-learn
was moved from module-level imports inside oftry
blocks to dynamic imports at first usage of thescikit-learn
specific feature. This change should avoid errors in the installation ofscikit-learn
from preventing a user using features ofqiskit-experiments
that do not requirescikit-learn
. See #1050.
Fixed
BackendData.coupling_map()
andBackendData.drive_freqs()
raising exceptions when the underlying backend hasNone
for its coupling and qubit property entries. Also, changedBackendData.control_channel()
to return an empty list rather thanNone
when there is no control channel data. See #1035.
Fixed qpy serialization and deserialization of tomography experiments. The barrier instructions in tomography experiments were created with the wrong Python type which qpy did not support. This issue was most acute when using
qiskit-ibm-provider
which submits circuits to the provider using qpy. There could have been subtler issues with circuit timing using a different provider if the barriers were not separating important circuit instructions. See #1060.
Fixed bug in
StateTomography
andProcessTomography
experiments where if the input circuit contained conditional instructions with multiple classical registers the tomography measurement circuits would contain incorrect conditionals due to a bug in theqiskit.circuit.QuantumCircuit.compose()
method.See Issue #942 for additional details.
A
RuntimeWarning
will no longer be generated bynumpy
when running a data processor on level one data. See #1071.
Fixed a bug where the
EchoedCrossResonanceHamiltonian
experiment overestimated Hamiltonian coefficients by a factor of 2.
Other Notes¶
The package documentation has been updated with introductory tutorials and how-tos for solving specific problems. It is now refactored into four sections: learning tutorials, how-to guides, experiment manuals, and the API references.
The internal curve analysis helper functions in
curve_analysis.data_processing
have been moved tocurve_analysis.utils
.
The
Calibrations
class has been updated to use the reference mechanism in Qiskit Pulse in which a schedule can refer to another schedule only by name.
An analysis option
reps
inDragCalAnalysis
was dropped. Now analysis is bootstrapped with circuit metadata and setting this value no longer impacts the analysis result. This upgrade doesn’t introduce any breaking API change for existing experiments.
Improved the performance of circuit generation in 1Q/2Q randomized benchmarking experiments (about 10x speedup). That is mainly achieved by the following two updates in their implementation:
Custom transpilation of circuits (mapping circuits to physical qubits without using transpile),
Integer-based Clifford operations (especially sparse lookup table with triplet decomposition for 2Q Clifford circuits).
NumPy runtime warning for zero division has been suppressed in
CurveAnalysis
. This warning could occur in the edge case where the experiment data may contain data point with zero uncertainty. Such data point is safely ignored by LMFIT, since it may apply infinite fit weight. This runtime warning suppression makes standard error cleaner.
CliffordUtils.clifford_2_qubit()
(andCliffordUtils.clifford_2_qubit_circuit()
) changed its mapping between integers and 2Q Cliffords. As a consequence, circuits sampled by 2Q RB experiments may have been changed, even if exactly the same arguments are used for their construction.
Removed unnecessary
Barrier
instructions in front of circuits generated byStandardRB
andInterleavedRB
.
0.4.0¶
Prelude¶
The Qiskit Experiments 0.4 release includes major improvements to the CurveAnalysis
class and other bug fixes and improvements. The database service has switched to the qiskit-ibm-experiment provider. Several new data processing nodes have been added.
New Features¶
Added a new class,
BackendData
, which provides a common access inferface for bothBackendV1
andBackendV2
data fields, since those classes do not share the same interface. TheBackendData
can be called on a backend and used immediately, and it is also automatically stored as the_backend_data
field ofBaseExperiment
. Note that not all data fields are currently accessible viaBackendData
; to access additional fields, the corresponding method should be added toBackendData
with correct treatment for both V1 and V2 backends.
The
CurveAnalysis
class has been modified to delegate the core fitting functionality to the LMFIT package. Fit curves are specified using LMFIT Model objects. For multi-curve fitting a list of models can be used.A new analysis option
fit_method
has been added to allow a user to select the fitting algorithm used by the LMFIT minimizer. The default fit method is"least_squares"
. Analysis class author can flexibly define new analysis instance with LMFITModel
objects. See LMFIT documentation for user guide.
New curve analysis baseclass
CompositeCurveAnalysis
has been added. This curve analysis variant offers a framework to fit experiment outcomes with different independent fit models. For example, if you define an experiment scanning a parameter with different conditions, e.g. with different control qubit states in some two-qubit gate experiment, the composite curve analysis can implement the experiment with simpler code compared with writing a conventional batch experment. See class documentation for more details.
New options
filter_data
has been added toCurveAnalysis
and its subclass. This dictionary provides a set of required metadata so that the analysis can filter experiment results input to the fitter. Curve analysis checks experiment result metadata, originating in the experiment circuit metadata, and the measure outcomes with matched metadata are only used for the fitting.
New options have been added to the
CurveAnalysis
curve drawer.
The
figure_title
option has been added. This allows user to show an arbitrary string in the output figure title. See the example code below to learn how to set the option.exp = MyExperiment(...) exp.analysis.drawer.set_options(figure_title="Qubit0")
plot_options
has been added. This was conventionally included in theSeriesDef
dataclass, which was static and not configurable. Now end-user can update visual representation of curves through this option. This option is a dictionary that defines three properties, for example,exp = MyExperiment(...) exp.analysis.drawer.set_options( plot_options={ "curve1": {"color": "r", "symbol": "o", "canvas": 0}, "curve2": {"color": "b", "symbol": "x", "canvas": 1}, } )
The dictionary is keyed on the curve name that should match with the
name
property of the LMFIT models provided to the curve analysis.color
andsymbol
are the color and marker of the curves and the scatter plots, respectively.canvas
specifies the sub-axis index, which is available when multi-axis plot is enabled.
A new data processing node
DiscriminatorNode
is added. This node wraps a pre-trained discriminator so that discrimination can be built into the data processing chain. The discriminator node is initialialized from a discriminator or list thereof which are objects that must have a predict methodpredict(x) -> y
as is common in SKlearn. Here,x
is a list of IQ points andy
are the labels assigned to each point.
A new data processing node
RestlessToIQ
is added to process restless level one data, i.e., IQ data, in addition to the existing abstract classRestlessNode
andRestlessToCounts
for processing restless counts.
Upgrade Notes¶
Several deprecated methods and options have been removed and will no longer work:
BaseExperiment.set_analysis_options()
has been removed and should be replaced withBaseAnalysis.set_options()
.The
curve_plotter
option forCurveAnalysis.set_options()
has been removed and replaced withcurve_drawer
.The
curve_fitter
option forCurveAnalysis.set_options()
has been removed, now you can directly override_run_curve_fit()
instead.Setting
style
and drawer options withCurveAnalysis.set_options()
has been disabled. Analyses should usedrawer.set_options
instead.The
FitVal
class has been removed and replaced with the uncertainties package.Boolean values for the analysis kwarg in
BaseExperiment.run()
have been disabled. Useanalysis=default
instead ofanalysis=True
, andanalysis=None
instead ofanalysis=False
.BaseExperiment.run_analysis()
has been removed. UseBaseAnalysis.run()
instead.BaseExperiment._postprocess_transpiled_circuits()
is removed. UseBaseExperiment._transpiled_circuits()
instead.BaseExperiment.set_analysis_options()
method has been deprecated, use theBaseAnalysis.set_options()
method for the experiments analysis class instead.The
timeout
kwarg ofExperimentData.add_data()
has been removed. Timeout for adding jobs is now handled by theExperimentData.add_jobs()
method.Adding data from jobs using
ExperimentData.add_data()
has been disabled. This method should now only be used to add data from Qiskitresult
objects or raw data dicts. Job data should now be added usingExperimentData.add_jobs()
instead.
A new result class
CurveFitResult
is introduced. This class stores a richer context of curve fitting overview with several extra statistics. This is the minimum attributes of the LMFITMinimizerResult
with some extention. Fit parameters in UFloat representation are also stored while keeping the correlation information, which is accessible with the.ufloat_params
property. Note that the value of the first analysis result entry titled with@Parameters_*
has been replaced with this data format. This entry had been just a list of fit values in Python float format with covariance matrix separately stored in.extra
metadata. Comparing with the conventional data, new classCurveFitResult
provides users with a better understanding of the analysis outcome. New object has prettyprint mechanism.
The
RoughDrag
characterization experiment has been upgraded with more flexibility. This experiment combines multiple DRAG parameter scans (curves) for different unit sequence reptitions. Conventionally this number is limited to three curves, however, now we can define more than three curves. The corresponding fit model is dynamically generated based on new fit optionreps
in the associated analysisDragCalAnalysis
. This may sometimes provide better accuracy for estimating the DRAGbeta
parameter.
The implementations of several methods in
BaseCurveAnalysis
have been moved to its subclassCurveAnalysis
.BaseCurveAnalysis._run_data_processing()
,BaseCurveAnalysis._format_data()
, andBaseCurveAnalysis._run_curve_fit()
have been turned into abstract methods, andBaseCurveAnalysis._generate_fit_guesses()
has been moved toCurveAnalysis
. There is no net upgrade on the behavior of curve analysis subclasses, sinceBaseCurveAnalysis
is an abstract class.
The handling of communication with the database has been transferred to the new qiskit-ibm-experiment package and does not rely on the soon to be deprecated qiskit-ibmq-provider package. In addition, The
ExperimentData
andDbExperimentData
classes were merged, and the inner handling of experiment data was somewhat simplified. This should not have any effect on the current codebase and its usage ofExperimentData
.
Added a
FigureData
class for adding metadata to analysis result figures. Figures added toExperimentData
are now stored using this class. The raw image object (SVG or matplotlib.Figure) can be accessed using theFigureData.figure
attribute.Note that currently metadata is only stored locally and will be discarded when saved to the cloud experiment service database.
The
DumpedOscillationAnalysis
class has been deprecated and will be removed soon. Use theDampedOscillationAnalysis
class going forward.
Deprecation Notes¶
Multiple methods, classes and functions in curve analysis have been deprecated and replaced with using functionality of the LMFIT library. These include:
Curve fit solver
curve_fit()
andmulti_curve_fit()
Dataclass of the curve fit result
FitData()
Some fit functions dedicated to a particular curve analysis in the module
fit_function
. Now curve analysis author can define arbitrary fit functions callable or string with LMFIT models, not limited to functions in this module.
The
scipy_linear_lstsq
andscipy_gaussian_lstsq
fitters for theStateTomographyAnalysis
andProcessTomographyAnalysis
classes have been deprecated.The unweighted, unconstrained least-squares fitting performed by
scipy_linear_lstsq
is equivalent to thelinear_inversion()
fitter, but with worse performance and memory usage.For weighted least-squares fitting the CVXPY fitters
cvxpy_linear_lstsq()
orcvxpy_gaussian_lstsq()
, which also support support PSD and CPTP constraints, should be used instead.
Bug Fixes¶
Fixed a bug that caused analysis to sometimes run after job or previous analysis failure.
The
.init_params
value of theCurveFitResult
has been fixed. This value was copied from the LMFITMinimizerResult.init_values
, however this is not the initial parameters set to the solver. Now correct initial parameters are set toCurveFitResult.init_params
.
Fixed a bug when copying
AnalysisResult
(and thus copyingExperimentData
and re-running some analyses) where an exception, regarding theextra
attribute of theAnalysisResult
instance, would be thrown.
Fixed broken curve analysis output figure when multi canvas mode is enabled. Currently this feature is only used by
CrossResonanceHamiltonianAnalysis
. It has been plotting all series data in the same canvas due to the bug.
Fixed a bug with the way composite experiments set the
experiment_id
andexperiment_type
ofAnalysisResult
andExperimentData
.
Initial guess function for the randomized benchmarking analysis
rb_decay()
has been upgraded to give accurate estimate of the decay function base.
The
enable_restless()
method of theRestlessMixin
class now has the non-default option to supress errors when T1 values are lower than the repetition dely. This allows users to accomodate cases when backends report erronous T1 values.
0.3.1¶
New Features¶
The class
MockIQBackend
for testing has been updated to support multiple qubits. It now takes lists of IQ cluster centers and widths as input, and specific backends are now defined as subclasses ofMockIQExperimentHelper
.
Bug Fixes¶
Fixes a bug where instantiating the
CrossResonanceHamiltonian
experiment without specifying thecr_gate
andbackend
init kwargs raises an exception.
Fixes a visualization error in the figure produced during analysis of
CrossResonanceHamiltonian
when multi-canvas plotting mode is enabled.
Fixes an issue with marginalization of kerneled and discriminated memory in
CompositeAnalysis
not working correctly. This fixesParallelExperiments
not working correctly for level-1 measurement data.
Fixes a bug with JSON serialization of
ExperimentData
due to Qiskitbackend
andservice
objects not being JSON serializable. These properties are now set toNone
in the serialized experiment data.
0.3.0¶
Prelude¶
The Qiskit Experiments 0.3 release includes several bug fixes and improvements and several new experiments added to the library
. Added experiments include readout error, resonator spectroscopy, two-qubit fine amplitude, and several characterization experiments. Experiments can now be run restlessly without resetting.
There are also numerous changes and improvements to the BaseExperiment
, ExperimentData
, CurveAnalysis
, and composite experiment classes to improve JSON serialization, handling of metadata, accessing the status of jobs and experiments, and the storing and loading of experiments to and from the IBM experiment database service.
New Features¶
Added an
analysis
kwarg toCompositeExperiment
,BatchExperiment
andParallelExperiment
to allow a user to supply a customCompositeAnalysis
instance.
The curve fit parameter guess function
rb_decay()
has been added. This improves the initial parameter estimation of randomized benchmark experiments.
Added
CompositeAnalysis.component_analysis()
method for accessing a component analysis class object from a composite analysis object.
Added a
flatten_results
init kwarg toCompositeAnalysis
,CompositeExperiment
,ParallelExperiment
, andBatchExperiment
that if set toTrue
flattens all analysis results and figures from component experiment analysis into the mainExperimentData
container, and does not save the individual child data components.Note that for nested composite experiments setting
flatten_results=True
will recursively set the same value for all component experiments that are also composite experiments.
MplCurveDrawer
has been added for curve analysis visualization. This class instance is JSON serializable with the experiment encoder and it implements public methods to draw analysis results in several different formats. Its instance is attached toCurveAnalysis
instance as an analysis optionscurve_plotter
. This class is a drop-in replacement ofMplDrawSingleCanvas
andMplDrawMultiCanvasVstack
. This instance has dedicated drawing options. New optionsubplots
, which is a tuple of two integer representing(n_rows, n_cols)
, defines arbitrary 2D array subplots without usingMplDrawMultiCanvasVstack
.
Drawing options are moved from
CurveAnalysis.options
toMplCurveDrawer.options
.
Added a
BaseExperiment._finalize()
method toBaseExperiment
which is after configuring any runtime options, backend, or analysis classes but before generation and execution of experiment circuits duringBaseExperiment.run
.This method is intended to be overridden in experiment subclasses if they need to configure any analysis or runtime options based on a combination of properties of the experiment, for example some combination of backend, experiment and run options.
Improved handling of job and analysis processes in
ExperimentData()
. Verbose logging information on execution of analysis callbacks in an experiment can enabled by setting theqiskit_experiments
log level toDEBUG
.
Added
ExperimentData.jobs()
method for returning a list of Qiskit Jobs for a running or finished experiment.
Added
ExperimentData.job_status()
method for returning the status of Qiskit Job execution for an experiment. This returns aJobStatus
enum class value.
Added
ExperimentData.analysis_status()
method for returning the status of analysis callbacks for an experiment. This returns aAnalysisStatus
enum class value.
Added
ExperimentData.cancel_analysis()
method to allow cancelling pending analysis callbacks. Note that analysis callbacks that have already started running cannot be cancelled.
Added
ExperimentData.cancel()
to cancel both jobs and analysis.
Added
ExperimentData.add_jobs()
method for adding one or more Qiskit jobs to experiment data. This method takes an optionaltimeout
kwarg that when used will automatically cancel all non-finished jobs that exceed the alloted time.
Added enum classes for experiment, job, and analysis status.
Exposed and expanded the class
FakeService
. The fake service will allow enhanced testing of qiskit-experiments and external packages.
A new mixin class
RestlessMixin
is added that enables experiments to run in restless measurement mode, where the qubits are not reset after each measurement.
A new data processing node to marginalize qubit counts is introduced. This node is, for instance, used in the data processing of a fine ZX amplitude experiment run with restless measurements.
A new fine amplitude experiment for two qubits is added. This experiment accepts a two-qubit gate with on rotation angle as parameter.
Added two new experiments (
LocalReadoutError
andCorrelatedReadoutError
) for characterizing the readout error of devices.
Added a new experiment
ResonatorSpectroscopy
to run spectroscopy on readout resonators. This is done by attaching a custom pulse-schedule to the measure instruction. Note that the resonator spectroscopy experiment may cause errors on backends that do not support circuit instructions with measurement schedules attached to them.
A new data processing node
ToAbs
is introduced to take the absolute value of IQ points. This node is needed to analyse readout resonator spectroscopy IQ data since it rotates around in the IQ plane but can also be used in other contexts.
Added support for JSON serialization of
ExperimentData
objects. These objects can be serialized using theExperimentEncoder
andExperimentDecoder
classes.Note that serialization of general experiment results requires that the individual option values and analysis result types are themselves JSON serializable using the encoder and decoder classes.
Added support for pickling
ExperimentData
objects using the Pythonpickle
module.
Added a
T2Hahn
class for composing and running Hahn Echo experiment to estimate T2.
Added a
T2HahnAnalysis
class for analyzing experiment data fromT2Hahn
.
Added a
T2HahnBackend
class for testing which simulates T2 noise statistics.
Added new tomography basis classes
LocalPreparationBasis
andLocalMeasurementBasis
for constructing N-qubit bases from the tensor product of 1-qubit instructions. These classes can optionally be initialized with custom qubit-specific density matrix or POVM element states for respectively for tomographic reconstruction.
Added a new experiment Tphi. It computes the pure dephasing time and is computed as \(1/T_\varphi = 1/T_{2*} - 1/2T_1\). It is implemented as a composite experiment with sub-experiments T1 and T2Ramsey. The new classes are:
Tphi
- class defining the Tphi experiment.TphiAnalysis
- class for Tphi analysis.TphiBackend
- fake backend for running a Tphi experiment, based on the fake backends for T1 and T2Ramsey.
Added
BaseExperiment._transpiled_circuits()
which returns a list of experiment circuits, transpiled. It can be overridden to define custom transpilation.
The all curve fit plot generated by the
CurveAnalysis
shows a confidence interval properly computed with error propagation. By default it shows 1 sigma and 3 sigma region but you can customize this via thestyle
option of the curve analysis subclass. ThePlotterStyle
dataclass has been updated with new attributeplot_sigma
which takes a list oftuple(float, float)
specifying a pair of sigma and transparency.
DataProcessor
andDataAction
are now JSON serializable with the qiskit experiments default encoder. This allows one to retrieve a configured processor from the record and re-analyze loaded data with the processor. Trained nodes are serialized with accquired parameters so that the loaded processor can continue to process new data.
Upgrade Notes¶
Experiment
CrossResonanceHamiltonian
and its subclasses have been upgraded. Now its instance can generate circuits without setting backend for just checking experiment sequence. The sequence with actual parameters is generated after the backend is set. In addition, now experiments can takecr_gate
in the constractor which isGate
type subclass taking a single parameter (flat-top width). If one inputs aHamiltonianGate
subclass with cross resonance Hamiltonian, experiment can be simulated with Aer QASM simulator.
BaseCurveAnalysis
class has been added as a superclass ofCurveAnalysis
. The new base class doesn’t define the_run_analysis()
abstract method and it cannot conduct analysis by itself, however it defines several subroutines that can be combined to build a custom fitting process in the subclass. This allows more flexibility to write custom curve analysis by directly inheriting from the new base class. SeeBaseCurveAnalysis
for details. See also Issue 737 for discussion.
The method
CurveAnalysis._generate_fit_guesses()
has been upgraded with a new method signature. Now this method is called withcurve_data
argument that provides dataset which is used for curve fitting. If you define customCurveAnalysis
subclass in your codestack, you may need to upgrade the method. SeeBaseCurveAnalysis
for details.
Arguments of
FitData
have been updated to takex_data
andy_data
instead ofx_range
andy_range
.
The computation of error per gates (EPGs) from EPC in
RBAnalysis
has been upgraded. To compute these values from a single EPC value obtained by the experiment, we should provide a guess of contribution per basis gate to the depolarization. This ratio has been extracted from backend properties withRBUtils.get_error_dict_from_backend()
, but this approach may result in unreproducible EPG outcomes under certain circumstances. See PR 762 for more details. Not this error ratio is provided from a hard-coded lookup table, and the user can still provide custom values with analysis optiongate_error_ratio
. One can skip computation of EPGs by setting the option toFalse
.
RBAnalysis
has been upgraded to compute corrected EPC for 2Q RB. When the analysis optionepg_1_qubit
is provided, it returns two EPG analysis results, with and without correction for underlying single qubit depolarization channels. New result is added under the nameEPC_corrected
.
CompositeAnalysis
initialization is changed to require a list ofBaseAnalysis
objects so that these are stored in the class, rather than being accessed later via a composite experiment. This initialization is handled automatically byParallelExperiment
andBatchExperiment
composite experiments.
Changed the
Tphi
experiment andTphiAnalysis
to combine the component analysis results so that it runs as a single experiment returning \(T_\phi\), \(T_1\), and \(T_2^\ast\) analysis results.
The component experiment circuits of
ParallelExperiment
andBatchExperiment
are now explicitly transpiled using the respective component experimentstranspile_options()
before being combined into the composite circuits returned by theBaseExperiment.circuits
method.Any transpile options set directly on the
ParallelExperiment
orBatchExperiment
will also be applied as a transpile option to each component experiment.
The circuits returned by the
ParallelExperiment.circuits()
method of parallel circuits will now always be the combined circuits circuits of the transpiled circuits of the individual component experiments transpiled with that experiments transpile options.
New default
CurveAnalysis
analysis optionfixed_parameters
has been added. We can directly exclude parameters from the fit model of the particular analysis instance, rather than defining a new class to define the class attributeCurveAnalysis.__fixed_parameters__
.
The function
get_processor()
of the data processing package has an updated signature to make the method easy to extend. This will allow a more flexible creation of data processors.
The value returned by
ExperimentData.status()
has been changed from a string to aExperimentStatus
enum class value.
The signature of the
outcome_data
argument of the tomography fitter functions inlibrary.tomography
has been changed from a list of NumPy ndarray vectors of non-zero observed frequencies into a single ndarray matrix containing the observed frequencies of all possible measurement outcomes for the measurement bases.
The FineAmplitude experiment is refactored for more flexibility. Furthermore, the FineAmplitudeAnalysis class is upgraded to accept 0/1 calibration circuits to better fit the amplitude A of the ping-pong pattern.
The processing of
meas_level=2
data in the functionget_processor()
is generalized to data processing of experiments with more than one qubit.
The
ParallelExperiment
andBatchExperiment
composite experiments have been changed to no longer return analysis results containing information about sub-experiments. Instead, use thechild_data()
method to retrieve sub-experiments of a given composite experiment.
The RB data processing flow is updated to align it with the recent refactoring of the
get_processor()
function. The RB analysis will now use theget_processor()
function to choose the suitable data processor.
The
job_metadata
field has been removed fromBaseExperiment
. Experiments which needed job metadata for analysis should now directly override the.BaseExperiment._metadata
method to store the required job metadata.Individual experiments using
CurveAnalysis
based analysis have been updated to store themeas_level
andmeas_return
run options in metadata if they have been set in the experiment for use in setting the data processor during analysis.
The
BaseExperiment._additional_metadata
method has been removed, and experiments should now directly override theBaseExperiment._metadata
method to add additional experiment metadata to the run experiment data.
The tomography experiment basis classes
PauliMeasurementBasis
,PauliPreparationBasis
, andPauli6PreparationBasis
have been upgraded to be instances of the new tomography bases classesLocalMeasurementBasis
andLocalPreparationBasis
.
Changed the signature of the
circuit()
andmatrix()
methods of tomography basis classes to require aqubits
kwarg for specifying the specific physical qubits that the basis is being applied to.
The
CurveAnalysis
class has been updated to use the covariance between fit parameters in the error propagation. This will provide more accurate standard error for your fit values.
The data format of analysis result data value has been replaced from
FitVal
touncertainties.ufloat
from the Python uncertainties package to support error propatation for post analysis computation.expdata = T1(0, delays, backend).run() fit_t1 = expdata.analysis_results("T1").value assert isinstance(fit_t1, UFloat) new_value = fit_t1 / 2 new_value.std_dev # show new standard error value
Now
fit_t1
value is anuncertainties.ufloat
instance with new propertiesnominal_value
andstd_dev
, and you can directly apply mathematical operation to this object. The new error value is predicted by linear error propagation theory. Note that you no longer need to separately compute the standard error.This computation is offered by the uncertainties package which is a requirement since from Qiskit Experiments v0.2. The functions supporting error propagation is also available in
uncertainties.umath
.
In the analysis result object,
FitVal.unit
property has been moved toDbAnalysisResultV1.extra
as metadata.
Deprecation Notes¶
Several protected methods of
CurveAnalysis
intended to be overriden or directly be used by subclass have been deprecated.CurveAnalysis._data()
has been deprecated without alternative method to makeCurveAnalysis
state cleaner. Now relevent curve analysis methods requiring curve data are called with thecurve_data
argument.CurveAnalysis._extra_database_entry()
has also been deprecated. This method becomes a part ofCurveAnalysis._create_analysis_results()
. Analysis class author can override this method to inject a code to create custom analysis results.
Calling
RBUtils
methods have been deprecated and will be removed after 0.4.
The
CompositeExperiment.component_analysis()
method has been deprecated. Component analysis classes should now be directly accessed from aCompositeAnalysis()
object using the :meth:.`CompositeAnalysis.component_analysis` method.
Conventional curve visualization classes
MplDrawSingleCanvas
,MplDrawMultiCanvasVstack
and the stylesheetPlotterStyle
have been deprecated and now replaced withMplCurveDrawer
. These classes had been attached to the analysis instance as acurve_plotter
which is a string and mapped to the class method.draw
at runtime via :FitResultPlotters: Enum. It was almost impossible to track the code and hurted the readability. In addition, this implementation was problematic due to dependency on the raw data points saved in an instance variable. See qiskit-experiments/#737 for details.
Class attribute
CurveAnalysis.__fixed_parameters__
has been deprecated and support for the instantiation of the class with this attribute will be dropped soon. In addition, the fixed parameter value defined as a standalone analysis option has been deprecated. Please set fixed_parameters option instead. This is a python dictionary of fixed parameter values keyed on the fit parameter names.
Analysis class
FineDragAnalysis
has been deprecated. Now you can directly set fixed parameters to theErrorAmplificationAnalysis
instance as an analysis option.
Analysis class
FineFrequencyAnalysis
has been deprecated. Now you can directly set fixed parameters to theErrorAmplificationAnalysis
instance as an analysis option.
Analysis class
FineHalfAngleAnalysis
has been deprecated. Now you can directly set fixed parameters to theErrorAmplificationAnalysis
instance as an analysis option.
The library argument to
Calibrations
has been deprecated in favour of a new argument called libraries.
Adding data from jobs using
ExperimentData.add_data()
has been deprecated. This method should now only be used to add data from QiskitResult
objects or raw data dicts. Job data should now be added using the newExperimentData.add_jobs()
method instead.
The
timeout
kwarg ofExperimentData.add_data()
has been deprecated. Timeout for adding jobs is now handled by theExperimentData.add_jobs()
method.
BaseExperiment._postprocess_transpiled_circuits
is deprecated and will be removed in the 0.4.0 release. UseBaseExperiment._transpiled_circuits()
instead.
The
FitVal
class had been deprecated and being replaced with the uncertainties package. When loading saved experiments or analysis results anyFitVal
s will be implicitly converted intoUFloat
which should be re-saved to ensure these experiments can be reloaded in the future.
Bug Fixes¶
Fixed a bug in the
InterleavedRB
experiment where aDelay
instruction, or a Clifford circuit containing delay instructions, could not be used as the interleaved element.
Fixed built-in tomography fitter functions
cvxpy_linear_lstsq()
,cvxpy_gaussian_lstsq()
,scipy_linear_lstsq()
,scipy_gaussian_lstsq()
,linear_inversion()
to make themeasurement_basis
kwarg optional so that these functions could be used for fitting raw tomography fitter data with preparation data but no measurement data.
Fixed bug in
TomographyAnalysis
when accumulating count data from repeated circuits using the same preparation and measurement basis configuration.
Fixed an issue with
ExperimentData.block_for_results()
sometimes having a race issue with all analysis callbacks finishing.
ExperimentData.save()
should now fail gracefully when experiment metadata failed to save instead of crashing.
The link to the experiment entry in the database service shown after saving is now by default obtained from the service, not hard-coded.
The FineZXAmplitude now works properly with restless measurements.
Fixed a bug with the
ProcessTomography
where the default target channel analysis option was computed incorrectly if not all qubits were prepared and measured, and the preparations and measurements were applied to different subsets of qubits.See Issue 758 for details.
Fixed a bug with the
ProcessTomographyAnalysis
where analysis would raise an exception if the number of prepared and measurement qubits are not equal.See Issue 757 for details.
Fixed
ParallelExperiment.copy()
andBatchExperiment.copy()
so that the copies preserves any references between the original component experiments analysis classes and theCompositeAnalysis
classes component analysis classes.
Fixed
CompositeAnalysis.copy()
to recursively make a copy of the component analysis classes.
The initial guess function
exp_decay()
, which estimates an exponent of the decay curve by taking the natural logarithm of the y values, has been updated to handle exceptions when some y values are negative.
Fixed a bug with JSON deserialization using the
ExperimentDecoder
failing to decode custom user classes defined in the__main__
scope of python scripts and notebooks.
Fixed bug in
CompositeAnalysis
where analysis of nested composite experiments could raise a RuntimeError.
Fixed a bug in
TomographyAnalysis
where the basis elements of unobserved measurement outcomes were not being included in the fitter objective function for least-squares fitters (CVXPY and SciPy). This would lead to lower than expected fit fidelities when fitting data with many zero count outcomes (typically synthetic data from ideal simulation).
Fixed issue with the CVXPY
ProcessTomography
analysis fitter functionscvxpy_linear_lstsq()
andcvxpy_gaussian_lstsq()
where the trace preserving constraint was not being applied to the fit functions by default and required being explicitly passed as asolver_option
. Now all CVXPY process tomography experiments will have this option set to True by default unless a user explicitly disables it by setting the solver_option to False.
Cloud database experiment links no longer display when there was an error saving to the API.
Fixed some issues with
ExperimentData.cancel_analysis()
andExperimentData.cancel()
to make cancelling analysis callbacks more robust.
Fixed
ExperimentData.block_for_results()
to handle blocking in recursive cases where an analysis callback adds another job or analysis callback.
The ResonanceAnalysis class has been switched from a Gaussian fit to a Lorentzian fit function. Furthermore, the Gaussian fitting capability is preserved by moving the Gaussian fitting to a new class called GaussianAnalysis. Note that the previous analysis can be used by doing:
spec = ResonatorSpectroscopy(qubit, backend) spec.analysis = GaussianAnalysis()
where
GaussianAnalysis
is imported fromcurve_analysis
.
A bug related to single-shot data in the SVD data processing node is fixed.
Poor python instance representation of
DataAction
has been upgraded to show all information contained in the class instance.
Other Notes¶
Default fit bounds for
d_theta
parameter ofqiskit_experiments.curve_analysis.ErrorAmplificationAnalysis
class has been updated from [-pi, pi] to [-0.8 pi, 0.8 pi]. This change will improve the bad fit when the error value is really close to zero. This has sometimes yielded ind_theta
~ pi rather than zero. Though 0.8 is the empirical factor, this is okey for most situations since the amplification analysis is applied to experiments in the small error regime (this is often sufficiently smaller than pi).
0.2.0¶
Prelude¶
The Qiskit Experiments 2.0 release includes several bug fixes and improvements and many new experiments added to the library
. Added experiments include a full suite of single-qubit gate calibration and characterization experiments, and two-qubit Cross-resonance Hamiltonian characterization experiments.
There are also numerous changes and improvements to the base classes in framework
and calibration_management
to make developing new experiments easier, to improve JSON serialization, and to improve storing and loading experiments for the IBM experiment database service.
New Features¶
You can now change the default
matplotlib
backend used for generated figures by settingqiskit_experiments.framework.matplotlib.default_figure_canvas
to the desired canvas. Note that it has to be a canvas for one of the non-interactive backend. For example, you can setdefault_figure_canvas
toFigureCanvasAgg
to use theAGG
backend.
Added the
replace_results
kwarg torun()
with default value ofreplace_results=False
.If analysis is run with
replace_results=True
then any analysis results and figures in the experiment data will be cleared and replaced with the new analysis results. Saving this experiment data will replace any previously saved data in a database service using the same experiment ID.If analysis is run with
replace_results=False
and the experiment data being analyzed has already been saved to a database service, or already contains analysis results or figures, a copy with a unique experiment ID will be returned containing only the new analysis results and figures. This data can then be saved as its own experiment to a database service.
Added a
set_options()
method andoptions()
property to theqiskit_experiments.framework.BaseAnalysis
class to store and retrieve any analysis options in the state of the analysis instance.
The
analysis
kwarg ofqiskit_experiments.framework.BaseExperiment.run()
can now optionally be passed aqiskit_experiments.framework.BaseAnalysis
instance to use for analysis of that single execution. If no instance is provided the current storedanalysis()
instance for that experiment will be used. Settinganalysis=None
disables analysis for the specific execution.
Added
backend
as an optional__init__
kwarg for all experiments to allow setting the backend at initialization. The backand can also be set and retrieved from the experiment object after construction using thebackend()
property and setter.When using the
backend
kwarg ofrun()
to specify a backend this will temporarily override any currently set backends for that single execution.
Added
ExperimentConfig
dataclass for storing the configuration of an experiment. This configuration can be obtained by using theconfig()
property. Experiments can also be reconstructed from their configuration using thefrom_config()
class method.
Added automatic job splitting to
BaseExperiment
for execution of experiments with a larger number of circuits than can be run in a single job on the target backend. This enables running large experiments on legacy and non-IBM backends that don’t handle job splitting automatically.
Added support for JSON serialization to
qiskit_experiments.calibration_management.BasisGateLibrary
.
Simplified the update library for calibration experiments by merging this functionality into the
qiskit_experiments.calibration_management.BaseCalibrationExperiment
.Future releases may fully deprecate the
qiskit_experiments.calibration_management.update_library.BaseUpdater
in favour of moving its functionality into theBaseCalibrationExperiment
.
The
qiskit_experiments.data_processing.Probability
data processing node has been enhanced to compute the estimated mean and standard deviation of a measured outcome probability using a Bayesian update of a a Beta distribution prior from the observed measurement outcomes. The default prior is an uninformative prior. The user can also provide a custom prior for the probability distribution.
Added
add_analysis_callback()
method toExperimentData
for adding a post-processing analysis function to run as a callback after currently executing experiment jobs are finished.
Added a
block
kwarg with default valueblock=True
to theqiskit_experiments.framework.ExperimentData.analysis_results()
method. If this is True then callinganalysis_results()
will block to wait for all running analysis callbacks to finish before returning results. This prevents issues where trying to retrieve analysis results before analysis was finished would raise an error that the result could not be found.Note that in the case of
ParallelExperiment
andBatchExperiment
blocking or callinganalysis_results
on the parent experiment should be performed before attempting to access results in the component experiment data containers to ensure the component analysis callbacks have been initialized.
The
ExperimentData
class can now store childExperimentData
containers. Child data can either be added at initialization using thechild_data
kwarg or added later using theadd_child_data()
method. ChildExperimentData
can be accessed using thechild_data()
method.
Added a
copy()
method toExperimentData
which allows making a copy of an experiment data container with a new experiment ID, new result IDs, and new figure names, generated for the copy.This method has a kwarg option
copy_results
that can be set toFalse
to only copy the experimentdata()
and metadata, but not the analysis results and figures.
Added methods
add_tags_recursive()
andremove_tags_recursive()
toqiskit_experiments.framework.ExperimentData
for adding and removing tags of an experiment data object and all itschild_data()
.
Added support for saving and loading
qiskit_experiments.framework.ParallelExperiment
andqiskit_experiments.framework.BatchExperiment
experiment data and all component experiment data and results from the IBM experiments database service. Changing the share level of the parent composite experiment will also change the share level of all component experiments.When saving composite experiments each component experiment analysis results and figures will be saved under a unique experiment ID. Note that these component experiments do not save any of the marginalized circuit result data. The unmarginalized circuit result data is saved in the parent componsite experiments.
Added a collection of experiments for performing single-qubit gate
characterization
andcalibration
. The new experiments areRabi
: This experiment scans the amplitude of a pulse and measures the qubit population. This allows us to determine the amplitude that creates, for example, anX
gate and/or aSX
gate.RoughXSXAmplitudeCal
: The calibration version ofRabi
. It extracts the amplitudes needed to implement anX
gate an aSX
gate. This type of calibration is a rough amplitude calibration since the resulting parameter value is typically not very precises.FineAmplitude
: This experiment repeats a rotation a variable number of times to amplify over- and under-rotations. The resulting ping-pong pattern in the qubit population is fit to determine the error in the rotation angle. This experiment has specializations for X (FineXAmplitude
) and SX (FineSXAmplitude
) gates.FineAmplitudeCal
: The calibration version ofFineAmplitude
. It will update the amplitude of the pulse according to the measurred deviation. This experiment has specializations for X (FineXAmplitudeCal
) and SX (FineSXAmplitudeCal
) gates.RoughDrag
: This experiment scans the DRAG parameter of a repeated sequence of rotation and anti-rotation. If the DRAG parameter does not have the correct value phase errors will accumulate and the repeated sequece of gates will not return the qubit to the ground state.RoughDragCal
: The calibration version ofRoughDrag
.FineDrag
: This experiment iterates the gate sequence Rp - Rm where Rp is a rotation around an axis and Rm is the same rotation but in the opposite direction. This sequence amplifies phase errors due to the presence of higher excited states. This experiment has specializations for X (FineXDrag
) and SX (FineSXDrag
) gates.FineDragCal
: The calibration version ofFineDrag
. This will update the DRAG parameter in the instance of the:class:`~qiskit_experiments.calibration_management.Calibrations
class. This experiment has specializations for X (FineXDragCal
) and SX (FineSXDragCal
) gates.QubitSpectroscopy
: This experiment performs spectroscopy by applying a frequency shift to a long pulse. This experiment is typically used to identify the resonance frequency of the qubit.RoughFrequencyCal
the calibration version ofQubitSpectroscopy
. This gives us a first rough estimate of the qubits frequency.RamseyXY
: This experiment performs a Ramsey-XY experiment which allows us to measure the frequency of the qubit. This experiment is sensitive to the sign of the frequency offset from the main transition. It is a more precise measurement than spectroscopy.FrequencyCal
: This is the calibration version ofRamseyXY
.FineFrequency
: This experiment performs an error amplifying sequence to measure the frequency of the qubit. This is done with delay instructions with a variable length and RZ gates.FineFrequencyCal
: This is the calibration version ofFineFrequency
.HalfAngle
: This experiment measures the amount by which the SX and X gates are not parallel. Such errors can occur due to phase errors. For example, the non-linearities in the mixer’s skew for \(\pi/2\) pulses may be different from the \(\pi\) pulse.HalfAngleCal
: This is the calibration version ofHalfAngle
.
Two cross-resonance Hamiltonian tomography experiments have been added to the
qiskit_experiments.library
.qiskit_experiments.library.CrossResonanceHamiltonian
qiskit_experiments.library.EchoedCrossResonanceHamiltonian
These experiments estimates the IX, IY, IZ, ZX, ZY, ZZ Hamiltonian term coefficients of the cross-resonance Hamiltonian, using either a single-tone cross-resonance gate (
CrossResonanceHamiltonian
) or an echoed cross-resonance gate (EchoedResonanceHamiltonian
).
Added a
qiskit_experiments.library.ReadoutAngle
characterization experiment. This experiment computes the average of the angles of the IQ clusters of the ground and excited states.
StandardRb
andInterleavedRb
experiments now compute error as part of the error-per-gate computation.
Known Issues¶
Curve analysis may have imperfection in the uncertainty propagation computation. Fit paramters consist of the nominal part and standard error, however, the correlation of these paramters are not precisely taken into account. This sometimes result in the overestimation of the confidence interval of fit curves, or overestimation of the standard error of some analysis values computed with multiple fitting parameters. This issue will be solved in the version 0.3. See qiskit-experiments/#551 for details.
Upgrade Notes¶
The default
matplotlib
backend used for generated figures was changed from AGG to SVG.
Due to changes in JSON serialization it is possible that some experiments saved to the IBM Experiments database service using the Qiskit Experiments 0.1 API may not be able to be loaded using Qiskit Experiments 0.2.
Changed
run()
to run asynchronously using theadd_analysis_callback()
. Previously analysis was only run asynchronously if it was done as part of an experimentsrun()
.
The
qiskit_experiments.framework.BaseExperiment.analysis()
property has been changed to return aqiskit_experiments.framework.BaseAnalysis
instance rather than a class type. This method also now has a setter which allows setting an analysis instance for use by an experiment.
The
BackendCalibrations
class has bas been removed and its functionality has been merged into theqiskit_experiments.calibration_management.Calibrations
class. Users should now use theCalibrations
class which can be instantiated from a backend by using thefrom_backend()
method.
Data format used in the
qiskit_experiments.data_processing.DataProcessor
has been changed from Tuple[Any, Any] to np.ndarray.
Uncertainty propagation in the
qiskit_experiments.data_processing.DataProcessor
class is now computed using the uncertainties package. Seeqiskit_experiments.data_processing
module documentation for details.
The
CompositeExperimentData
class has been removed and its functionality integrated into theExperimentData
class. A compositeExperimentData
can now be created by initializing with a list of childExperimentData
containers using thechild_data
kwarg.
ParallelExperiment
andBatchExperiment
now return aExperimentData
object which no longer contains acomponent_experiment_data
method. This method has been replaced by thechild_data()
method.
The
qiskit_experiments.framework.ExperimentData.analysis_results()
method has been changed to block on analysis callbacks finishing by default, this means it is no longer necessary to call theblock_for_results()
method first before accessing analysis results.To disable blocking this can be set to run with
block=False
. This should be usedanalysis_results()
needs to be called during another analysis callback to prevent that callback from blocking.
The
callback
and**kwarg
arguments have been removed fromadd_data()
To add a callback function to run after experiment jobs have finished executing use theadd_analysis_callback()
method instead.
All
qiskit_experiments.library
experiments have been changed to work with fixed SI units: Hz for frequency, seconds for delays, and backend dt for pulse widths and durations. Previous experiments withunit
kwargs in their init functions have had this kwarg removed.
The
qubits
intitialization argument forStandardRb
,InterleavedRb
,QuantumVolume
,StateTomography
, andProcessTomography
no longer accepts interger values for specifying a range of qubits. and must now contain an explicit sequence of qubits.
The behavior of the
seed
initialization kwarg of theStandardRB
,InterleavedStandardRB
,QuantumVolume
experiments has been modified.In the new version the
seed
value is used as to initialize a Numpy random number generator object asnumpy.random.default_rng(seed=seed)
each time the experimentscircuits
method is called. This change means that using a fixed seed value will result in the same circuits being generated each time an experiment is run, if no other experiment options are changed.To generate different new random circuits each time an experiment is run the (default) value of
seed=None
should be used. To reproduce equivalent functionality to the previous version behavior of differnet circuits being generated each timerun
is called with a fixed seed you must now set a new fixed seed value between each call torun
usingexperiment.set_experiment_options(seed=value)
.
Deprecation Notes¶
The
qiskit_experiments.framework.BaseExperiment.set_analysis_options()
method has been deprecated, use theqiskit_experiments.framework.BaseAnalysis.set_options()
method for the experiments analysis class instead. This can be accessed from the experiment instance using theqiskit_experiments.framework.BaseExperiment.analysis()
property asexperiment.analysis.set_options(**options)
.
The
qiskit_experiments.framework.BaseExperiment.analysis_options()
property has been deprecated, use theqiskit_experiments.framework.BaseAnalysis.options()
property for the experiments analysis class instead. This can be accessed from the experiment instance using theqiskit_experiments.framework.BaseExperiment.analysis()
property asexperiment.analysis.options
.
The
qiskit_experiments.framework.BaseExperiment.run_analysis()
and method has been deprecated, use theqiskit_experiments.framework.BaseAnalysis.run()
method for the experiments analysis class instead. This can be accessed from the experiment instance using theqiskit_experiments.framework.BaseExperiment.analysis()
property asexperiment.analysis.run(**kwargs)
.
Boolean values for the
analysis
kwarg inqiskit_experiments.framework.BaseExperiment.run()
have been deprecated. Useanalysis="default"
instead ofanalysis=True
, andanalysis=None
instead ofanalysis=False
.
Using the
__analysis_class__
class attrbiute to define a defaultBaseAnalysis
class in aBaseExperiment
subclass has been deprecated. A default analysis class instance should now be passed to the initialization method ofBaseExperiment
instead.
Bug Fixes¶
The
qiskit_experiments.data_processing.Probability
data processing node will no longer return exactly 0 or 1 for a probability estimate. This fixes an issue where this could cause division by 0 when computing weights during curve fitting analysis.
Fixed a bug where the
qiskit_experiments.framework.ExperimentData.load()
method would return anDbExperimentDataV1
object instead of aExperimentData
object.
Fixed bug in
qiskit_experiments.framework.ExperimentData
where trying to load saved job data from a backend usingExperimentData(backend=backend, job_ids=job_ids)
resulted in an error.
Fixed a bug in
StandardRB
andInterleavedRB
where the variance in the estimated error per Clifford did not scale correctly with the number of sampled RB sequences.See Issue 428 for details.