-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Experiment metadata #67
Add Experiment metadata #67
Conversation
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.
We should rethink about circuit metadata. If it must contain all the information needed to generate the circuit, then experiment_options
and num_qubits
should be included (I haven't caught the difference between num_qubits
and len(physical_qubits)
). If not, then need to explain the necessity of the fields that are currently there.
@yaelbh I added everything that is a |
I'm reflecting about the circuit metadata this time, not the experiment metadata that you handle in this PR. The PR is a good opportunity to reconsider the circuit metadata, because information that until now was available only in the circuit metadata is available from now on also in the experiment metadata. |
6b4ef36
to
02c874c
Compare
qiskit_experiments/randomized_benchmarking/interleaved_rb_analysis.py
Outdated
Show resolved
Hide resolved
90ea9df
to
b1d7066
Compare
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.
Overall this looks fine. My Major concern is the duplication of the MockJob
with the existing TestJob
. Do we need both?
Adds all the experiment options as a subdict in metadata keyed by the job id. This lets options for successive executions all get stored so that they can be retrieved for each run job.
* Make job_metadata a list so execution order of jobs is known * Add validation when adding additional data to an existing ExperimentData object
This method should be overridden by experiment subclasses to add metadata rather than overriding the main method.
b1d7066
to
ba02a1a
Compare
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.
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.
Approved with future update for #120
Is it possible to postpone to after the release? Will there be hard requirements of modifications to existing experiments? |
You mean this PR or the issue? I think issue can be addressed in the next release (0.2). However it is preferable to address this before the release because we may deprecate one of two places storing analysis options (before developers start writing a code in different styles). |
Summary
Adds
Experiment
level metadata that is stored directly inExperimentData
without having to be extracted from a job result.Experiment subclasses can override the
BaseExperiment.metadata
method to add additional experiment level metadata if required.Details and comments
Adds
metadata
method toBaseExperiment
which contains the experiment type, num qubits, physical qubits, and the option dicts for the exp (experiment, transpile, run, analysis). WhenExperimentData
is initialized from an Experiment it will store theExperiment.metadata()
dict in the data object. When callingrun
orAnalysis.run
any runtime provided run or analysis options will also be stored in theExperimentData
metadata overriding the existing values.