Release Notes¶
0.9.0¶
Prelude¶
The Qiskit Experiments 0.9.0 release primarily provides compatibility with version 2.0 of the [Qiskit SDK](https://www.ibm.com/quantum/qiskit). A major change is the removal the previously deprecated support for pulse experiments and calibration due to the removal of Qiskit Pulse in Qiskit 2.0. Some other smaller changes were also needed to adapt to Qiskit 2.0 as described below. Additionally, previously deprecated code related curve fitting and restless measurements was removed. Some additional code paths have been marked as deprecated, particularly relating to ExperimentData.analysis_results() as described below.
New Features¶
Curve analysis helper functions
utils.inverse_weighted_variance,utils.sample_weighted_average, andutils.shot_weighted_averagewere documented as public. These functions were present in previous releases but not documented as public.
Classes
MeasLevelandMeasReturnTypewere added to enumerate the supported measurement levels (kerneled or classified) and return types (averaged or not) for the results of jobs run by experiments. Previously, private classes of Qiskit were inadvertently used for these purposes but they were removed in Qiskit 2.0.
Upgrade Notes¶
To aid with the deprecation of the
resultsargument toExperimentData.add_analysis_results()(see Deprecation Notes),AnalysisResultData.as_table_element()was added toAnalysisResultData. The new method allows for a result to be passed directly toExperimentData.add_analysis_results()through Python dictionary unpacking likeexpdata.add_analysis_result(**result.as_table_element()).
The way that warnings about deprecated arguments are issued has been updated to be more reliable. Previously, warnings would not be issued for deprecated arguments that were left with their default values or that were used in internal calls by other functions in the package. The result of the old behavior was mainly that arguments to
ExperimentData.add_analysis_results()andExperimentData.analysis_results()that should have previously been issuing pending deprecation warnings did not. This release still proceeds with upgrading those pending deprecations to full deprecations.
RBAnalysishas been updated so that it accepts for theepg_1_qubitoption the form of analysis results returned byExperimentData.analysis_results()when passingdataframe=True.
In preparation for Qiskit 2.0, references to
BackendV1have been guarded so that they do not cause import errors.BackendV1is still supported for now, but support will be removed in a future release.
LocalReadouMitigatornow provides a more specific warning if it is used with a backend without aproperties()method or with a backend that does not the require readout error properties.
ExperimentDatawas updated to handle changes toqiskit.result.Resultin Qiskit 2.0. With Qiskit 2.0, the result header is a dict instead of a custom class. Qiskit Experiments uses this header to store metadata about experiments’ circuits and now handles both the dict and class forms.
A performance issue in
QuantumVolumewas addressed. When Qiskit Aer is installed,QuantumVolumeusesqiskit_aer.AerSimulatorto simulate the outcomes of the quantum volume circuits to determine the heavy output probabilities. In its default instantiation,AerSimulatorregenerates itsqiskit.transpiler.Targetevery time it is accessed and this generation takes an appreciable amount of time. Because the target was being accessed separately for every circuit, this overhead could accumulate to over a minute in the standard 100 circuit experiment. This overhead was reduced by processing all the circuits in one pass.
Previously deprecated experiments involving pulse gate calibrations have been removed, due to the upcoming removal of Qiskit Pulse in Qiskit 2.0. These experiments include
QubitSpectroscopy,EFSpectroscopy,Rabi,EFRabi,ResonatorSpectroscopy,RoughDrag,StarkRamseyXY,StarkRamseyXYAmpScan,StarkP1Spectroscopy,CrossResonanceHamiltonian,EchoedCrossResonanceHamiltonian,BaseCalibrationExperiment,RoughFrequencyCal,RoughEFFrequencyCal,FrequencyCal,FineFrequencyCal,RoughDragCal,FineXDragCal,FineSXDragCal,FineDragCal,FineAmplitudeCal,FineXAmplitudeCal,FineSXAmplitudeCal,HalfAngleCal,RoughAmplitudeCal,RoughXSXAmplitudeCal, andEFRoughXSXAmplitudeCal. The associated analysis and helper classes likeResonanceAnalysis,CrossResonanceHamiltonianAnalysis,DragCalAnalysis,ResonatorSpectroscopyAnalysis, andStarkCoefficientswere also removed.
Also due to the deprecation of Qiskit Pulse, support for providing pulse gate calibrations to excite higher levels has been removed from
MultiStateDiscrimination.
The
Calibrationsclass and all of Qiskit Experiments’ calibration support (including gate libraries and calibration updaters and experiments) have been removed. The calibrations features were based on adjusting parameters of pulses used in gates. With the removal of pulse support in Qiskit 2.0, it no longer was feasible to keep support for features that rely on pulse gate calibrations.
The methods of
BackendDataandBackendTimingthat involved pulse gate features have been removed. The removed methods werecontrol_channel,drive_channel,measure_channel,acquire_channel,min_length,pulse_alignment,acquire_alignment,drive_freqs, andmeas_freqsofBackendDataandround_pulseandpulse_timeofBackendTiming.
The ability for
ExperimentEncoderandExperimentDecoderto work with the pulseScheduleBlockclass has been removed.
qiskit-dynamicshas been removed from theextrasextra of the package. This means thatpip install qiskit-experiments[extras]will no longer installqiskit-dynamics.PulseBackendandSingleTransmonTestBackendstill requireqiskit-dynamicsto be installed, so it must be installed separately. The reason for this change is that Qiskit Experiments aims to keep compatibility with the latest Qiskit and so will not require a package that pins the Qiskit version while Qiskit Dynamics plans to pin to Qiskit version 1.
The previously deprecated support for running experiments with restless measurements has been removed. The
RestlessMixinclass has been removed from the package and thus has also been removed from classes likeRamseyXYandStandardRBon which it was previously applied.
The deprecated analysis option
return_fit_parametershas been removed fromCurveAnalysisandCompositeCurveAnalysis. This change means that the fit parameter analysis result that started with@Parameterswill no longer be included in the set of analysis results. Code callingExperimentData.analysis_results()with a numerical index, rather than a result name or usingdataframe=True(the recommended pattern) may find a different result than it did before. Fit parameters should be accessed usingExperimentData.artifacts()to retrieve thefit_parametersartifact.
Deprecation Notes¶
The
resultsargument toExperimentData.add_analysis_results(), which had previously been marked as pending deprecation, has now been marked as deprecated. The preferred form going forward is to create analysis results by passing individual properties directly as keyword arguments to the method rather than creating separate analysis result objects and passing them to the method. To reflect the fact that a single result is added per call in this way, the methodExperimentData.add_analysis_result()has been added as an alternative toExperimentData.add_analysis_results().
Passing
FalsetoExperimentData.analysis_results()for thedataframeargument has been deprecated. Previously, passingFalsehad been marked as pending deprecation. To preserve backwards compatibility, the default value ofdataframeremainsFalsebut a future release could change the default toTrue. Because this is a major change to the interface, it is not planned that the default will change in the next three months (the shortest allowed deprecation cycle).A previously common pattern was to retrieve a single result by name from an
ExperimentDataobjectexpdatalike:result = expdata.analysis_results("T1") print(f"T1 is {result.value}")
which makes use of implicit returning the result directly instead of a list when there is only one match. With
dataframe=True, the dataframe is not implicitly truncated so the first match must be selected.pandas.DataFrame.iloccan be used to select the first match. The following block is equivalent to the previous example:result = expdata.analysis_results("T1", dataframe=True) print(f"T1 is {result.iloc[0].value}")
Curve analysis utility functions
filter_data(),mean_xy_data(),multi_mean_xy_data(), anddata_sort()have been deprecated. These methods were written to work with the previous representation of curve data. Curve analysis now works withScatterTablewhich provides afiltermethod which can be used with functions likeshot_weighted_average()to achieve similar results to the deprecated functions.
The
ScatterTablepropertiesdata_allocationandlabelsand methodget_subset_ofhave been deprecated.data_allocationwas renamed toseries_id.labelscan be found by looking at theseries_nameof the scatter table’sdataframe. Data subsets can be obtained usingScatterTable.filter()in place ofget_subset_of.
Support for using
BackendV1with Qiskit Experiments is deprecated. Some code paths will generate warnings when usingBackendV1but not all cases are checked. Support is planned to be removed along all support for Qiskit 1 in a future release near the end of support for Qiskit 1.4.
FineZXAmplitudehas been deprecated. It was not deprecated along with the other pulse-related experiments in the previous Qiskit Experiments release, but it requires anZXrotation of \(\pi / 2\) which is not easily realizable on any known providers without pulse calibrations.
PulseBackendandSingleTransmonTestBackendhave been deprecated. These backend classes use Qiskit Dynamics to simulate quantum circuits using Qiskit Pulse with pulse-level simulation and were mainly intended for testing purposes. With the removal of pulse features in Qiskit 2.0, these classes can no longer be maintained. Their deprecation was missed in the previous round of pulse feature deprecation. While the classes are kept for one more release cycle, they require Qiskit less than 2.0 in order to function.
The data processing nodes
RestlessNode,RestlessToCounts, andRestlessToIQhave been deprecated. These deprecations follow on the removal ofRestlessMixinand complete the deprecation of restless measurement code from qiskit-experiments. In principle, users may copy the code of these deprecated nodes and use it to create a custom restless data processor for use on experiments even without support in the base Qiskit Experiments package.
0.8.2¶
Prelude¶
Qiskit Experiments 0.8.2 is a minor update to 0.8.1 to fix an issue with tracking the job status of Qiskit IBM Runtime jobs.
Bug Fixes¶
This release contains a single fix for
ExperimentDatajob status handling.
Experiment Data Fixes¶
Fixed
ExperimentDatanot reporting the correct job status when the job is of typeRuntimeJobV2. See #1512.
0.8.1¶
Prelude¶
Qiskit Experiments 0.8.1 is a minor update to 0.8.0 to improve compatibility with dependencies Qiskit and CVXPY. References to code in these dependencies were updated to avoid triggering deprecation warnings, so that the code will continue to work as new versions of Qiskit and CVXPY are released. Additional examples were added to the documentation, and some typos were corrected.
New Features¶
New
LocalReadoutMitigatorandCorrelatedReadoutMitigatorclasses have been added. These classes were moved directly from Qiskit which deprecated them in Qiskit 1.3. They provide utility methods for applying readout error mitigation and integrate with the readout error mitigation experimentsLocalReadoutErrorandCorrelatedReadoutError.
Upgrade Notes¶
The readout error mitigation experiments
LocalReadoutErrorandCorrelatedReadoutErrorhave been updated to generate instances of the newLocalReadoutMitigatorandCorrelatedReadoutMitigatorclasses. The experiments should continue to work as before, but any code that was using, for example,isinstance()to check object type would need to be updated to check against the Qiskit Experiments classes instead of the old Qiskit classes.
Bug Fixes¶
Fixed
ExperimentDatanot inferring the credentials for the IBM experiment service from aQiskitRuntimeServiceinstance as it used to do forqiskit-ibm-provider. Previously, the IBM experiment service was set up in theExperimentDataconstructor, but now it is done on first attempt to use the service, allowing more time for the service to be set explicitly or for other attributes to be set that help with inferring the credentials.
Fixed a bug where
ExperimentData.add_data()would not work when passed a singleqiskit.primitives.PrimitiveResultobject.
Other Notes¶
Added minimal working code examples to the API pages for the experiments,
EFSpectroscopy,EFRabi,FineAmplitudeCal,FineXAmplitudeCal,FineSXAmplitudeCal,FineDragCal,FineXDragCal,FineSXDragCal,FineFrequencyCal,FrequencyCal,HalfAngleCal,RoughAmplitudeCal,RoughXSXAmplitudeCal,EFRoughXSXAmplitudeCal,RoughDragCal,RoughFrequencyCal,QuantumVolume,InterleavedRB,LayerFidelity,StandardRB,MitigatedProcessTomography,MitigatedStateTomography,ProcessTomographyandStateTomography. The backends used in the code examples are simulators such as,SingleTransmonTestBackend()andAerSimulator(FakePerth()).
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
backendis set on an experiment,qiskit_experiments.framework.BaseExperiment.run()now defaults to wrapping thebackendin aqiskit_ibm_runtime.SamplerV2and using that to execute the circuits. A newsamplerargument is also accepted byrun()to allow for a customqiskit.primitives.BaseSamplerV2instance to be used for circuit execution.run()also accepts abackend_runoption which will cause the oldbackend.runpath 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
Calibrationsclass 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
RestlessMixinis 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_tablewhich 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
LayerFidelityto 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 classLayerFidelityAnalysisreturnsAnalysisResultDatawhich contains severalextraentries to help additional analyses: e.g.qubitsto ease the query of sub-analysis results andreasonto tell users why thequalityof 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_residualstoTrue.
Introduced
sub_plot_heights_listandsub_plot_widths_listattributes inPlotStylefor 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
CurveAnalysishas been replaced by the standalonevisualizationmodule. TheLegacyCurveCompatDrawerhas been removed fromvisualization.The
curve_draweroption toCompositeCurveAnalysishas been replaced by the plotter in the visualization module.The
SeriesDefdataclass has been removed and replaced by theLMFITmodule.The
CurveDatadataclass has been removed and replaced byScatterTable’s DataFrame representation.random_cliffords()andrandom_clifford_circuits()have been removed fromCliffordUtilsand replaced byStandardRB.__sample_sequence().betahas been renamed tooutcome_priorin the tomography utility functionbinomial_weights().The
return_data_pointsoption has been removed from curve analysis. Data points are now automatically provided inExperimentDataobjects via thecurve_dataartifact.The default value of
flatten_resultsin 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
RBAnalysiswhere it fails with aTypeErrorfor 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¶
SingleTransmonTestBackendwas updated to be compatible withqiskit_dynamicsversion 0.5.0. The updates accounted for changes in the expected arguments to Dynamics API’s and did not change behavior. See #1427.
ExperimentDatawas updated so that running analysis a second time withreplace_results=Truedoes not result in thefigure_namesproperty having incorrect data (both old and new figure names if the names changed). See #1430.
BaseAnalysiswas updated to respectfigure_namesas a keyword argument to therun()method. Previously, this argument was ignored andfigure_namescould only be set as an analysis option prior to callingrun(). See #1430.
MockIQBackendwas refactored so that it does not importqiskit_ibm_runtimesince qiskit-ibm-runtime is not a required dependency of Qiskit Experiments.
Removed a
FakeBackendV2import 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
StarkRamseyXYhas been added. This is a variant of theRamseyXYexperiment that characterizes the qubit frequency offset under a Stark tone drive.
New experiment
StarkRamseyXYAmpScanhas been added. This is a variant of theStarkRamseyXYexperiment 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
StarkP1Spectroscopyhas been added. This is a variant ofT1experiment 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_methodto RB experiments, e.g.StandardRBandInterleavedRBso that users can plug in a custom Clifford synthesis algorithm used for generating RB circuits. Such a plugin should be implemented as aHighLevelSynthesisPlugin(seeRBDefaultCliffordSynthesisfor example).
Updated
InterleavedRBso that it only acceptsinterleaved_elementconsisting 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_typeas optional__init__kwarg inBatchExperimentandParallelExperiment.
experiment_typecan now be easily set and retrieved from the experiment object post-construction using theexperiment_typeproperty and setter.
Analysis Class Features¶
Added a
broadcastoption toCompositeAnalysis. Whenbroadcast=Trueis 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_figuresparameter has been added toCompositeAnalysisto control figure generation. By default,generate_figuresisalways, meaning figures will always be generated. Ifgenerate_figuresis set toselective, then only figures for analysis results of bad quality will be generated. Ifgenerate_figuresis set tonever, then figures will never be generated. This behavior can be overridden for individual analyses by setting the analysis optionplotforCurveAnalysis.
Experiment Data Features¶
Figures in
ExperimentDataobjects can now be accessed without the.svgextension.
ExperimentDatahas 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 ofAnalysisResultfor backward compatibility, however, when you call the method with new argumentdataframe=Trueit 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
columnsargument, which may take eitherall,default,minimal, or list of column names. Returning a list ofAnalysisResultwill be deprecated in a future release along with thedataframeoption.Related to this update,
ExperimentData.add_analysis_results()method now takes keyword arguments keyed on the table column names, in addition to the argument ofresultswhich is eitherAnalysisResultor a list of it. This allows users and developers to bypass creation ofAnalysisResultinstance for registering new entry in theExperimentDatainstance.Note that the conventional
AnalysisResultis 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,AnalysisResultwill be hidden from Qiskit Experiments users.
An artifact class has been introduced to store long-form data generated by experiments. The
CurveFitResultandScatterTablegenerated by experiments are now stored in artifacts in theExperimentDataclass.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 theExperimentDataobject 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.
ExperimentDatanow supports the new methodExperimentData.get_service_from_provider()enabling the automatic setting of the experiment database service via passing the provider.
The
start_datetimeproperty ofExperimentDatais now being set to the time the experiment data was created.
The
end_datetimeproperty ofExperimentDatais now being set to the latest time a successful job terminated.
The
creation_datetimeandupdated_datetimeproperties ofExperimentDataare 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_errorsflag 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¶
ScatterTablehas 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 ofCurveDataare implemented for backward compatibility, but these will be removed in the future release.
New analysis option
fit_categoryis added toCurveAnalysissubclasses. This option controls which data subset within theScatterTableis used for the curve fitting.
Calibration Features¶
A JSON data format has been added for saving a
Calibrationsinstance. 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
MplDrawervisualization 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 optionssharexandshareyare also added. The new options are used to unkink the configuration of sub axes, and default toTruefor 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 toBaseDrawerfor generating horizontal lines. See #1348.
The
QuantumVolumeAnalysisanalysis class was updated to useQuantumVolumePlotterfor 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:
xscaleandyscale. They represent parameters to the Matplotlib functionsset_xscaleandset_yscale:log,linear,symlog,logit, andquadratic(the latter is an additional support for quadratic scaling).
Known Issues¶
Copied
ExperimentDataobjects 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
qubitskeyword argument or an integer qubit index to experiments is no longer allowed. Usephysical_qubitskeyword argument with a sequence type input.The
scipy_linear_lstsqandscipy_gaussian_lstsqfitters for theStateTomographyAnalysisandProcessTomographyAnalysisclasses 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_widthsargument and experiment option of theCrossResonanceHamiltonianexperiment and its subclass have been removed. Usedurationsinstead.The
DumpedOscillationAnalysisclass has been renamed toDampedOscillationAnalysis.
Dropped support for Python 3.7 and added support for Python 3.12.
The dependency on
qiskit-terrawas replaced with a dependency onqiskit. This change follows the move in upstream Qiskit to renameqiskit-terratoqiskit. The minimum required version was increased from 0.24 forqiskit-terrato 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-providerpackage, support forqiskit-ibm-provideris 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¶
HalfAngleCalwas changed from updating the complex amplitude of the pulse, to updating the angle in the (amp,angle) representation. When used with theFixedFrequencyTransmonlibrary, 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 detailedCalibrationErrorexplaining the change and the way to adjust to it. Some edge cases - like a custom built pulse with anangleparameter which doesn’t conform to the naming convention of Qiskit’sScalableSymbolicPulseclass, or using a loaded calibration withcomplexamp- 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
CurveAnalysisdata processing was changed. It used to raiseDataProcessorErrorerror 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 theScatterTablewith 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
FixedFrequencyTransmonlibrary was changed from complex amplitude to (amp,angle) representation. All pulses now include anangleparameter, and the default values ofampare set as typefloatinstead 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=Falseby default was deprecated. To create child experiment data, please explicitly setflatten_results=False. The default value offlatten_resultswill be changed toTruein the next release.
BackendData.is_simulatorhas been deprecated.BackendV2does 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_pointstoTruein curve analysis has been deprecated. Data points are now automatically provided inExperimentDataobjects via thecurve_dataartifact.
Direct access to the curve fit summary in
ExperimentDatahas moved fromanalysis_results()toartifacts(), where values are stored in thedataattribute ofArtifactDataobjects. For example, to access the chi-squared of the fit,expdata.analysis_results(0).chisqis 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_parameterswill 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
Calibrationsinstance 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 savingCalibrationsinstance 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_utilsmodule, 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 anIndexErrorif allyvalues are belowbvalue so that it returns0for the case.
The
HalfAngleexperiment’s circuits were changed so that they use combinations ofrzandxinstead of the less standardygate. This change allowsHalfAngleto be run on IBM backends directly. Previously, it could only be run through theHalfAngleCalsubclass in combination with aCalibrationsinstance containing a custom calibration for theygate. 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
pickledeserialization ofExperimentDataobjects. Previously,ExperimentDataobjects could be serialized and deserialized using Python’spicklemodule, 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
ExperimentDatawhich caused experiment saves to the cloud service to fail when the metadata is large.
The
ExperimentData.auto_savesetter 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
ExperimentDataobjects 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
FixedFrequencyTransmonandHalfAngleCal(see upgrade section). With the exception ofHalfAngleCal, all library experiments should continue to function as they did before (even with complexamp). When used with theFixedFrequencyTransmonlibrary,HalfAngleCalwill 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_resultsis set toTrue, the head of the figure name is now the class name of the experiment instead ofParallelExperimentorBatchExperiment, such that the figure name is the same whenflatten_resultsisFalse. The behavior when a figure name is repeated andoverwriteisFalsehas 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_typeanddevice_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
StandardRBto treat two qubit operations in theqiskit.transpiler.Targetas having all-to-all connectivity if there is no set of specific pairs of coupled qubits. Most importantly, this change allowsStandardRBto work withqiskit_aer.AerSimulatorfor multi-qubit benchmarking afterqiskit-aer0.13.0. Version 0.13.0 ofqiskit-aerchanged the defaultqiskit_aer.AerSimulatorto have such aqiskit.transpiler.Targetwithout 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_orderwas 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
InterleavedRBback 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 toCalibrationsto check if a template schedule exists for a particular set of qubits.
Bug Fixes¶
FineXDragCalandEFRoughXSXAmplitudeCalwere updated to attachsxandxcalibrations to their circuits, respectively. Previously, they only attached thexandx12calibrations 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
backendparameter toRoughEFFrequencyCaland exposed it in the experiment library.
Fixed error generating circuits for
BaseCalibrationExperimentsubclasses when the backend instance had no coupling map. Fixed #1116.
Fixed a deprecated Matplotlib
MarkerStyleusage 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 theT1experiment 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
CurveAnalysisbut can be used independently of the analysis classes. This module replaces the old and now deprecatedqiskit_experiments.curve_analysis.visualizationsubmodule.
Added a new IQ plotting class
IQPlotterfor plotting IQ/level-1 data (individual shots and their average) and a discriminator that classifies the data into states.
Added a new
image()method toBaseDrawerandMplDrawerto 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
BaseCurveAnalysisoptionaverage_methodhas been added. This option modifies an averaging technique for y values over the same x values. It defaults tosamplefor the RB experiments andshots_weightedfor the rest of analysis. Previously the setup was hardcoded in the_format_datamethod of the analysis class, and no statistical difference has been introduced with introduction of this option.
A new basis gate library called
EchoedCrossResonancehas been added.
Added a new
initial_circuitoption toResonatorSpectroscopyfor appending before measurements. This can be used to run resonator spectroscopy with different qubit states.
Added a new experiment
MultiStateDiscriminationfor classifying IQ clusters of multi-level energy states.
Added a new sklearn discriminator class
SkQDA.
Added pulse simulator backends
PulseBackendand subclassSingleTransmonTestBackendthat 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
RamseyXYAnalysishas 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
backendinit kwarg to theLocalReadoutErrorandCorrelatedReadoutErrorexperiments, and thephysical_qubitskwarg 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_circuitsexperiment option toBaseExperimentto 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, andtargetinit kwargs to theStateTomographyandProcessTomographyexperiments. These allow specifying the intended backend, a custom analysis class, or a custom target for fidelity calculations when initializing the experiments.
Improved
LocalMeasurementBasisandLocalPreparationBasistomography basis classes support for initializing a noisy basis for performing state preparation and measurement error mitigatedStateTomographyandProcessTomographyexperiments.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
mitigatorkwarg toPauliMeasurementBasiswhich can be used to initialize the basis with aLocalReadoutMitigatorto construct a readout error mitigated basis for use withStateTomographyandProcessTomographyexperiments.The
LocalReadoutErrorexperiment can be run to obtain theLocalReadoutMitigatorfrom its analysis results.
Added readout error mitigated tomography experiments
MitigatedStateTomographyandMitigatedProcessTomography. These are both implemented as aBatchExperimentconsisting of aLocalReadoutErrorcharacterization experiment followed by either aStateTomographyorProcessTomographyexperiment.
Added support for conditional tomographic reconstruction to the
StateTomographyandProcessTomographyexperiments.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_clbitsinit 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 resultsextrafield.The
conditional_measurement_indicesanalysis 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 resultsextrafield.The
conditional_preparation_indicesanalysis 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 resultsextrafield.
Adds an option to
StateTomographyAnalysisandProcessTomographyAnalysisto bootstrap error bars on state and process fidelity analysis results. This can be activated by setting thetarget_bootstrap_samplesanalysis 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
CrossResonanceHamiltonianexperiment and its subclass now acceptdurationswith 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 fulldurationsto 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
ZZRamseyhas been added to measure the ZZ coefficient between a pair of qubits.
Known Issues¶
The
PulseBackendonly 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_optionshas been removed.experiment.analysis.optionsshould be used instead.The
__analysis_class__attribute ofBaseAnalysishas been removed. Use theanalysiskwarg ofBaseExperiment.__init__to specify a default analysis class.The
component_experiment_data()method has been removed fromExperimentDataand replaced byExperimentData.child_data().The
CompositeExperiment.component_analysismethod has been removed. Component analysis classes should be directly accessed usingCompositeAnalysis.component_analysis().The
libraryargument toCalibrationshas been removed and replaced bylibraries.The class attribute
CurveAnalysis.__fixed_parameters__has been removed. Thefixed_parametersanalysis option should be set instead.The method
CurveAnalysis._data()has been removed.The
CurveAnalysisattribute__series__has been removed and is replaced by the constructor argument.The
FineDragAnalysis,FineFrequencyAnalysis, andFineHalfAngleAnalysisanalysis 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 fromRBUtilsand replaced by methods in the RB experiment and analysis themselves.The
error_dictanalysis option ofRBAnalysishas 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.
BaseCalibrationExperimentnow 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_levelfor RB experiments (StandardRBandInterleavedRB) was changed from0to1in 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=0withset_transpile_options().
qiskit-ibmq-provideris deprecated and has been dropped as a requirement. Interactions with IBM backends should use theqiskit-ibm-providerpackage instead (must be installed separately; see the migration guide for more details).
The
qiskit_experiments.test.t2hahn_backend.T2HahnBackendwas 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_qubitsparameter must be passed to indicate how many qubits the backend should simulate. Additionally, passingNonefor these arguments was deprecated. The value that makes that option have no effect should be used instead (for example,0.0forinitialization_error).
Renamed the
qubits,measurement_qubits, andpreparation_qubitsinit kwargs ofStateTomography,ProcessTomography, andTomographyExperimenttophysical_qubits,measurement_indicesandpreparation_indicesrespectively. 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_optionsanalysis options.
The
weightskwarg of thecvxpy_linear_lstsq()andscipy_linear_lstsq()tomography fitters has been changed to accept a weights array the same shape as the suppliedoutcome_dataarray.
The
Tphihas been changed to useT2Hahnas the default T2 estimate because it provides a more meaningful measurement on superconducting devices. An optiont2typehas been added to allow the user to toggle between using \(T_2^*\) fromT2Ramseyby specifying “ramsey” or \(T_2\) fromT2Hahn, which is the default value “hahn”.
Deprecation Notes¶
Deprecated the
qiskit_experiments.curve_analysis.visualizationsubmodule and replaced it with the newqiskit_experiments.visualizationsubmodule.
Providing
data_sort_keydirectly to the LMFIT model to instantiateCurveAnalysishas 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.
MockIQRabiHelperis now deprecated and should be replaced withSingleTransmonTestBackend.
Experiment constructor arguments
qubitandqubitshave been renamedphysical_qubits. For thequbitcase, 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_qubitsinit kwargs ofStateTomography,ProcessTomography, andTomographyExperimenthave been deprecated. They have been replaced with kwargsphysical_qubits,measurement_indicesandpreparation_indicesrespectively. The renamed kwargs have the same functionality as the deprecated kwargs.
The
flat_top_widthsargument and experiment option ofCrossResonanceHamiltonianexperiment 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
Backendmetadata to support the look up of qubit T1 and measurement drive frequency, in order to supportBackendV2backends. The look up of the latter isqiskit-ibm-providerspecific. This change fixed errors failing to find these properties when usingResonatorSpectroscopy(issue #1099) and when using restless measurements withBackendV2backends.
Fixed a bug where redoing
DragCalAnalysis.run()generated wrong fit models.
Fixed a bug where
CurveAnalysistests would fail with matplotlib 3.6.0 owing to a deprecated function call used inMplCurveDrawer. The newMplCurveDrawerno longer uses the deprecated function.
Fixed a bug where
Calibrationswas not updated when calibration experiments were run through the composite experiment framework.
Fixed a bug in the
LocalReadoutErrorexperiment where analysis would fail when run on an ideal simulator with no readout error. See Issue #992 for additional details.
The importing of
scikit-learnwas moved from module-level imports inside oftryblocks to dynamic imports at first usage of thescikit-learnspecific feature. This change should avoid errors in the installation ofscikit-learnfrom preventing a user using features ofqiskit-experimentsthat do not requirescikit-learn. See #1050.
Fixed
BackendData.coupling_map()andBackendData.drive_freqs()raising exceptions when the underlying backend hasNonefor its coupling and qubit property entries. Also, changedBackendData.control_channel()to return an empty list rather thanNonewhen 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-providerwhich 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
StateTomographyandProcessTomographyexperiments 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
RuntimeWarningwill no longer be generated bynumpywhen running a data processor on level one data. See #1071.
Fixed a bug where the
EchoedCrossResonanceHamiltonianexperiment 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_processinghave been moved tocurve_analysis.utils.
The
Calibrationsclass 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
repsinDragCalAnalysiswas 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
Barrierinstructions in front of circuits generated byStandardRBandInterleavedRB.
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 bothBackendV1andBackendV2data fields, since those classes do not share the same interface. TheBackendDatacan be called on a backend and used immediately, and it is also automatically stored as the_backend_datafield ofBaseExperiment. Note that not all data fields are currently accessible viaBackendData; to access additional fields, the corresponding method should be added toBackendDatawith correct treatment for both V1 and V2 backends.
The
CurveAnalysisclass 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_methodhas 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 LMFITModelobjects. See LMFIT documentation for user guide.
New curve analysis baseclass
CompositeCurveAnalysishas 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_datahas been added toCurveAnalysisand 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
CurveAnalysiscurve drawer.
The
figure_titleoption 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_optionshas been added. This was conventionally included in theSeriesDefdataclass, 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
nameproperty of the LMFIT models provided to the curve analysis.colorandsymbolare the color and marker of the curves and the scatter plots, respectively.canvasspecifies the sub-axis index, which is available when multi-axis plot is enabled.
A new data processing node
DiscriminatorNodeis 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) -> yas is common in SKlearn. Here,xis a list of IQ points andyare the labels assigned to each point.
A new data processing node
RestlessToIQis added to process restless level one data, i.e., IQ data, in addition to the existing abstract classRestlessNodeandRestlessToCountsfor 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_plotteroption forCurveAnalysis.set_options()has been removed and replaced withcurve_drawer.The
curve_fitteroption forCurveAnalysis.set_options()has been removed, now you can directly override_run_curve_fit()instead.Setting
styleand drawer options withCurveAnalysis.set_options()has been disabled. Analyses should usedrawer.set_optionsinstead.The
FitValclass has been removed and replaced with the uncertainties package.Boolean values for the analysis kwarg in
BaseExperiment.run()have been disabled. Useanalysis=defaultinstead ofanalysis=True, andanalysis=Noneinstead 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
timeoutkwarg 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 Qiskitresultobjects or raw data dicts. Job data should now be added usingExperimentData.add_jobs()instead.
A new result class
CurveFitResultis introduced. This class stores a richer context of curve fitting overview with several extra statistics. This is the minimum attributes of the LMFITMinimizerResultwith some extention. Fit parameters in UFloat representation are also stored while keeping the correlation information, which is accessible with the.ufloat_paramsproperty. 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.extrametadata. Comparing with the conventional data, new classCurveFitResultprovides users with a better understanding of the analysis outcome. New object has prettyprint mechanism.
The
RoughDragcharacterization 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 optionrepsin the associated analysisDragCalAnalysis. This may sometimes provide better accuracy for estimating the DRAGbetaparameter.
The implementations of several methods in
BaseCurveAnalysishave 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, sinceBaseCurveAnalysisis 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
ExperimentDataandDbExperimentDataclasses 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
FigureDataclass for adding metadata to analysis result figures. Figures added toExperimentDataare now stored using this class. The raw image object (SVG or matplotlib.Figure) can be accessed using theFigureData.figureattribute.Note that currently metadata is only stored locally and will be discarded when saved to the cloud experiment service database.
The
DumpedOscillationAnalysisclass has been deprecated and will be removed soon. Use theDampedOscillationAnalysisclass 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_lstsqandscipy_gaussian_lstsqfitters for theStateTomographyAnalysisandProcessTomographyAnalysisclasses have been deprecated.The unweighted, unconstrained least-squares fitting performed by
scipy_linear_lstsqis 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_paramsvalue of theCurveFitResulthas 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 copyingExperimentDataand re-running some analyses) where an exception, regarding theextraattribute of theAnalysisResultinstance, 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_idandexperiment_typeofAnalysisResultandExperimentData.
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 theRestlessMixinclass 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
MockIQBackendfor 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
CrossResonanceHamiltonianexperiment without specifying thecr_gateandbackendinit kwargs raises an exception.
Fixes a visualization error in the figure produced during analysis of
CrossResonanceHamiltonianwhen multi-canvas plotting mode is enabled.
Fixes an issue with marginalization of kerneled and discriminated memory in
CompositeAnalysisnot working correctly. This fixesParallelExperimentsnot working correctly for level-1 measurement data.
Fixes a bug with JSON serialization of
ExperimentDatadue to Qiskitbackendandserviceobjects not being JSON serializable. These properties are now set toNonein 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
analysiskwarg toCompositeExperiment,BatchExperimentandParallelExperimentto allow a user to supply a customCompositeAnalysisinstance.
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_resultsinit kwarg toCompositeAnalysis,CompositeExperiment,ParallelExperiment, andBatchExperimentthat if set toTrueflattens all analysis results and figures from component experiment analysis into the mainExperimentDatacontainer, and does not save the individual child data components.Note that for nested composite experiments setting
flatten_results=Truewill recursively set the same value for all component experiments that are also composite experiments.
MplCurveDrawerhas 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 toCurveAnalysisinstance as an analysis optionscurve_plotter. This class is a drop-in replacement ofMplDrawSingleCanvasandMplDrawMultiCanvasVstack. 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.optionstoMplCurveDrawer.options.
Added a
BaseExperiment._finalize()method toBaseExperimentwhich 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_experimentslog 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 aJobStatusenum class value.
Added
ExperimentData.analysis_status()method for returning the status of analysis callbacks for an experiment. This returns aAnalysisStatusenum 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 optionaltimeoutkwarg 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
RestlessMixinis 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 (
LocalReadoutErrorandCorrelatedReadoutError) for characterizing the readout error of devices.
Added a new experiment
ResonatorSpectroscopyto 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
ToAbsis 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
ExperimentDataobjects. These objects can be serialized using theExperimentEncoderandExperimentDecoderclasses.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
ExperimentDataobjects using the Pythonpicklemodule.
Added a
T2Hahnclass for composing and running Hahn Echo experiment to estimate T2.
Added a
T2HahnAnalysisclass for analyzing experiment data fromT2Hahn.
Added a
T2HahnBackendclass for testing which simulates T2 noise statistics.
Added new tomography basis classes
LocalPreparationBasisandLocalMeasurementBasisfor 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
CurveAnalysisshows a confidence interval properly computed with error propagation. By default it shows 1 sigma and 3 sigma region but you can customize this via thestyleoption of the curve analysis subclass. ThePlotterStyledataclass has been updated with new attributeplot_sigmawhich takes a list oftuple(float, float)specifying a pair of sigma and transparency.
DataProcessorandDataActionare 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
CrossResonanceHamiltonianand 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_gatein the constractor which isGatetype subclass taking a single parameter (flat-top width). If one inputs aHamiltonianGatesubclass with cross resonance Hamiltonian, experiment can be simulated with Aer QASM simulator.
BaseCurveAnalysisclass 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. SeeBaseCurveAnalysisfor 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_dataargument that provides dataset which is used for curve fitting. If you define customCurveAnalysissubclass in your codestack, you may need to upgrade the method. SeeBaseCurveAnalysisfor details.
Arguments of
FitDatahave been updated to takex_dataandy_datainstead ofx_rangeandy_range.
The computation of error per gates (EPGs) from EPC in
RBAnalysishas 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.
RBAnalysishas been upgraded to compute corrected EPC for 2Q RB. When the analysis optionepg_1_qubitis 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.
CompositeAnalysisinitialization is changed to require a list ofBaseAnalysisobjects so that these are stored in the class, rather than being accessed later via a composite experiment. This initialization is handled automatically byParallelExperimentandBatchExperimentcomposite experiments.
Changed the
Tphiexperiment andTphiAnalysisto 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
ParallelExperimentandBatchExperimentare now explicitly transpiled using the respective component experimentstranspile_options()before being combined into the composite circuits returned by theBaseExperiment.circuitsmethod.Any transpile options set directly on the
ParallelExperimentorBatchExperimentwill 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
CurveAnalysisanalysis optionfixed_parametershas 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 aExperimentStatusenum class value.
The signature of the
outcome_dataargument of the tomography fitter functions inlibrary.tomographyhas 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=2data in the functionget_processor()is generalized to data processing of experiments with more than one qubit.
The
ParallelExperimentandBatchExperimentcomposite 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_metadatafield has been removed fromBaseExperiment. Experiments which needed job metadata for analysis should now directly override the.BaseExperiment._metadatamethod to store the required job metadata.Individual experiments using
CurveAnalysisbased analysis have been updated to store themeas_levelandmeas_returnrun options in metadata if they have been set in the experiment for use in setting the data processor during analysis.
The
BaseExperiment._additional_metadatamethod has been removed, and experiments should now directly override theBaseExperiment._metadatamethod to add additional experiment metadata to the run experiment data.
The tomography experiment basis classes
PauliMeasurementBasis,PauliPreparationBasis, andPauli6PreparationBasishave been upgraded to be instances of the new tomography bases classesLocalMeasurementBasisandLocalPreparationBasis.
Changed the signature of the
circuit()andmatrix()methods of tomography basis classes to require aqubitskwarg for specifying the specific physical qubits that the basis is being applied to.
The
CurveAnalysisclass 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
FitValtouncertainties.ufloatfrom the Python uncertainties package to support error propagation 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_t1value is anuncertainties.ufloatinstance with new propertiesnominal_valueandstd_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.unitproperty has been moved toDbAnalysisResultV1.extraas metadata.
Deprecation Notes¶
Several protected methods of
CurveAnalysisintended to be overriden or directly be used by subclass have been deprecated.CurveAnalysis._data()has been deprecated without alternative method to makeCurveAnalysisstate cleaner. Now relevent curve analysis methods requiring curve data are called with thecurve_dataargument.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
RBUtilsmethods 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,MplDrawMultiCanvasVstackand the stylesheetPlotterStylehave been deprecated and now replaced withMplCurveDrawer. These classes had been attached to the analysis instance as acurve_plotterwhich is a string and mapped to the class method.drawat 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
FineDragAnalysishas been deprecated. Now you can directly set fixed parameters to theErrorAmplificationAnalysisinstance as an analysis option.
Analysis class
FineFrequencyAnalysishas been deprecated. Now you can directly set fixed parameters to theErrorAmplificationAnalysisinstance as an analysis option.
Analysis class
FineHalfAngleAnalysishas been deprecated. Now you can directly set fixed parameters to theErrorAmplificationAnalysisinstance as an analysis option.
The library argument to
Calibrationshas 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 QiskitResultobjects or raw data dicts. Job data should now be added using the newExperimentData.add_jobs()method instead.
The
timeoutkwarg ofExperimentData.add_data()has been deprecated. Timeout for adding jobs is now handled by theExperimentData.add_jobs()method.
BaseExperiment._postprocess_transpiled_circuitsis deprecated and will be removed in the 0.4.0 release. UseBaseExperiment._transpiled_circuits()instead.
The
FitValclass had been deprecated and being replaced with the uncertainties package. When loading saved experiments or analysis results anyFitVals will be implicitly converted intoUFloatwhich should be re-saved to ensure these experiments can be reloaded in the future.
Bug Fixes¶
Fixed a bug in the
InterleavedRBexperiment where aDelayinstruction, 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_basiskwarg optional so that these functions could be used for fitting raw tomography fitter data with preparation data but no measurement data.
Fixed bug in
TomographyAnalysiswhen 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
ProcessTomographywhere 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
ProcessTomographyAnalysiswhere 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 theCompositeAnalysisclasses 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
ExperimentDecoderfailing to decode custom user classes defined in the__main__scope of python scripts and notebooks.
Fixed bug in
CompositeAnalysiswhere analysis of nested composite experiments could raise a RuntimeError.
Fixed a bug in
TomographyAnalysiswhere 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
ProcessTomographyanalysis 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
GaussianAnalysisis imported fromcurve_analysis.
A bug related to single-shot data in the SVD data processing node is fixed.
Poor python instance representation of
DataActionhas been upgraded to show all information contained in the class instance.
Other Notes¶
Default fit bounds for
d_thetaparameter ofqiskit_experiments.curve_analysis.ErrorAmplificationAnalysisclass 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
matplotlibbackend used for generated figures by settingqiskit_experiments.framework.matplotlib.default_figure_canvasto the desired canvas. Note that it has to be a canvas for one of the non-interactive backend. For example, you can setdefault_figure_canvastoFigureCanvasAggto use theAGGbackend.
Added the
replace_resultskwarg torun()with default value ofreplace_results=False.If analysis is run with
replace_results=Truethen 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=Falseand 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.BaseAnalysisclass to store and retrieve any analysis options in the state of the analysis instance.
The
analysiskwarg ofqiskit_experiments.framework.BaseExperiment.run()can now optionally be passed aqiskit_experiments.framework.BaseAnalysisinstance to use for analysis of that single execution. If no instance is provided the current storedanalysis()instance for that experiment will be used. Settinganalysis=Nonedisables analysis for the specific execution.
Added
backendas 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
backendkwarg ofrun()to specify a backend this will temporarily override any currently set backends for that single execution.
Added
ExperimentConfigdataclass 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
BaseExperimentfor 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.BaseUpdaterin favour of moving its functionality into theBaseCalibrationExperiment.
The
qiskit_experiments.data_processing.Probabilitydata 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 toExperimentDatafor adding a post-processing analysis function to run as a callback after currently executing experiment jobs are finished.
Added a
blockkwarg with default valueblock=Trueto 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
ParallelExperimentandBatchExperimentblocking or callinganalysis_resultson 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
ExperimentDataclass can now store childExperimentDatacontainers. Child data can either be added at initialization using thechild_datakwarg or added later using theadd_child_data()method. ChildExperimentDatacan be accessed using thechild_data()method.
Added a
copy()method toExperimentDatawhich 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_resultsthat can be set toFalseto only copy the experimentdata()and metadata, but not the analysis results and figures.
Added methods
add_tags_recursive()andremove_tags_recursive()toqiskit_experiments.framework.ExperimentDatafor adding and removing tags of an experiment data object and all itschild_data().
Added support for saving and loading
qiskit_experiments.framework.ParallelExperimentandqiskit_experiments.framework.BatchExperimentexperiment 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
characterizationandcalibration. 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, anXgate and/or aSXgate.RoughXSXAmplitudeCal: The calibration version ofRabi. It extracts the amplitudes needed to implement anXgate an aSXgate. 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.Calibrationsclass. 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.RoughFrequencyCalthe 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.CrossResonanceHamiltonianqiskit_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.ReadoutAnglecharacterization experiment. This experiment computes the average of the angles of the IQ clusters of the ground and excited states.
StandardRbandInterleavedRbexperiments 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
matplotlibbackend 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.BaseAnalysisinstance rather than a class type. This method also now has a setter which allows setting an analysis instance for use by an experiment.
The
BackendCalibrationsclass has bas been removed and its functionality has been merged into theqiskit_experiments.calibration_management.Calibrationsclass. Users should now use theCalibrationsclass which can be instantiated from a backend by using thefrom_backend()method.
Data format used in the
qiskit_experiments.data_processing.DataProcessorhas been changed from Tuple[Any, Any] to np.ndarray.
Uncertainty propagation in the
qiskit_experiments.data_processing.DataProcessorclass is now computed using the uncertainties package. Seeqiskit_experiments.data_processingmodule documentation for details.
The
CompositeExperimentDataclass has been removed and its functionality integrated into theExperimentDataclass. A compositeExperimentDatacan now be created by initializing with a list of childExperimentDatacontainers using thechild_datakwarg.
ParallelExperimentandBatchExperimentnow return aExperimentDataobject which no longer contains acomponent_experiment_datamethod. 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
callbackand**kwargarguments 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.libraryexperiments 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 withunitkwargs in their init functions have had this kwarg removed.
The
qubitsintitialization argument forStandardRb,InterleavedRb,QuantumVolume,StateTomography, andProcessTomographyno longer accepts interger values for specifying a range of qubits. and must now contain an explicit sequence of qubits.
The behavior of the
seedinitialization kwarg of theStandardRB,InterleavedStandardRB,QuantumVolumeexperiments has been modified.In the new version the
seedvalue is used as to initialize a Numpy random number generator object asnumpy.random.default_rng(seed=seed)each time the experimentscircuitsmethod 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=Noneshould be used. To reproduce equivalent functionality to the previous version behavior of differnet circuits being generated each timerunis called with a fixed seed you must now set a new fixed seed value between each call torunusingexperiment.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
analysiskwarg inqiskit_experiments.framework.BaseExperiment.run()have been deprecated. Useanalysis="default"instead ofanalysis=True, andanalysis=Noneinstead ofanalysis=False.
Using the
__analysis_class__class attrbiute to define a defaultBaseAnalysisclass in aBaseExperimentsubclass has been deprecated. A default analysis class instance should now be passed to the initialization method ofBaseExperimentinstead.
Bug Fixes¶
The
qiskit_experiments.data_processing.Probabilitydata 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 anDbExperimentDataV1object instead of aExperimentDataobject.
Fixed bug in
qiskit_experiments.framework.ExperimentDatawhere trying to load saved job data from a backend usingExperimentData(backend=backend, job_ids=job_ids)resulted in an error.
Fixed a bug in
StandardRBandInterleavedRBwhere the variance in the estimated error per Clifford did not scale correctly with the number of sampled RB sequences.See Issue 428 for details.