Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6b099f8
Update the qobj schema to support pulse gate calibrations.
lcapelluto Jul 16, 2020
764f8c7
Fixup qobj classes: add docstrings, call out to super
lcapelluto Jul 20, 2020
e80e839
Merge remote-tracking branch 'upstream/master' into pulse-gates/schema
lcapelluto Jul 21, 2020
e195b3a
Move pulse library to top level. Fill in more details in qasm_qobj.py
lcapelluto Jul 31, 2020
8d7fd5c
Fix mistake in schema: the pulse_library definition already contains …
lcapelluto Aug 3, 2020
d6d0d73
Move pulse library to top level in qasm_qobj.py as well
lcapelluto Aug 4, 2020
01e8cbf
Add GateCalibration to qobj/__init__.py
lcapelluto Aug 5, 2020
d9b1c0c
Fixup some implementation errors: gates contains a list of dict items…
lcapelluto Aug 11, 2020
8ffc521
Put gate calibrations into calibrations.gates to leave room for addin…
lcapelluto Aug 11, 2020
7edf6d3
Add an example json
lcapelluto Aug 11, 2020
f6318ca
Schema version should be referenced not hardcoded a second time
lcapelluto Aug 11, 2020
4bf931f
Pretty print example file
lcapelluto Aug 11, 2020
b652f2e
Merge branch 'master' into pulse-gates/schema
lcapelluto Aug 11, 2020
636f1cc
Check if calibrations is present when doing to from dict
lcapelluto Aug 12, 2020
0bae536
Fixup qobj test
lcapelluto Aug 12, 2020
ea72add
Update the qobj schema to support pulse gate calibrations.
lcapelluto Jul 16, 2020
1033384
Fixup qobj classes: add docstrings, call out to super
lcapelluto Jul 20, 2020
f3b36c1
Move pulse library to top level. Fill in more details in qasm_qobj.py
lcapelluto Jul 31, 2020
dbf85b1
Fix mistake in schema: the pulse_library definition already contains …
lcapelluto Aug 3, 2020
7cd80d2
Move pulse library to top level in qasm_qobj.py as well
lcapelluto Aug 4, 2020
b44d018
Add GateCalibration to qobj/__init__.py
lcapelluto Aug 5, 2020
af04a34
Fixup some implementation errors: gates contains a list of dict items…
lcapelluto Aug 11, 2020
e761e1f
Put gate calibrations into calibrations.gates to leave room for addin…
lcapelluto Aug 11, 2020
e6d0a42
Add an example json
lcapelluto Aug 11, 2020
7c9e33d
Schema version should be referenced not hardcoded a second time
lcapelluto Aug 11, 2020
faf155e
Pretty print example file
lcapelluto Aug 11, 2020
158c4de
Update backend snapshots with new conf or defs (#4897)
mtreinish Aug 10, 2020
ec3997f
One reference to get_sample_pulse is raising deprecation warnings fro…
lcapelluto Aug 10, 2020
0633bf0
Check if calibrations is present when doing to from dict
lcapelluto Aug 12, 2020
6cfbdb6
Fixup qobj test
lcapelluto Aug 12, 2020
21b9366
Merge branch 'master' into pulse-gates/schema
lcapelluto Aug 12, 2020
5cdaaa6
Add qobj.config.calibrations for common cals
lcapelluto Aug 13, 2020
ed30a25
Merge branch 'pulse-gates/schema' of github.com:lcapelluto/qiskit-ter…
lcapelluto Aug 14, 2020
d75ecac
style
lcapelluto Aug 14, 2020
63f85ff
Merge remote-tracking branch 'upstream/master' into pulse-gates/schema
lcapelluto Aug 17, 2020
6e5c968
Move recent qasm qobj changes to the new qobj.common file
lcapelluto Aug 17, 2020
71e06b4
Update schema with qobj level and experiment level calibrations
lcapelluto Aug 17, 2020
4e59942
Add schema test
lcapelluto Aug 17, 2020
2d45267
Apply suggestions from code review
lcapelluto Aug 18, 2020
989f20d
Merge branch 'master' into pulse-gates/schema
lcapelluto Aug 18, 2020
6a836cf
Fix encoding for validation of new pulse library field in qasm qobj. …
lcapelluto Aug 18, 2020
58ea1ff
Merge branch 'pulse-gates/schema' of github.com:lcapelluto/qiskit-ter…
lcapelluto Aug 18, 2020
6de11b4
Merge branch 'master' into pulse-gates/schema
mergify[bot] Aug 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions qiskit/qobj/qasm_qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,32 @@ class QasmQobjExperimentHeader(QobjDictField):

class QasmQobjExperimentConfig(QobjDictField):
"""Configuration for a single QASM experiment in the qobj."""
pass

def __init__(self, calibrations=None, **kwargs):
"""
Args:
calibrations (QasmQobjCalibrations): Information required for
Pulse gates.
kwargs: Additional free form key value fields to add to the
configuration.
"""
if calibrations:
self.calibrations = calibrations
super().__init__(**kwargs)


class QasmQobjCalibrations(QobjDictField):
Comment thread
lcapelluto marked this conversation as resolved.
Outdated
"""The description of all the gate calibrations. Each gate dictionary should contain
"name", "qubits", "params", and "instructions" fields."""

Comment thread
lcapelluto marked this conversation as resolved.
Outdated
def __init__(self, gates, pulse_library):
"""
Args:
gates (list): A list of dictionaries which specify a gate by name, qubits,
Comment thread
lcapelluto marked this conversation as resolved.
Outdated
and params, and contains the Pulse instructions to implement it.
pulse_library (list): List of :class:`PulseLibraryItem`.
"""
super().__init__(gates=gates, pulse_library=pulse_library)


class QobjHeader(QobjDictField):
Expand Down Expand Up @@ -405,7 +430,7 @@ def __init__(self, qobj_id=None, config=None, experiments=None,
self.experiments = experiments or []
self.qobj_id = qobj_id
self.type = 'QASM'
self.schema_version = '1.2.0'
self.schema_version = '1.3.0'

def __repr__(self):
experiments_str = [repr(x) for x in self.experiments]
Expand Down
51 changes: 51 additions & 0 deletions qiskit/schemas/qobj_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,41 @@
},
"type": "array"
},
"calibration_entry": {
Comment thread
lcapelluto marked this conversation as resolved.
"description": "The instruction description of each calibrated gate.",
"type": "object",
"properties": {
"name": {
"description": "Gate name",
"type": "string"
},
"qubits": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array"
},
"params": {
"description": "Gate parameters",
"type": "array"
Comment thread
lcapelluto marked this conversation as resolved.
},
"instructions": {
"description": "Pulse instructions implementing the given gate.",
"type": "array",
"items": {
"$ref": "#/definitions/qobjinstructions"
}
}
},
"required": [
"name",
"qubits",
"params",
"instructions"
]
},
"qobjexp": {
"description": "Quantum experiment",
"properties": {
Expand All @@ -866,6 +901,22 @@
"init_qubits": {
"description": "Whether to initialize the qubits in the ground state before each shot.",
"type": "boolean"
},
"calibrations": {
"description": "User-specified pulse-level calibrations for operations utilized in this experiment.",
"type": "object",
"properties": {
"gates": {
"$ref": "#/definitions/calibration_entry"
},
"pulse_library": {
"description": "Pulses for gate calibrations.",
"items": {
"$ref": "#/definitions/pulse_library"
},
"type": "array"
}
}
Comment thread
lcapelluto marked this conversation as resolved.
}
},
"title": "Experiment level configuration",
Expand Down