Update the qobj schema to support pulse gate calibrations.#4761
Conversation
…, which needed to be fixed in both the schema and the py files
…g other metadata in the future. Make a qobj.common file to allow qobj.qasm to use features of qobj.pulse
…the 'array' requirement
taalexander
left a comment
There was a problem hiding this comment.
I think this looks good except for needing top-level calibrations and my one comment regarding the lazy loading
09a454e to
d75ecac
Compare
Co-authored-by: SooluThomas <soolu.elto@gmail.com>
mtreinish
left a comment
There was a problem hiding this comment.
This LGTM except for one backwards compatibility concern around moving the validator module property. I know that's being used downstream by people and we shouldn't break them unless we have to. We either should alias and deprecate it with a release note or just leave it in qobj/qasm.py.
…ra into pulse-gates/schema
mtreinish
left a comment
There was a problem hiding this comment.
LGTM, thanks for checking the deepcopy/pickling
taalexander
left a comment
There was a problem hiding this comment.
Looks good, all suggestions are non-blocking.
| self.schema_version = '1.3.0' | ||
|
|
||
| def _validate_json_schema(self, out_dict): | ||
| class QobjEncoder(json.JSONEncoder): |
There was a problem hiding this comment.
Should this be broken out as a separate utility class?
| ], | ||
| "instructions": [ | ||
| { | ||
| "name": "1c5a0346ff72c04c45d536d50d13b0d42cf65dc8e320d32385d36861d3bb1e41", |
There was a problem hiding this comment.
These hashed names are pretty cryptic for an example.
| """ | ||
| Initialize a single gate calibration. Instructions may reference waveforms which should be |
There was a problem hiding this comment.
| """ | |
| Initialize a single gate calibration. Instructions may reference waveforms which should be | |
| """Initialize a single gate calibration. Instructions may reference waveforms which should be |
| "type": "object", | ||
| "properties": { | ||
| "gates": { | ||
| "description": "A list of dicts which contain all the required information to lower a gate to waveforms.", |
There was a problem hiding this comment.
| "description": "A list of dicts which contain all the required information to lower a gate to waveforms.", | |
| "description": "A list of objects which contain all the required information to lower a gate to waveforms.", |
| "type": "object", | ||
| "properties": { | ||
| "gates": { | ||
| "description": "A list of dicts which contain all the required information to lower a gate to waveforms.", |
There was a problem hiding this comment.
| "description": "A list of dicts which contain all the required information to lower a gate to waveforms.", | |
| "description": "A list of objects which contain all the required information to lower a gate to waveforms.", |
Summary
Begin Pulse Gates feature by updating the schema. Calibrations may be in the job
configor the experimentconfig.Example:
The
'gates'information must be sufficient to match against any QASM Qobj instruction within thejob.experiments[i].instructionsfields, for instance:QasmQobjInstruction(name='rxtheta', params=[1.57], qubits=[1])matches the last entry.We can move
pulse_libraryto the top level to avoid duplicating memory-intensive pulse waveforms in a single job. The assembler will assert that each waveform in the pulse library is referenced uniquely.Details and comments
pulse_libraryto qobj levelqobj.config.calibrationsfieldLimitations
The current iteration supports any possible job, however, it is of course less efficient than a parameterized Qobj would be.
This schema cannot support unbound parameters, which is also true for any circuit at the moment, except here: Qiskit/qiskit-aer#485. Supporting unbound parameters should be done in a follow up (e.g., a gate's params are not fully specified and a value in the
openpulse_instructionsdepends on that param). This follow up should be useable/compatible with Pulse Schedule, as well.