-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve calibration experiments #251
Conversation
* Added a library of wrapper functions.
* Made spectroscopy a subclass of calibration experiment. * Added tests.
* Reran tutorial NB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice update. We can easily manage calibration, and user can write experiment in single line.
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like putting the update ability into the experiment class. I put some comments on the BaseCalibrationExperiment
class that I would be interested to hear @chriseclectic's opinions on regarding the intended usage of the BaseExperiment
class.
@@ -503,7 +517,8 @@ | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"execution_count": 18, | |||
"execution_count": 17, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the Frequency.update()
call be changed to use the class's update feature?
"Alternatively, we could have manually updated the calibrations by running the following line of code\n", | ||
"\n", | ||
"```\n", | ||
"Amplitude.update(cals, rabi_data, angles_schedules=[(np.pi, \"amp\", \"x\"), (np.pi/2, \"amp\", \"sx\")])\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the import of Amplitude
should move here since it is not used in a code cell?
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
|
||
|
||
class QubitSpectroscopy(BaseExperiment): | ||
class QubitSpectroscopy(BaseCalibrationExperiment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels odd to me that a characterization experiment is a BaseCalibrationExperiment
child. I wonder about making a RoughFrequency
subclass of QubitSpectroscopy
that is a BaseCalibrationExperiment
. More generally, I wonder about making BaseCalibrationExperiment
a mix-in class that can add on the updating feature to a BaseExperiment
. For example, I like to use Rabi as a diagnostic experiment on a qubit, so I could also see Rabi as a characterization experiment with RoughAmplitude
as a BaseCalibrationExperiment
subclass.
On the other, I prefer to keep the class hierarchy as minimal as possible because long chains get confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of my main concerns. I have tried to make the calibration logic optional. I.e. we can still run QubitSpectroscopy
independently of any calibration with the current PR. However, it does feel a bit funny to see calibration logic in the characterization code. I see the point about making BaseCalibrationExperiment
a mix-in class but I also worry about making the class structure too complex to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
class RoughFrequency(QubitSpectroscopy, BaseCalibrationExperiment):
...
is a good suggestion though this could be confusing to users (especially finding the right experiment class).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explore this in bb8fc79. It's not as bad as I though but you need to think carefully about the init order as we are dealing with a diamond inheritance structure here.
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
|
||
|
||
class QubitSpectroscopy(BaseExperiment): | ||
class QubitSpectroscopy(BaseCalibrationExperiment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
class RoughFrequency(QubitSpectroscopy, BaseCalibrationExperiment):
...
is a good suggestion though this could be confusing to users (especially finding the right experiment class).
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
With
we run the risk of having a class structure which is too confusing. |
Agreed, but this means This can cause some edge case. For example, how can we run experiment by using the calibrated pulses (this is not the case of qubit spect, but, for example, ef spect with calibrated X gate), but don't want to update the parameters? Perhaps this situation can be avoided by not providing cal object, but providing the X gate schedule via an exported backend with Qiskit/qiskit#6759 I prefer having two separate experiments that don't change its behavior depending input arguments. |
In response to #251 (comment). As it stands, the calibration base class has an option |
* Added order in the base class to set the schedules. * Refactored Rabi, Drag, and FineAmplitude to the base class. * Adjusted tests accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me. It would be good to hear from @chriseclectic. To me, the outstanding questions with this PR are judgment calls about where to put complexity and flexibility -- whether it is better to have simple characterization experiments like Rabi and then child calibration experiments like RoughDrag, or whether Rabi should have rough amplitude calibration logic built into it.
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank Daniel. Calibration schedule construction is well standardized. I welcome the basic concept of this framework (now each experiment subclass implements the schedule construction logic in own style, and this is another confusing part for contributors).
On the other hand, calibration experiment code becomes pretty lengthy. I lean toward reducing the code at expense of generality. I guess the mix-in class approach can split the logic for circuit generation and parameter update, and it might make the class more readable.
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
super().__init__([qubit]) | ||
self.calibration_options.calibrations = cals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also fine but why we cannot call set_calibration_options
? Seems like this bypasses some validations in the dedicated setter method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Perhaps I misunderstand but we have a method def set_calibration_options(self, **fields):
in BaseCalibrationExperiment
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this directly override the configuration in the constructor. We can always set an option via the setter method if it is not a configuration for the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in above comment, it seems like this should be a fixed init kwarg, not an option that can be changed later?
qiskit_experiments/library/characterization/qubit_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now. I think it is an improvement over how calibration updates are handled currently.
There are still some outstanding questions about the timing of the calibration update (if we don't want to block for results) but that requires more thought and work. Also, I think ideally we would find a way to create a calibration experiment by composing a characterization experiment with some options and an update method without the need for multiple inheritance. If we do change the design later, I hope it can be done without too much disruption to calibrations implemented in the time in between.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okey, but one minor comment. The BaseCalibrationExperiment
implements _get_schedule_from_options
and _get_schedule_from_defaults
method, but these are usually already implemented in the characterization experiment which is a part of subclass of the calibration experiment.
For example, if we look at spectroscopy experiment, characterization one has this method. This is what _get_schedule_from_defaults
provides. Seems like base calibration only need to provide a logic to get schedule from calibration.
https://github.com/Qiskit/qiskit-experiments/blob/22b1598b290464e59a12853efa1eb99b1b36513a/qiskit_experiments/library/characterization/qubit_spectroscopy.py#L133-L151
I hope this will be addressed in the following PRs.
Replying to: #251 (review) Yes, once we have terra 0.19 we should switch to a methodology that uses an instruction schedule map in combination with the transpil options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I have a couple of small questions and suggestions. The main one is concerning the updater: it seems like it would be better to be passed as an init kwarg for the base class like the other base class params rather than being a class attribute.
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
|
||
def __init_subclass__(cls, **kwargs): | ||
"""Warn if BaseCalibrationExperiment is not the first parent.""" | ||
for mro_cls in cls.mro(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is mro
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mro
stands for "method resolution order". This gives the order in which an instance's parent classes are checked for a method or attribute.
The usage pattern for BaseCalibrationExperiment
here is to subclass both BaseCalibrationExperiment
and a characterization experiment. BaseCalibrationExperiment
's __init__
needs to be called first so it can do its setup and then call super().__init__
to run the characterization experiment's setup. For this to happen, the calibration experiment subclass needs to inherit from BaseCalibrationExperiment
before the characterization experiment. If you do it the other way, you will probably figure out that things are not working right and fix your class definition, but this check is just a helper to the developer since it is an unusual pattern.
It would be nice to avoid asking calibration developers to use multiple inheritance. I think the multiple inheritance method is the most straightforward way to layer the calibration schedule selection and parameter update onto a characterization experiment, but there are other options that might give simpler calibration experiment definition at the expense of using more complicated code to set that up (like making BaseCalibrationExperiment
a meta experiment (like ParallelExperiment
) wrapping a BaseExperiment
for example).
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
self._param_name = cal_parameter_name | ||
self.auto_update = auto_update | ||
|
||
def update_calibrations(self, experiment_data: ExperimentData): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this method should be part of the Updater
itself and be called like updater.update_calibrations(exp_data)
. Since experiments can define custom updaters they could overload the updater if needed. I'm not sure if there would be issues with this though since the examples in this PR are pretty straightforward so nothing overloads this method.
If this was changed we should probably add updater
as a property to return the current updater too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to reconsider the way the updaters work in a subsequent PR focused more on the updaters.
qiskit_experiments/calibration_management/base_calibration_experiment.py
Show resolved
Hide resolved
experiment_data = super().run(backend, analysis, experiment_data, **run_options) | ||
|
||
if self.auto_update: | ||
experiment_data = experiment_data.block_for_results() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blocking isn't needed now that #407 is merged. You should be able to do:
if self.auto_update:
experiment_data.add_analysis_callback(self.updated_calibrations)
Which will have the update added to the async job so it runs after the analysis has finished
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making it easy to queue multiple delayed updates to the same mutable Calibrations
instance makes me a little nervous but we can see how it goes. Maybe one just gets used to calling block_for_results()
when running calibrations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chris raised a good point that we do not necessarily want to enforce blocking when calibrating independent experiments on the same chip. For now we will have to get used to calling cals like this
exp1 = Exp1Cal(cals)
exp2 = Exp2Cal(cals)
exp1.run(backend).block_for_results()
exp2.run(backend).block_for_results()
when the experiments are dependent (e.g. Rabi then FineAmp on the same qubit) and like this
exp1.run(backend)
exp2.run(backend)
when they are independent (e.g. Rabi on qubit 0 and Drag on qubit 1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here: 88652ab
qiskit_experiments/calibration_management/base_calibration_experiment.py
Outdated
Show resolved
Hide resolved
…eriment.py Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
…into cal_wrappers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
* Mitigation experiment initial commit * Added mitigation analysis * Small fixes to ensure figures are generated * Linting * Adding tensored mitigation as parallel experiment * Changing method into class * Bug fixes * Restructuring to avoid reliance on composite experiment, and simplifying tensored experiment * Refactor mitigation experiment to have two experiment classes * RB Interleaved element fix (#399) * Slightly changing the way interleaved element is passed and used * Linting * Linting * Linting * Allow splitting of jobs for all backends (#402) * Allow splitting of jobs for all backends Allows splitting experiments containing more circuits than can be executed at once into multiple jobs for legacy backends and 3rd party backends that don't support job splitting automatically. * Update requirements.txt mpl req * Add test Also had to fix bug in FakeJob where the job id of the result and job didn't match which would lead to errors in the number of added jobs. * Fixup * Fix missing callback Fix missing callback call when all added data is non-job data * Add lock to add_data * Fix type hint for run_analysis * Update releasenotes/notes/job-splitting-775dc9aed9cf20c2.yaml Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * FineAmp without schedules (#420) * * FineAmp can now run without a schedule. * * Added test on gates. * * Made fine drag work without schedules. * Update qiskit_experiments/library/calibration/fine_drag.py * * Docstring * Update qiskit_experiments/library/calibration/fine_drag.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/fine_drag.py Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix bug in curve_fit for sigma=None (#422) Setting `sigma=None` for curve_fit would raise an error from trying to call `np.isnan(None)`. This adds a check that sigma is not None first. * Fix bug in DbExperimentData._retrieve_data (#421) * Add analysis callback to ExperimentData (#407) * Add default pre-processing to curve analysis (#409) * add pre-processing to curve fit * black&lint * add reno * rb notebook update * update averaging method with shot number * revert RB analysis * update reno * fix test * revert rb notebook * fix documentation from comments Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * add shots to data sort * fix bug * black * fix bug Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * Improve calibration experiments (#251) Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * english (#429) * PR for saving and loading composite experiments (#364) Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Bump terra to the most recent master (#426) * * Terra bump * * Constraints. * * Delete constraints. * Make verify_headers verify files in the test folder (#433) * Make verify_headers verify files in the test folder * made verify_headers nicer * lint * update tox.ini to run black and lint also for the tools folder * Fix bug with ExperimentData.load (#423) * * Fix issue 430 (#434) Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * * Added loading bug fix and corresponding test. (#444) * * Added tearDown. (#449) * Adjust tomography doc strings to automatic template (#375) * tomography autotemplate doc * fix lint errors * fix indentation * add blank lines * small doc change * Update qpt_analysis.py * Update qpt_experiment.py * Update qst_analysis.py * lint docs fix * misc Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: knzwnao <knzwnao@jp.ibm.com> * Drag fit instability (#450) * * Exposed seed in mock iq backend. * Changed default bounds and initial p0 guess in drag analysis. * * Fix tests. * * Improve doc and black. * Amp cal refactor (#439) * * Added specializations. * Moved fine amp to characterization. * Refactored some tests. * * Added tests. * Added transpile options. * * Removed obsolete test. * Black * * Docs and lint. * * Docs and tests. * * Begining of NB reworking. * * Updated the tutorial. * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Documentation. * * Documentation. * * Added metadata hook in base class. * Added metadata in fine amp cal circuits. Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix DB display for non-float values (#301) * Fix DB display for non-finite floats * Add safe JSON serialization of inf and NaN * Fix some issues with safe float and recusion * A few more fixes * Add string conversion for result display Add ability to display complex, list, and array results in result DB by converting to string. Currently this limits display to cases where the resulting string is < 60 characters. * Add tests for display conversion * Fix array2string conversion * Remove special handling for non float values Now only complex numbers are converted to strings, and any string values are uploaded to the database without checking their length (the service should do its own checking and truncation if required). For values that are not a float or string type, they are uploaded as a string of the class name "(cls)". * Fixup tests for renamed method * Remove unused import * Include safe nan handling for chisq Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * remove double test (#454) Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * Update computation of probability (#424) Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Documentation patch for PR424 (#458) * Cleaned up composite_analysis.py (#443) * Hack for non-existing parent id (#461) * Remove ``experiment_data`` from ``BaseExperiment.run`` (#463) * Remove experiment_data for BaseExperiment.run to prevent adding additional job data to existing experiment using this method. Now all executions must return unique ExperimentData objects, which can still manually be combined using `add_data` if the user wants. * Add backend property to experiments (#462) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Add ExperimentConfig dataclass (#469) * Half angle (#418) * * First draft of half angle calibration. * * inits and docstring. * * Added transpile options, reference and more doc. * * First draft of half angle. * * Docs and test * * removed transpile options (for a future PR). * extended test. * added analysis class. * * fix docs. * * Docstring * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Added transpiler options for inst_map * Bumped terra to main * * ParameterRepr * * Calibration class * Black * Tests * * Improved doc. * Implemented update rule. * * Fixed update rule. * * Update for half angle cal. * * Bug fixes. * Tutorial clean-up. * * Black * * Test align to bug fix. * * Lint. * * Added comment on options. * Update qiskit_experiments/library/characterization/half_angle.py * Update qiskit_experiments/library/characterization/half_angle.py * Update qiskit_experiments/library/calibration/half_angle_cal.py * * Changed init arg order. * * refactor update rule. * * Black * Update qiskit_experiments/library/calibration/analysis/fine_half_angle_analysis.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/half_angle_cal.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update docs/tutorials/fine_calibrations.ipynb Co-authored-by: Will Shanks <wshaos@posteo.net> * * Doc. * * Decorators, and decorators. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Will Shanks <wshaos@posteo.net> * Rabi refactor (#466) * * Moved Rabi to characterization. * * Refactor EFRabi and tests accordingly. * Added tests for rough amp calibration. * Reworked init files and docs in them. * Added rough amplitude cal. * Moved mock rabi backend. * Removed amplitude update from updates. * * Black and lint. * * Docs * * Docs. * * Updated NB and caught some bugs. * * Lint and removed updater amplitude test as Amplitude no longer exists. * * Black * * Test lint * * Black. * * Removed dt info * * rabi_rate_12 * * Named tuple. * * Bug fix with options. * * Test fix after merge main. * * setting of transpile options and the config test. * Update qiskit_experiments/library/characterization/rabi.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update docs/tutorials/calibrating_armonk.ipynb Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Will Shanks <wshaos@posteo.net> * Add ``replace_results`` kwarg to ``BaseAnalysis.run`` (#464) * This fixes issue with re-analyzing experiment data when trying to save to the result database. Now if replace_results is True any previous analysis results will be cleared and replaced with the new results, while if False a copy (with a new experiment id) will be generated containing only the new results. * This change also requires a change that `BaseAnalysis.run` runs as an analysis callback, rather than just `BaseExperiment.run`. * Fix typos in t1/t2 experiments (#480) * T1 T2 analysis migration (#427) * analysis class migration * fix t1 test * black * fix conversion factor handling * update tutorials * bug fix * documentation fix * move some evaluation criteria from common analysis * remove conversion factor and unit from result metadata * keep conversion factor * remove osc_freq from initial guess * update conversion factor logic for init guess * lint * typo fix * Added 0/1 cals for fine sx amp (#483) * * Added 0/1 cals for fine sx amp. * Added dedicated class for fine X amp analysis. * * Aligned cal and characterization value. * Fixed tests. * Updated NB. * * Fix method redefine. * * Dropped negative bound on amp. * Fix output array shape of SVD data processing node (#476) * fix SVD shape * fix docs * fix comment * fix var name * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * comments Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Edge-case: fitting constant y values with decay analysis (#487) * Small fixes from recent PRs (#489) Fixes a couple bugs from recent PRs * set_backend has to be called last during initialization so that all instance attributes are created first in case they are used by _set_backend * block_for_results in CompositeExperimentData was not returning self like the super class does * BaseExperiment.run and BaseExperiment.run_analysis should return the output of Analysis.run / run_analysis in case a copy of the experiment data is created by the `replace_results` analysis kwarg. * Drag cal refactor (#473) * * Moved calibration.DragCal -> characterization.RoughDrag. * New cal class RoughDragCal. * Added test and refactored tests. * Adjusted inits. * * Default options. * * Black. * Amp. update fix. * * Removed Drag update library test as this is now redundent with RoughDragCal test. * * Removed Drag updater. * * Removed unused import. * * updated NB. * * Aligned tests to the gate naming. * * Tutorial NB. * * Config test. * * Args order and set options. * Ramsey refactor. (#485) * * Moved RamseyXY to characterization. * Added a cal version of the class. * * refactored RamseyXY. * * Test config. * Update qiskit_experiments/calibration_management/base_calibration_experiment.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Arg order in init. * * Removed updated and fixed tests. Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix some typos in warnings (#493) * Fix some typos in warnings * Update qiskit_experiments/database_service/db_experiment_data.py * Update qiskit_experiments/database_service/db_experiment_data.py * Add child data support to ExperimentData (#451) * BaseExperiment to accept only a list of qubits (#431) Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Replace `str(uuid4())` with `uuid4().hex` (#492) * Revert "Replace `str(uuid4())` with `uuid4().hex` (#492)" (#501) This reverts commit f5da13c. * Fine drag cal refactor (#519) * * First draft of framework to save and rebuild calibrations from metadata. * * Moved FineDrag to characterization and created a calibration version of the experiment. * * Undo git merging issues. * * Fix merge issues. * * Lint * * Docs. * * Lint. * * Docs * * Docs. * Fix storing of component metadata in composite experiment (#510) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Consolidate the analysis classes in characterization. (#523) * * Consolidated the analysis classes in characterization. * * Black. * Update qiskit_experiments/library/characterization/cr_hamiltonian.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Removed ~ Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Add ``Settings`` mixin class (#520) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Refactor where the calibration metadata is stored. (#524) * * refactor of where the calibration metadata is stored. * * Lint. * Improve JSON encoder and decoder (#470) * Move error about less than three points from T1 to DecayAnalysis (#490) * Move error about less than three points from T1 to DecayAnalysis * removed check also from decay * lint * Save-load test and bug fixes (#467) * Test counts in composite experiments (#506) * Bug fix: T1 and T2Ramsey don't run correctly on devices (#529) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Recursive methods for adding and removing tags (#522) * wrote add_tags_recursive and remove_tag_recursive * docs * lint * Update qiskit_experiments/database_service/db_experiment_data.py Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com> * release notes * fix method docs * fixed test * black Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com> * Readout angle experiment (#525) * Readout angle experiment * readout angle files * removed fix_class_docs * bug fix in composite save * removed debug prints * moved location of analysis file * removed the parallel test * black * lint * black * lint * black * update init file * docs * release notes * addressing review comments * Update ``ExperimentData.analysis_results`` to be blocking by default (#486) * Serialize the basis gate library (#539) * * Serialization support for the BasisGateLibrary. * Update qiskit_experiments/calibration_management/basis_gate_library.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Internal clean-up of basis gate library. * * Warning message. * * Hashing of basis gate library. * * dict(...) -> .copy() * * Added a test for raising a user warning on different hash values. * * Test docs. * * Refactored schedule building. * * Made test robust. * * Test fix and cleaner implementation. * * removed use_drag. * * Test fix. Co-authored-by: Will Shanks <wshaos@posteo.net> * Data processor with uncertainties package (#481) * fix SVD shape * fix docs * fix comment * fix var name * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * comments * update except for SVD * update note tests * fix processor logic * documentation * lint * add reno use np.testing * fix test * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add description for correlation * remove typehint for trainable node * update return doc * add type check * detail for full array * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add comment * fix document * black * Update qiskit_experiments/data_processing/__init__.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * update docs * update docs * restrict count validation * update return type of data processor * lint * add svd test * update average node * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add comment * add handling for level2 memory * black * lint Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * ignore assigning-non-slot (#553) * Clean-up of Base calibration experiments (#547) * * Removed unused methods and added some validation. * * Moved validation to after init. * * Moved validation to before super().__init__ * Removed validate schedules. * * Fix validation. * Change config from property to method (#555) * Add StoreInitArgs mixin (#554) * Start of BaseAnalysis refactor (#517) * Analysis refactor part 2 (#556) * small fixes * Change to deprecated analysis class usage * Analysis returns mitigator object instead of matrices * Refactoring mitigation experiment * Refactoring mitigation analysis * Linting * Linting * Linting * Linting * Mitigation tutorial notebook * Mitigation tutorial notebook update * Mitigation experiment tests * Linting * Changes to visualization * Bugfix * Linting * Avoiding failing test due to small bug in Terra * Linting * Linting * Refactoring * Tutorial texts * Plot fix * Release note Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Daniel Egger <38065505+eggerdj@users.noreply.github.com> Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <knzwnao@jp.ibm.com> Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: dekelmeirom <33314493+dekelmeirom@users.noreply.github.com> Co-authored-by: Will Shanks <willshanks@us.ibm.com> Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com>
* Mitigation experiment initial commit * Added mitigation analysis * Small fixes to ensure figures are generated * Linting * Adding tensored mitigation as parallel experiment * Changing method into class * Bug fixes * Restructuring to avoid reliance on composite experiment, and simplifying tensored experiment * Refactor mitigation experiment to have two experiment classes * RB Interleaved element fix (qiskit-community#399) * Slightly changing the way interleaved element is passed and used * Linting * Linting * Linting * Allow splitting of jobs for all backends (qiskit-community#402) * Allow splitting of jobs for all backends Allows splitting experiments containing more circuits than can be executed at once into multiple jobs for legacy backends and 3rd party backends that don't support job splitting automatically. * Update requirements.txt mpl req * Add test Also had to fix bug in FakeJob where the job id of the result and job didn't match which would lead to errors in the number of added jobs. * Fixup * Fix missing callback Fix missing callback call when all added data is non-job data * Add lock to add_data * Fix type hint for run_analysis * Update releasenotes/notes/job-splitting-775dc9aed9cf20c2.yaml Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * FineAmp without schedules (qiskit-community#420) * * FineAmp can now run without a schedule. * * Added test on gates. * * Made fine drag work without schedules. * Update qiskit_experiments/library/calibration/fine_drag.py * * Docstring * Update qiskit_experiments/library/calibration/fine_drag.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/fine_drag.py Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix bug in curve_fit for sigma=None (qiskit-community#422) Setting `sigma=None` for curve_fit would raise an error from trying to call `np.isnan(None)`. This adds a check that sigma is not None first. * Fix bug in DbExperimentData._retrieve_data (qiskit-community#421) * Add analysis callback to ExperimentData (qiskit-community#407) * Add default pre-processing to curve analysis (qiskit-community#409) * add pre-processing to curve fit * black&lint * add reno * rb notebook update * update averaging method with shot number * revert RB analysis * update reno * fix test * revert rb notebook * fix documentation from comments Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * add shots to data sort * fix bug * black * fix bug Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * Improve calibration experiments (qiskit-community#251) Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * english (qiskit-community#429) * PR for saving and loading composite experiments (qiskit-community#364) Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Bump terra to the most recent master (qiskit-community#426) * * Terra bump * * Constraints. * * Delete constraints. * Make verify_headers verify files in the test folder (qiskit-community#433) * Make verify_headers verify files in the test folder * made verify_headers nicer * lint * update tox.ini to run black and lint also for the tools folder * Fix bug with ExperimentData.load (qiskit-community#423) * * Fix issue 430 (qiskit-community#434) Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * * Added loading bug fix and corresponding test. (qiskit-community#444) * * Added tearDown. (qiskit-community#449) * Adjust tomography doc strings to automatic template (qiskit-community#375) * tomography autotemplate doc * fix lint errors * fix indentation * add blank lines * small doc change * Update qpt_analysis.py * Update qpt_experiment.py * Update qst_analysis.py * lint docs fix * misc Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: knzwnao <knzwnao@jp.ibm.com> * Drag fit instability (qiskit-community#450) * * Exposed seed in mock iq backend. * Changed default bounds and initial p0 guess in drag analysis. * * Fix tests. * * Improve doc and black. * Amp cal refactor (qiskit-community#439) * * Added specializations. * Moved fine amp to characterization. * Refactored some tests. * * Added tests. * Added transpile options. * * Removed obsolete test. * Black * * Docs and lint. * * Docs and tests. * * Begining of NB reworking. * * Updated the tutorial. * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Documentation. * * Documentation. * * Added metadata hook in base class. * Added metadata in fine amp cal circuits. Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix DB display for non-float values (qiskit-community#301) * Fix DB display for non-finite floats * Add safe JSON serialization of inf and NaN * Fix some issues with safe float and recusion * A few more fixes * Add string conversion for result display Add ability to display complex, list, and array results in result DB by converting to string. Currently this limits display to cases where the resulting string is < 60 characters. * Add tests for display conversion * Fix array2string conversion * Remove special handling for non float values Now only complex numbers are converted to strings, and any string values are uploaded to the database without checking their length (the service should do its own checking and truncation if required). For values that are not a float or string type, they are uploaded as a string of the class name "(cls)". * Fixup tests for renamed method * Remove unused import * Include safe nan handling for chisq Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * remove double test (qiskit-community#454) Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * Update computation of probability (qiskit-community#424) Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Documentation patch for PR424 (qiskit-community#458) * Cleaned up composite_analysis.py (qiskit-community#443) * Hack for non-existing parent id (qiskit-community#461) * Remove ``experiment_data`` from ``BaseExperiment.run`` (qiskit-community#463) * Remove experiment_data for BaseExperiment.run to prevent adding additional job data to existing experiment using this method. Now all executions must return unique ExperimentData objects, which can still manually be combined using `add_data` if the user wants. * Add backend property to experiments (qiskit-community#462) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Add ExperimentConfig dataclass (qiskit-community#469) * Half angle (qiskit-community#418) * * First draft of half angle calibration. * * inits and docstring. * * Added transpile options, reference and more doc. * * First draft of half angle. * * Docs and test * * removed transpile options (for a future PR). * extended test. * added analysis class. * * fix docs. * * Docstring * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Added transpiler options for inst_map * Bumped terra to main * * ParameterRepr * * Calibration class * Black * Tests * * Improved doc. * Implemented update rule. * * Fixed update rule. * * Update for half angle cal. * * Bug fixes. * Tutorial clean-up. * * Black * * Test align to bug fix. * * Lint. * * Added comment on options. * Update qiskit_experiments/library/characterization/half_angle.py * Update qiskit_experiments/library/characterization/half_angle.py * Update qiskit_experiments/library/calibration/half_angle_cal.py * * Changed init arg order. * * refactor update rule. * * Black * Update qiskit_experiments/library/calibration/analysis/fine_half_angle_analysis.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/half_angle_cal.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update docs/tutorials/fine_calibrations.ipynb Co-authored-by: Will Shanks <wshaos@posteo.net> * * Doc. * * Decorators, and decorators. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Will Shanks <wshaos@posteo.net> * Rabi refactor (qiskit-community#466) * * Moved Rabi to characterization. * * Refactor EFRabi and tests accordingly. * Added tests for rough amp calibration. * Reworked init files and docs in them. * Added rough amplitude cal. * Moved mock rabi backend. * Removed amplitude update from updates. * * Black and lint. * * Docs * * Docs. * * Updated NB and caught some bugs. * * Lint and removed updater amplitude test as Amplitude no longer exists. * * Black * * Test lint * * Black. * * Removed dt info * * rabi_rate_12 * * Named tuple. * * Bug fix with options. * * Test fix after merge main. * * setting of transpile options and the config test. * Update qiskit_experiments/library/characterization/rabi.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update docs/tutorials/calibrating_armonk.ipynb Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Will Shanks <wshaos@posteo.net> * Add ``replace_results`` kwarg to ``BaseAnalysis.run`` (qiskit-community#464) * This fixes issue with re-analyzing experiment data when trying to save to the result database. Now if replace_results is True any previous analysis results will be cleared and replaced with the new results, while if False a copy (with a new experiment id) will be generated containing only the new results. * This change also requires a change that `BaseAnalysis.run` runs as an analysis callback, rather than just `BaseExperiment.run`. * Fix typos in t1/t2 experiments (qiskit-community#480) * T1 T2 analysis migration (qiskit-community#427) * analysis class migration * fix t1 test * black * fix conversion factor handling * update tutorials * bug fix * documentation fix * move some evaluation criteria from common analysis * remove conversion factor and unit from result metadata * keep conversion factor * remove osc_freq from initial guess * update conversion factor logic for init guess * lint * typo fix * Added 0/1 cals for fine sx amp (qiskit-community#483) * * Added 0/1 cals for fine sx amp. * Added dedicated class for fine X amp analysis. * * Aligned cal and characterization value. * Fixed tests. * Updated NB. * * Fix method redefine. * * Dropped negative bound on amp. * Fix output array shape of SVD data processing node (qiskit-community#476) * fix SVD shape * fix docs * fix comment * fix var name * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * comments Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Edge-case: fitting constant y values with decay analysis (qiskit-community#487) * Small fixes from recent PRs (qiskit-community#489) Fixes a couple bugs from recent PRs * set_backend has to be called last during initialization so that all instance attributes are created first in case they are used by _set_backend * block_for_results in CompositeExperimentData was not returning self like the super class does * BaseExperiment.run and BaseExperiment.run_analysis should return the output of Analysis.run / run_analysis in case a copy of the experiment data is created by the `replace_results` analysis kwarg. * Drag cal refactor (qiskit-community#473) * * Moved calibration.DragCal -> characterization.RoughDrag. * New cal class RoughDragCal. * Added test and refactored tests. * Adjusted inits. * * Default options. * * Black. * Amp. update fix. * * Removed Drag update library test as this is now redundent with RoughDragCal test. * * Removed Drag updater. * * Removed unused import. * * updated NB. * * Aligned tests to the gate naming. * * Tutorial NB. * * Config test. * * Args order and set options. * Ramsey refactor. (qiskit-community#485) * * Moved RamseyXY to characterization. * Added a cal version of the class. * * refactored RamseyXY. * * Test config. * Update qiskit_experiments/calibration_management/base_calibration_experiment.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Arg order in init. * * Removed updated and fixed tests. Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix some typos in warnings (qiskit-community#493) * Fix some typos in warnings * Update qiskit_experiments/database_service/db_experiment_data.py * Update qiskit_experiments/database_service/db_experiment_data.py * Add child data support to ExperimentData (qiskit-community#451) * BaseExperiment to accept only a list of qubits (qiskit-community#431) Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Replace `str(uuid4())` with `uuid4().hex` (qiskit-community#492) * Revert "Replace `str(uuid4())` with `uuid4().hex` (qiskit-community#492)" (qiskit-community#501) This reverts commit f5da13c. * Fine drag cal refactor (qiskit-community#519) * * First draft of framework to save and rebuild calibrations from metadata. * * Moved FineDrag to characterization and created a calibration version of the experiment. * * Undo git merging issues. * * Fix merge issues. * * Lint * * Docs. * * Lint. * * Docs * * Docs. * Fix storing of component metadata in composite experiment (qiskit-community#510) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Consolidate the analysis classes in characterization. (qiskit-community#523) * * Consolidated the analysis classes in characterization. * * Black. * Update qiskit_experiments/library/characterization/cr_hamiltonian.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Removed ~ Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Add ``Settings`` mixin class (qiskit-community#520) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Refactor where the calibration metadata is stored. (qiskit-community#524) * * refactor of where the calibration metadata is stored. * * Lint. * Improve JSON encoder and decoder (qiskit-community#470) * Move error about less than three points from T1 to DecayAnalysis (qiskit-community#490) * Move error about less than three points from T1 to DecayAnalysis * removed check also from decay * lint * Save-load test and bug fixes (qiskit-community#467) * Test counts in composite experiments (qiskit-community#506) * Bug fix: T1 and T2Ramsey don't run correctly on devices (qiskit-community#529) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Recursive methods for adding and removing tags (qiskit-community#522) * wrote add_tags_recursive and remove_tag_recursive * docs * lint * Update qiskit_experiments/database_service/db_experiment_data.py Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com> * release notes * fix method docs * fixed test * black Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com> * Readout angle experiment (qiskit-community#525) * Readout angle experiment * readout angle files * removed fix_class_docs * bug fix in composite save * removed debug prints * moved location of analysis file * removed the parallel test * black * lint * black * lint * black * update init file * docs * release notes * addressing review comments * Update ``ExperimentData.analysis_results`` to be blocking by default (qiskit-community#486) * Serialize the basis gate library (qiskit-community#539) * * Serialization support for the BasisGateLibrary. * Update qiskit_experiments/calibration_management/basis_gate_library.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Internal clean-up of basis gate library. * * Warning message. * * Hashing of basis gate library. * * dict(...) -> .copy() * * Added a test for raising a user warning on different hash values. * * Test docs. * * Refactored schedule building. * * Made test robust. * * Test fix and cleaner implementation. * * removed use_drag. * * Test fix. Co-authored-by: Will Shanks <wshaos@posteo.net> * Data processor with uncertainties package (qiskit-community#481) * fix SVD shape * fix docs * fix comment * fix var name * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * comments * update except for SVD * update note tests * fix processor logic * documentation * lint * add reno use np.testing * fix test * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add description for correlation * remove typehint for trainable node * update return doc * add type check * detail for full array * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add comment * fix document * black * Update qiskit_experiments/data_processing/__init__.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * update docs * update docs * restrict count validation * update return type of data processor * lint * add svd test * update average node * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add comment * add handling for level2 memory * black * lint Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * ignore assigning-non-slot (qiskit-community#553) * Clean-up of Base calibration experiments (qiskit-community#547) * * Removed unused methods and added some validation. * * Moved validation to after init. * * Moved validation to before super().__init__ * Removed validate schedules. * * Fix validation. * Change config from property to method (qiskit-community#555) * Add StoreInitArgs mixin (qiskit-community#554) * Start of BaseAnalysis refactor (qiskit-community#517) * Analysis refactor part 2 (qiskit-community#556) * small fixes * Change to deprecated analysis class usage * Analysis returns mitigator object instead of matrices * Refactoring mitigation experiment * Refactoring mitigation analysis * Linting * Linting * Linting * Linting * Mitigation tutorial notebook * Mitigation tutorial notebook update * Mitigation experiment tests * Linting * Changes to visualization * Bugfix * Linting * Avoiding failing test due to small bug in Terra * Linting * Linting * Refactoring * Tutorial texts * Plot fix * Release note Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Daniel Egger <38065505+eggerdj@users.noreply.github.com> Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <knzwnao@jp.ibm.com> Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: dekelmeirom <33314493+dekelmeirom@users.noreply.github.com> Co-authored-by: Will Shanks <willshanks@us.ibm.com> Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com>
Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
* Mitigation experiment initial commit * Added mitigation analysis * Small fixes to ensure figures are generated * Linting * Adding tensored mitigation as parallel experiment * Changing method into class * Bug fixes * Restructuring to avoid reliance on composite experiment, and simplifying tensored experiment * Refactor mitigation experiment to have two experiment classes * RB Interleaved element fix (qiskit-community#399) * Slightly changing the way interleaved element is passed and used * Linting * Linting * Linting * Allow splitting of jobs for all backends (qiskit-community#402) * Allow splitting of jobs for all backends Allows splitting experiments containing more circuits than can be executed at once into multiple jobs for legacy backends and 3rd party backends that don't support job splitting automatically. * Update requirements.txt mpl req * Add test Also had to fix bug in FakeJob where the job id of the result and job didn't match which would lead to errors in the number of added jobs. * Fixup * Fix missing callback Fix missing callback call when all added data is non-job data * Add lock to add_data * Fix type hint for run_analysis * Update releasenotes/notes/job-splitting-775dc9aed9cf20c2.yaml Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * FineAmp without schedules (qiskit-community#420) * * FineAmp can now run without a schedule. * * Added test on gates. * * Made fine drag work without schedules. * Update qiskit_experiments/library/calibration/fine_drag.py * * Docstring * Update qiskit_experiments/library/calibration/fine_drag.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/fine_drag.py Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix bug in curve_fit for sigma=None (qiskit-community#422) Setting `sigma=None` for curve_fit would raise an error from trying to call `np.isnan(None)`. This adds a check that sigma is not None first. * Fix bug in DbExperimentData._retrieve_data (qiskit-community#421) * Add analysis callback to ExperimentData (qiskit-community#407) * Add default pre-processing to curve analysis (qiskit-community#409) * add pre-processing to curve fit * black&lint * add reno * rb notebook update * update averaging method with shot number * revert RB analysis * update reno * fix test * revert rb notebook * fix documentation from comments Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * add shots to data sort * fix bug * black * fix bug Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * Improve calibration experiments (qiskit-community#251) Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * english (qiskit-community#429) * PR for saving and loading composite experiments (qiskit-community#364) Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Bump terra to the most recent master (qiskit-community#426) * * Terra bump * * Constraints. * * Delete constraints. * Make verify_headers verify files in the test folder (qiskit-community#433) * Make verify_headers verify files in the test folder * made verify_headers nicer * lint * update tox.ini to run black and lint also for the tools folder * Fix bug with ExperimentData.load (qiskit-community#423) * * Fix issue 430 (qiskit-community#434) Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * * Added loading bug fix and corresponding test. (qiskit-community#444) * * Added tearDown. (qiskit-community#449) * Adjust tomography doc strings to automatic template (qiskit-community#375) * tomography autotemplate doc * fix lint errors * fix indentation * add blank lines * small doc change * Update qpt_analysis.py * Update qpt_experiment.py * Update qst_analysis.py * lint docs fix * misc Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: knzwnao <knzwnao@jp.ibm.com> * Drag fit instability (qiskit-community#450) * * Exposed seed in mock iq backend. * Changed default bounds and initial p0 guess in drag analysis. * * Fix tests. * * Improve doc and black. * Amp cal refactor (qiskit-community#439) * * Added specializations. * Moved fine amp to characterization. * Refactored some tests. * * Added tests. * Added transpile options. * * Removed obsolete test. * Black * * Docs and lint. * * Docs and tests. * * Begining of NB reworking. * * Updated the tutorial. * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/fine_amplitude.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Documentation. * * Documentation. * * Added metadata hook in base class. * Added metadata in fine amp cal circuits. Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix DB display for non-float values (qiskit-community#301) * Fix DB display for non-finite floats * Add safe JSON serialization of inf and NaN * Fix some issues with safe float and recusion * A few more fixes * Add string conversion for result display Add ability to display complex, list, and array results in result DB by converting to string. Currently this limits display to cases where the resulting string is < 60 characters. * Add tests for display conversion * Fix array2string conversion * Remove special handling for non float values Now only complex numbers are converted to strings, and any string values are uploaded to the database without checking their length (the service should do its own checking and truncation if required). For values that are not a float or string type, they are uploaded as a string of the class name "(cls)". * Fixup tests for renamed method * Remove unused import * Include safe nan handling for chisq Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * remove double test (qiskit-community#454) Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> * Update computation of probability (qiskit-community#424) Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Documentation patch for PR424 (qiskit-community#458) * Cleaned up composite_analysis.py (qiskit-community#443) * Hack for non-existing parent id (qiskit-community#461) * Remove ``experiment_data`` from ``BaseExperiment.run`` (qiskit-community#463) * Remove experiment_data for BaseExperiment.run to prevent adding additional job data to existing experiment using this method. Now all executions must return unique ExperimentData objects, which can still manually be combined using `add_data` if the user wants. * Add backend property to experiments (qiskit-community#462) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Add ExperimentConfig dataclass (qiskit-community#469) * Half angle (qiskit-community#418) * * First draft of half angle calibration. * * inits and docstring. * * Added transpile options, reference and more doc. * * First draft of half angle. * * Docs and test * * removed transpile options (for a future PR). * extended test. * added analysis class. * * fix docs. * * Docstring * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Added transpiler options for inst_map * Bumped terra to main * * ParameterRepr * * Calibration class * Black * Tests * * Improved doc. * Implemented update rule. * * Fixed update rule. * * Update for half angle cal. * * Bug fixes. * Tutorial clean-up. * * Black * * Test align to bug fix. * * Lint. * * Added comment on options. * Update qiskit_experiments/library/characterization/half_angle.py * Update qiskit_experiments/library/characterization/half_angle.py * Update qiskit_experiments/library/calibration/half_angle_cal.py * * Changed init arg order. * * refactor update rule. * * Black * Update qiskit_experiments/library/calibration/analysis/fine_half_angle_analysis.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/calibration/half_angle_cal.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update qiskit_experiments/library/characterization/half_angle.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update docs/tutorials/fine_calibrations.ipynb Co-authored-by: Will Shanks <wshaos@posteo.net> * * Doc. * * Decorators, and decorators. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Will Shanks <wshaos@posteo.net> * Rabi refactor (qiskit-community#466) * * Moved Rabi to characterization. * * Refactor EFRabi and tests accordingly. * Added tests for rough amp calibration. * Reworked init files and docs in them. * Added rough amplitude cal. * Moved mock rabi backend. * Removed amplitude update from updates. * * Black and lint. * * Docs * * Docs. * * Updated NB and caught some bugs. * * Lint and removed updater amplitude test as Amplitude no longer exists. * * Black * * Test lint * * Black. * * Removed dt info * * rabi_rate_12 * * Named tuple. * * Bug fix with options. * * Test fix after merge main. * * setting of transpile options and the config test. * Update qiskit_experiments/library/characterization/rabi.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update docs/tutorials/calibrating_armonk.ipynb Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Will Shanks <wshaos@posteo.net> * Add ``replace_results`` kwarg to ``BaseAnalysis.run`` (qiskit-community#464) * This fixes issue with re-analyzing experiment data when trying to save to the result database. Now if replace_results is True any previous analysis results will be cleared and replaced with the new results, while if False a copy (with a new experiment id) will be generated containing only the new results. * This change also requires a change that `BaseAnalysis.run` runs as an analysis callback, rather than just `BaseExperiment.run`. * Fix typos in t1/t2 experiments (qiskit-community#480) * T1 T2 analysis migration (qiskit-community#427) * analysis class migration * fix t1 test * black * fix conversion factor handling * update tutorials * bug fix * documentation fix * move some evaluation criteria from common analysis * remove conversion factor and unit from result metadata * keep conversion factor * remove osc_freq from initial guess * update conversion factor logic for init guess * lint * typo fix * Added 0/1 cals for fine sx amp (qiskit-community#483) * * Added 0/1 cals for fine sx amp. * Added dedicated class for fine X amp analysis. * * Aligned cal and characterization value. * Fixed tests. * Updated NB. * * Fix method redefine. * * Dropped negative bound on amp. * Fix output array shape of SVD data processing node (qiskit-community#476) * fix SVD shape * fix docs * fix comment * fix var name * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * comments Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Edge-case: fitting constant y values with decay analysis (qiskit-community#487) * Small fixes from recent PRs (qiskit-community#489) Fixes a couple bugs from recent PRs * set_backend has to be called last during initialization so that all instance attributes are created first in case they are used by _set_backend * block_for_results in CompositeExperimentData was not returning self like the super class does * BaseExperiment.run and BaseExperiment.run_analysis should return the output of Analysis.run / run_analysis in case a copy of the experiment data is created by the `replace_results` analysis kwarg. * Drag cal refactor (qiskit-community#473) * * Moved calibration.DragCal -> characterization.RoughDrag. * New cal class RoughDragCal. * Added test and refactored tests. * Adjusted inits. * * Default options. * * Black. * Amp. update fix. * * Removed Drag update library test as this is now redundent with RoughDragCal test. * * Removed Drag updater. * * Removed unused import. * * updated NB. * * Aligned tests to the gate naming. * * Tutorial NB. * * Config test. * * Args order and set options. * Ramsey refactor. (qiskit-community#485) * * Moved RamseyXY to characterization. * Added a cal version of the class. * * refactored RamseyXY. * * Test config. * Update qiskit_experiments/calibration_management/base_calibration_experiment.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Arg order in init. * * Removed updated and fixed tests. Co-authored-by: Will Shanks <wshaos@posteo.net> * Fix some typos in warnings (qiskit-community#493) * Fix some typos in warnings * Update qiskit_experiments/database_service/db_experiment_data.py * Update qiskit_experiments/database_service/db_experiment_data.py * Add child data support to ExperimentData (qiskit-community#451) * BaseExperiment to accept only a list of qubits (qiskit-community#431) Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> * Replace `str(uuid4())` with `uuid4().hex` (qiskit-community#492) * Revert "Replace `str(uuid4())` with `uuid4().hex` (qiskit-community#492)" (qiskit-community#501) This reverts commit f5da13c. * Fine drag cal refactor (qiskit-community#519) * * First draft of framework to save and rebuild calibrations from metadata. * * Moved FineDrag to characterization and created a calibration version of the experiment. * * Undo git merging issues. * * Fix merge issues. * * Lint * * Docs. * * Lint. * * Docs * * Docs. * Fix storing of component metadata in composite experiment (qiskit-community#510) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Consolidate the analysis classes in characterization. (qiskit-community#523) * * Consolidated the analysis classes in characterization. * * Black. * Update qiskit_experiments/library/characterization/cr_hamiltonian.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Removed ~ Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Add ``Settings`` mixin class (qiskit-community#520) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Refactor where the calibration metadata is stored. (qiskit-community#524) * * refactor of where the calibration metadata is stored. * * Lint. * Improve JSON encoder and decoder (qiskit-community#470) * Move error about less than three points from T1 to DecayAnalysis (qiskit-community#490) * Move error about less than three points from T1 to DecayAnalysis * removed check also from decay * lint * Save-load test and bug fixes (qiskit-community#467) * Test counts in composite experiments (qiskit-community#506) * Bug fix: T1 and T2Ramsey don't run correctly on devices (qiskit-community#529) Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Recursive methods for adding and removing tags (qiskit-community#522) * wrote add_tags_recursive and remove_tag_recursive * docs * lint * Update qiskit_experiments/database_service/db_experiment_data.py Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com> * release notes * fix method docs * fixed test * black Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com> * Readout angle experiment (qiskit-community#525) * Readout angle experiment * readout angle files * removed fix_class_docs * bug fix in composite save * removed debug prints * moved location of analysis file * removed the parallel test * black * lint * black * lint * black * update init file * docs * release notes * addressing review comments * Update ``ExperimentData.analysis_results`` to be blocking by default (qiskit-community#486) * Serialize the basis gate library (qiskit-community#539) * * Serialization support for the BasisGateLibrary. * Update qiskit_experiments/calibration_management/basis_gate_library.py Co-authored-by: Will Shanks <wshaos@posteo.net> * * Internal clean-up of basis gate library. * * Warning message. * * Hashing of basis gate library. * * dict(...) -> .copy() * * Added a test for raising a user warning on different hash values. * * Test docs. * * Refactored schedule building. * * Made test robust. * * Test fix and cleaner implementation. * * removed use_drag. * * Test fix. Co-authored-by: Will Shanks <wshaos@posteo.net> * Data processor with uncertainties package (qiskit-community#481) * fix SVD shape * fix docs * fix comment * fix var name * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * comments * update except for SVD * update note tests * fix processor logic * documentation * lint * add reno use np.testing * fix test * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_action.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add description for correlation * remove typehint for trainable node * update return doc * add type check * detail for full array * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add comment * fix document * black * Update qiskit_experiments/data_processing/__init__.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * update docs * update docs * restrict count validation * update return type of data processor * lint * add svd test * update average node * Update qiskit_experiments/data_processing/data_processor.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * Update qiskit_experiments/data_processing/nodes.py Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * add comment * add handling for level2 memory * black * lint Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com> * ignore assigning-non-slot (qiskit-community#553) * Clean-up of Base calibration experiments (qiskit-community#547) * * Removed unused methods and added some validation. * * Moved validation to after init. * * Moved validation to before super().__init__ * Removed validate schedules. * * Fix validation. * Change config from property to method (qiskit-community#555) * Add StoreInitArgs mixin (qiskit-community#554) * Start of BaseAnalysis refactor (qiskit-community#517) * Analysis refactor part 2 (qiskit-community#556) * small fixes * Change to deprecated analysis class usage * Analysis returns mitigator object instead of matrices * Refactoring mitigation experiment * Refactoring mitigation analysis * Linting * Linting * Linting * Linting * Mitigation tutorial notebook * Mitigation tutorial notebook update * Mitigation experiment tests * Linting * Changes to visualization * Bugfix * Linting * Avoiding failing test due to small bug in Terra * Linting * Linting * Refactoring * Tutorial texts * Plot fix * Release note Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Daniel Egger <38065505+eggerdj@users.noreply.github.com> Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Naoki Kanazawa <knzwnao@jp.ibm.com> Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: dekelmeirom <33314493+dekelmeirom@users.noreply.github.com> Co-authored-by: Will Shanks <willshanks@us.ibm.com> Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com>
Summary
This PR introduces a calibration base class that ties the update method to the experiment. The calibration experiments are updated accordingly.
Details and comments
Calibration experiments now subclass
BaseCalibrationExperiment
and they must implement theupdate_calibrations
method which updates instances ofCalibrations
. This update will only run if an instance ofCalibrations
has been specified.TODO