From 7c52fd93a779b4b33094c9f76cbd3112e6bdd0be Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 10 Jun 2021 11:52:36 -0400 Subject: [PATCH 1/2] Remove deprecated schemas and validation modules This commit removes the deprecated schema support from the repo. This was deprecated in the 0.17.0 release and has been replaced by a dedicated repository for ibm's payload schemas: https://github.com/Qiskit/ibm-quantum-schemas This also removes jsonschema and fastjsonschema from the requirements list as they're no longer used which will improve the import performance. --- qiskit/compiler/assembler.py | 11 +- qiskit/qobj/__init__.py | 2 - qiskit/qobj/common.py | 11 - qiskit/qobj/pulse_qobj.py | 35 +- qiskit/qobj/qasm_qobj.py | 38 +- qiskit/qobj/utils.py | 32 - .../schemas/backend_configuration_schema.json | 381 ----- qiskit/schemas/backend_properties_schema.json | 116 -- qiskit/schemas/backend_status_schema.json | 37 - .../default_pulse_configuration_schema.json | 150 -- .../backends/backend_calibration_example.json | 134 -- .../backends/backend_calibration_schema.json | 94 -- .../backend_configuration_example_old.json | 16 - .../backend_configuration_schema_old_py.json | 71 - .../backends/backend_parameters_example.json | 153 -- .../backends/backend_parameters_schema.json | 92 -- .../backends/backend_status_example.json | 5 - .../backends/backend_status_schema_py.json | 22 - .../deprecated/qobj/qobj_core_schema.json | 156 -- .../schemas/deprecated/qobj/qobj_example.json | 36 - .../deprecated/qobj/qobj_generic_schema.json | 132 -- .../deprecated/result/result_example.json | 26 - .../deprecated/result/result_schema.json | 94 -- ...ckend_configuration_openpulse_example.json | 60 - ...ackend_configuration_openqasm_example.json | 41 - ...figuration_openqasm_simulator_example.json | 28 - .../examples/backend_properties_example.json | 28 - .../examples/backend_status_example.json | 7 - .../default_pulse_configuration_example.json | 82 - .../schemas/examples/job_status_example.json | 5 - .../schemas/examples/qasm_w_pulse_gates.json | 797 ---------- .../examples/qobj_openpulse_example.json | 43 - .../examples/qobj_openqasm_example.json | 53 - .../result_openpulse_level_0_example.json | 46 - .../result_openpulse_level_1_example.json | 40 - .../examples/result_openqasm_example.json | 50 - .../result_statevector_simulator_example.json | 23 - .../result_unitary_simulator_example.json | 27 - qiskit/schemas/ibmq_device_qobj_schema.json | 107 -- .../schemas/ibmq_simulator_qobj_schema.json | 122 -- qiskit/schemas/job_status_schema.json | 26 - qiskit/schemas/qobj_schema.json | 1319 ----------------- qiskit/schemas/result_schema.json | 149 -- qiskit/validation/__init__.py | 35 - qiskit/validation/jsonschema/__init__.py | 16 - qiskit/validation/jsonschema/exceptions.py | 45 - .../jsonschema/schema_validation.py | 236 --- .../remove-schemas-ca9f3f2e0f08bca8.yaml | 36 + requirements.txt | 2 - test/python/circuit/test_unitary.py | 2 +- test/python/compiler/test_assembler.py | 73 +- test/python/qobj/test_qobj.py | 21 +- test/python/test_schemas.py | 126 -- 53 files changed, 62 insertions(+), 5427 deletions(-) delete mode 100644 qiskit/schemas/backend_configuration_schema.json delete mode 100644 qiskit/schemas/backend_properties_schema.json delete mode 100644 qiskit/schemas/backend_status_schema.json delete mode 100644 qiskit/schemas/default_pulse_configuration_schema.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_calibration_example.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_calibration_schema.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_configuration_example_old.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_configuration_schema_old_py.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_parameters_example.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_parameters_schema.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_status_example.json delete mode 100644 qiskit/schemas/deprecated/backends/backend_status_schema_py.json delete mode 100644 qiskit/schemas/deprecated/qobj/qobj_core_schema.json delete mode 100644 qiskit/schemas/deprecated/qobj/qobj_example.json delete mode 100644 qiskit/schemas/deprecated/qobj/qobj_generic_schema.json delete mode 100644 qiskit/schemas/deprecated/result/result_example.json delete mode 100644 qiskit/schemas/deprecated/result/result_schema.json delete mode 100644 qiskit/schemas/examples/backend_configuration_openpulse_example.json delete mode 100644 qiskit/schemas/examples/backend_configuration_openqasm_example.json delete mode 100644 qiskit/schemas/examples/backend_configuration_openqasm_simulator_example.json delete mode 100644 qiskit/schemas/examples/backend_properties_example.json delete mode 100644 qiskit/schemas/examples/backend_status_example.json delete mode 100644 qiskit/schemas/examples/default_pulse_configuration_example.json delete mode 100644 qiskit/schemas/examples/job_status_example.json delete mode 100644 qiskit/schemas/examples/qasm_w_pulse_gates.json delete mode 100644 qiskit/schemas/examples/qobj_openpulse_example.json delete mode 100644 qiskit/schemas/examples/qobj_openqasm_example.json delete mode 100644 qiskit/schemas/examples/result_openpulse_level_0_example.json delete mode 100644 qiskit/schemas/examples/result_openpulse_level_1_example.json delete mode 100644 qiskit/schemas/examples/result_openqasm_example.json delete mode 100644 qiskit/schemas/examples/result_statevector_simulator_example.json delete mode 100644 qiskit/schemas/examples/result_unitary_simulator_example.json delete mode 100644 qiskit/schemas/ibmq_device_qobj_schema.json delete mode 100644 qiskit/schemas/ibmq_simulator_qobj_schema.json delete mode 100644 qiskit/schemas/job_status_schema.json delete mode 100644 qiskit/schemas/qobj_schema.json delete mode 100644 qiskit/schemas/result_schema.json delete mode 100644 qiskit/validation/__init__.py delete mode 100644 qiskit/validation/jsonschema/__init__.py delete mode 100644 qiskit/validation/jsonschema/exceptions.py delete mode 100644 qiskit/validation/jsonschema/schema_validation.py create mode 100644 releasenotes/notes/remove-schemas-ca9f3f2e0f08bca8.yaml delete mode 100644 test/python/test_schemas.py diff --git a/qiskit/compiler/assembler.py b/qiskit/compiler/assembler.py index 537cff92b1c0..6c2575530667 100644 --- a/qiskit/compiler/assembler.py +++ b/qiskit/compiler/assembler.py @@ -29,7 +29,6 @@ from qiskit.pulse.channels import PulseChannel from qiskit.qobj import QobjHeader, Qobj from qiskit.qobj.utils import MeasLevel, MeasReturnType -from qiskit.validation.jsonschema import SchemaValidationError logger = logging.getLogger(__name__) @@ -415,7 +414,7 @@ def _parse_pulse_args( RunConfig: a run config, which is a standardized object that configures the qobj and determines the runtime environment. Raises: - SchemaValidationError: If the given meas_level is not allowed for the given `backend`. + QiskitError: If the given meas_level is not allowed for the given `backend`. """ # grab relevant info from backend if it exists backend_config = None @@ -423,7 +422,7 @@ def _parse_pulse_args( backend_config = backend.configuration() if meas_level not in getattr(backend_config, "meas_levels", [MeasLevel.CLASSIFIED]): - raise SchemaValidationError( + raise QiskitError( ("meas_level = {} not supported for backend {}, only {} is supported").format( meas_level, backend_config.backend_name, backend_config.meas_levels ) @@ -503,7 +502,7 @@ def _parse_rep_delay( rep_delay_range: Backend list defining allowable range of rep delays. Raises: - SchemaValidationError: If rep_delay is not in the backend rep_delay_range. + QiskitError: If rep_delay is not in the backend rep_delay_range. Returns: float: Modified rep delay after parsing. """ @@ -514,13 +513,13 @@ def _parse_rep_delay( # check that rep_delay is in rep_delay_range if rep_delay_range is not None and isinstance(rep_delay_range, list): if len(rep_delay_range) != 2: - raise SchemaValidationError( + raise QiskitError( "Backend rep_delay_range {} must be a list with two entries.".format( rep_delay_range ) ) if not rep_delay_range[0] <= rep_delay <= rep_delay_range[1]: - raise SchemaValidationError( + raise QiskitError( "Supplied rep delay {} not in the supported " "backend range {}".format(rep_delay, rep_delay_range) ) diff --git a/qiskit/qobj/__init__.py b/qiskit/qobj/__init__.py index c1723d71988d..a770e3f874d1 100644 --- a/qiskit/qobj/__init__.py +++ b/qiskit/qobj/__init__.py @@ -77,8 +77,6 @@ from qiskit.qobj.qasm_qobj import QasmQobjConfig from qiskit.qobj.qasm_qobj import QasmQobjExperimentConfig -from .utils import validate_qobj_against_schema - class Qobj(QasmQobj): """A backwards compat alias for QasmQobj.""" diff --git a/qiskit/qobj/common.py b/qiskit/qobj/common.py index 3a078b82e2bf..4493c1516bf8 100644 --- a/qiskit/qobj/common.py +++ b/qiskit/qobj/common.py @@ -12,19 +12,8 @@ # pylint: disable=invalid-name """Module providing definitions of common Qobj classes.""" -import json -import os from types import SimpleNamespace -import fastjsonschema - - -path_part = "schemas/qobj_schema.json" -path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), path_part) -with open(path) as fd: - json_schema = json.loads(fd.read()) -validator = fastjsonschema.compile(json_schema) - class QobjDictField(SimpleNamespace): """A class used to represent a dictionary field in Qobj diff --git a/qiskit/qobj/pulse_qobj.py b/qiskit/qobj/pulse_qobj.py index 11d61b2654ba..9ab45d28d59a 100644 --- a/qiskit/qobj/pulse_qobj.py +++ b/qiskit/qobj/pulse_qobj.py @@ -16,17 +16,14 @@ """Module providing definitions of Pulse Qobj classes.""" import copy -import json import pprint from typing import Union, List -import warnings import numpy from qiskit.qobj.common import QobjDictField from qiskit.qobj.common import QobjHeader from qiskit.qobj.common import QobjExperimentHeader -from qiskit.qobj.common import validator class QobjMeasurementOption: @@ -559,20 +556,6 @@ def __init__(self, qobj_id, config, experiments, header=None): self.type = "PULSE" self.schema_version = "1.2.0" - def _validate_json_schema(self, out_dict): - class PulseQobjEncoder(json.JSONEncoder): - """A json encoder for pulse qobj""" - - def default(self, obj): - if isinstance(obj, numpy.ndarray): - return obj.tolist() - if isinstance(obj, complex): - return (obj.real, obj.imag) - return json.JSONEncoder.default(self, obj) - - json_str = json.dumps(out_dict, cls=PulseQobjEncoder) - validator(json.loads(json_str)) - def __repr__(self): experiments_str = [repr(x) for x in self.experiments] experiments_repr = "[" + ", ".join(experiments_str) + "]" @@ -595,7 +578,7 @@ def __str__(self): out += "%s" % str(experiment) return out - def to_dict(self, validate=False): + def to_dict(self): """Return a dictionary format representation of the Pulse Qobj. Note this dict is not in the json wire format expected by IBMQ and qobj @@ -619,10 +602,6 @@ def default(self, obj): json.dumps(qobj.to_dict(), cls=QobjEncoder) - Args: - validate (bool): When set to true validate the output dictionary - against the jsonschema for qobj spec. - Returns: dict: A dictionary representation of the PulseQobj object """ @@ -634,18 +613,6 @@ def default(self, obj): "type": self.type, "experiments": [x.to_dict() for x in self.experiments], } - if validate: - warnings.warn( - "The jsonschema validation included in qiskit-terra " - "is deprecated and will be removed in a future release. " - "If you're relying on this schema validation you should " - "pull the schemas from the Qiskit/ibmq-schemas and directly " - "validate your payloads with that", - DeprecationWarning, - stacklevel=2, - ) - self._validate_json_schema(out_dict) - return out_dict @classmethod diff --git a/qiskit/qobj/qasm_qobj.py b/qiskit/qobj/qasm_qobj.py index 4d79d450ecbb..f01ac1a1dab4 100644 --- a/qiskit/qobj/qasm_qobj.py +++ b/qiskit/qobj/qasm_qobj.py @@ -16,15 +16,11 @@ import copy import pprint -import json from types import SimpleNamespace -import warnings - -import numpy from qiskit.circuit.parameterexpression import ParameterExpression from qiskit.qobj.pulse_qobj import PulseQobjInstruction, PulseLibraryItem -from qiskit.qobj.common import QobjDictField, QobjHeader, validator +from qiskit.qobj.common import QobjDictField, QobjHeader class QasmQobjInstruction: @@ -577,20 +573,6 @@ def __init__(self, qobj_id=None, config=None, experiments=None, header=None): self.type = "QASM" self.schema_version = "1.3.0" - def _validate_json_schema(self, out_dict): - class QobjEncoder(json.JSONEncoder): - """A json encoder for qobj""" - - def default(self, obj): - if isinstance(obj, numpy.ndarray): - return obj.tolist() - if isinstance(obj, complex): - return (obj.real, obj.imag) - return json.JSONEncoder.default(self, obj) - - json_str = json.dumps(out_dict, cls=QobjEncoder) - validator(json.loads(json_str)) - def __repr__(self): experiments_str = [repr(x) for x in self.experiments] experiments_repr = "[" + ", ".join(experiments_str) + "]" @@ -613,7 +595,7 @@ def __str__(self): out += "%s" % str(experiment) return out - def to_dict(self, validate=False): + def to_dict(self): """Return a dictionary format representation of the QASM Qobj. Note this dict is not in the json wire format expected by IBMQ and qobj @@ -637,11 +619,6 @@ def default(self, obj): json.dumps(qobj.to_dict(), cls=QobjEncoder) - - Args: - validate (bool): When set to true validate the output dictionary - against the jsonschema for qobj spec. - Returns: dict: A dictionary representation of the QasmQobj object """ @@ -653,17 +630,6 @@ def default(self, obj): "type": "QASM", "experiments": [x.to_dict() for x in self.experiments], } - if validate: - warnings.warn( - "The jsonschema validation included in qiskit-terra is " - "deprecated and will be removed in a future release. " - "If you're relying on this schema validation you should " - "pull the schemas from the Qiskit/ibmq-schemas and directly " - "validate your payloads with that", - DeprecationWarning, - stacklevel=2, - ) - self._validate_json_schema(out_dict) return out_dict @classmethod diff --git a/qiskit/qobj/utils.py b/qiskit/qobj/utils.py index 2331f98d05bf..a689fc01e7e7 100644 --- a/qiskit/qobj/utils.py +++ b/qiskit/qobj/utils.py @@ -13,11 +13,6 @@ """Qobj utilities and enums.""" from enum import Enum, IntEnum -import warnings - -from fastjsonschema.exceptions import JsonSchemaException - -from qiskit.validation.jsonschema.exceptions import SchemaValidationError class QobjType(str, Enum): @@ -40,30 +35,3 @@ class MeasLevel(IntEnum): RAW = 0 KERNELED = 1 CLASSIFIED = 2 - - -def validate_qobj_against_schema(qobj): - """Validates a QObj against the .json schema. - - Args: - qobj (Qobj): Qobj to be validated. - - Raises: - SchemaValidationError: if the qobj fails schema validation - """ - warnings.warn( - "The jsonschema validation included in qiskit-terra is " - "deprecated and will be removed in a future release. " - "If you're relying on this schema validation you should " - "pull the schemas from the Qiskit/ibmq-schemas and directly " - "validate your payloads with that", - DeprecationWarning, - stacklevel=2, - ) - try: - qobj.to_dict(validate=True) - except JsonSchemaException as err: - raise SchemaValidationError( - f"Qobj validation failed. Specifically path: {err.path}" # pylint: disable=no-member - f" failed to fulfil {err.definition}" # pylint: disable=no-member - ) from err diff --git a/qiskit/schemas/backend_configuration_schema.json b/qiskit/schemas/backend_configuration_schema.json deleted file mode 100644 index 0b2deb698a99..000000000000 --- a/qiskit/schemas/backend_configuration_schema.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/backend_config_schema.json", - "description": "Qiskit device backend configuration", - "version": "1.4.3", - "definitions": { - "hamiltonian": { - "type": "object", - "description": "Hamiltonian of the backend", - "required": ["h_latex"], - "properties": { - "h_latex": { - "type": "string", - "description": "The Hamiltonian in latex form" - }, - "h_str": { - "type": "array", - "items": {"type": "string"}, - "description": "The Hamiltonian in machine readable form" - }, - "vars": { - "type": "object", - "description": "Variables in the h_str"}, - "osc": { - "type": "object", - "description": "Number of levels for each oscillator mode"} - } - - }, - "coreconfig": { - "type": "object", - "required": ["backend_name", "backend_version", "n_qubits", "basis_gates", "gates", "local", "simulator", "conditional", "memory", "max_shots"], - "properties": { - "backend_name": { - "type": "string", - "description": "Backend name" - }, - "sample_name": { - "type": "string", - "description": "Sample name" - }, - "backend_version": { - "type": "string", - "pattern": "[0-9]+.[0-9]+.[0-9]+$", - "description": "Backend version in the form X.X.X" - }, - "n_qubits": { - "type": "integer", - "description": "Number of qubits", - "minimum": 1, - "default": 1 - }, - "basis_gates": { - "type": "array", - "description": "List of basis gates names on the backend", - "items": {"type": "string"}, - "minItems": 0 - }, - "coupling_map": { - "type": "array", - "minItems": 1, - "items": {"type": "array", "minItems": 1, "items": {"type": "integer"}}, - "description": "Array grouping qubits that are physically coupled together on the backend" - }, - "gates": { - "type": "array", - "description": "List of basis gates on the backend", - "items": {"$ref": "#/definitions/gateconfig"}, - "minItems": 0 - }, - "local": { - "type": "boolean", - "description": "Backend is local or remote (true/false)" - }, - "simulator": { - "type": "boolean", - "description": "Backend is a simulator (true/false)", - "default": false - }, - "conditional": { - "type": "boolean", - "description": "Backend supports conditional operations (true/false)", - "default": false - }, - "memory": { - "type": "boolean", - "description": "Backend supports memory (true/false)", - "default": false - }, - "max_shots": { - "type": "integer", - "description": "Maximum number of shots supported", - "minimum": 1 - }, - "max_experiments": { - "type": "integer", - "description": "Maximum number of experiments supported", - "minimum": 1 - }, - "n_registers": { - "type": "integer", - "description": "Number of register slots available for feedback (if conditional is true)", - "minimum": 1, - "default": 1 - }, - "register_map": { - "type": "array", - "minItems": 1, - "items": {"type": "array", "minItems": 1, "items": {"enum": [0,1]}}, - "description": "An array of dimension n_qubits X n_registers that specifies whether a qubit can store a measurement in a certain register slot" - }, - "configurable": { - "type": "boolean", - "description": "Backend is configurable, if the backend is a simulator (true/false)", - "default": false - }, - "credits_required": { - "type": "boolean", - "description": "Backend requires credits to run a job (true/false)", - "default": false - }, - "online_date": { - "type": "string", - "format": "date-time", - "description": "Date the backend went online" - }, - "display_name": { - "type": "string", - "description": "Alternate name field for the backend" - }, - "description": { - "type": "string", - "description": "Description of the backend" - }, - "tags": { - "type": "array", - "minItems": 0, - "uniqueItems": true, - "items": { - "type": "string", - "examples": ["credits_required"] - } - }, - "rep_delay_range": { - "type": "array", - "minItems": 0, - "description": "Range of delay times between programs (microseconds) allowed by backend.", - "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "number", "minimum": 0}} - }, - "default_rep_delay": { - "type": "number", - "description": "Default rep delay.", - "minimum": 0 - }, - "dynamic_reprate_enabled": { - "type": "boolean", - "description": "Whether delay between programs can be set dynamically using 'rep_delay').", - "default": false - }, - "supported_instructions": { - "type": "array", - "minItems": 0, - "description": "Instructions supported by the backend.", - "items": {"type": "string"} - }, - "quantum_volume": { - "type": "integer", - "description": "Backend quantum volume", - "minimum": 1 - }, - "processor_type": { - "type": "object", - "required": ["family", "revision"], - "properties": { - "family": { - "type": "string", - "description": "Processor family indicates quantum chip architecture" - }, - "revision": { - "type": "string", - "description": "Revision number reflects design variants within a given processor family. Is typically a semantic versioning value without the patch value, eg., \"1.0\"." - }, - "segment": { - "type": "string", - "description": "Segment, if indicated, is used to distinguish different subsets of the qubit fabric/chip" - } - } - }, - "qubit_lo_range": { - "type": "array", - "minItems": 1, - "description": "Frequency range for the qubit LO", - "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "number"}} - }, - "meas_lo_range": { - "type": "array", - "minItems": 1, - "description": "Frequency range for the measurement LO", - "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "number"}} - } - } - }, - "openpulse_config":{ - "required": ["open_pulse","n_uchannels","hamiltonian","u_channel_lo", - "meas_levels","qubit_lo_range","meas_lo_range","dt","dtm", - "rep_times", "meas_kernels","discriminators"], - "properties": { - "open_pulse": { - "enum": [ true ], - "description": "The backend supports openPulse (true/false)"}, - "n_uchannels": { - "type": "integer", - "description": "Number of additional control channels", - "minimum": 0}, - "hamiltonian": { - "type": "object", - "required": ["h_latex"], - "description": "Hamiltonian of the backend", - "properties": { - "h_latex": { - "type": "string", - "description": "The Hamiltonian in latex form" - }, - "h_str": { - "type": "array", - "items": {"type": "string"}, - "description": "The Hamiltonian in machine readable form" - }, - "vars": { - "type": "object", - "description": "Variables in the h_str"}, - "osc": { - "type": "object", - "description": "Number of levels for each oscillator mode"} - } - }, - "u_channel_lo": { - "type": "array", - "minItems": 0, - "description": "Relationship of the U Channel LO's in terms of the qubit LO's", - "items": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "properties": { - "q": {"type": "integer"}, - "scale": {"$ref": "#/definitions/complexnumber"} - }} - } - }, - "meas_levels": { - "type": "array", - "minItems": 1, - "maxitems": 3, - "description": "Available measurement levels on the backend", - "items": {"type": "integer", "minimum": 0, "maximum": 2}}, - "dt": { - "type": "number", - "description": "Time discretization for the drive and U channels", - "minimum": 0}, - "dtm": { - "type": "number", - "description": "Time discretization for the measurement channels", - "minimum": 0}, - "rep_times": { - "type": "array", - "minItems": 1, - "description": "Program execution times (microseconds) supported by backend.", - "items": {"type": "number", "minimum": 0}}, - "meas_map": { - "type": "array", - "minItems": 1, - "description": "Grouping of measurement which are multiplexed", - "items": {"type": "array", "minItems": 1, "items": {"type": "integer", "minimum": 0}}}, - "channel_bandwidth": { - "type": "array", - "minItems": 2, - "description": "Bandwidth of all channels (qubit,measurement and U)", - "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "number"}}}, - "meas_kernels": { - "type": "array", - "minItems": 1, - "description": "Available measurement kernels", - "items": {"type": "string"}}, - "discriminators": { - "type": "array", - "minItems": 1, - "description": "Available discriminators", - "items": {"type": "string"}}, - "acquisition_latency": { - "type": "array", - "minItems": 1, - "description": "Array of dimension n_qubits x n_registers. Latency (in units of dt) to write a measurement result from qubit n into register slot m.", - "items": {"type": "array", "minItems": 1, "items": {"type": "integer"}}}, - "conditional_latency": { - "type": "array", - "minItems": 1, - "description": "Array of dimension n_channels [d->u->m] x n_registers. Latency (in units of dt) to do a conditional operation on channel n from register slot m", - "items": {"type": "array", "minItems": 1, "items": {"type": "number"}}}, - "parametric_pulses": { - "type": "array", - "minItems": 0, - "description": "A list of available parametric pulse shapes", - "items": {"type": "string"}}, - "channels": { - "type": "object", - "patternProperties": { - "^[a-z0-9]+$": { - "type": "object", - "properties": { - "type": {"type": "string"}, - "purpose": {"type": "string"}, - "operates": { - "type": "object", - "properties": { - "qubits": {"type": "array", "items": {"type": "integer", "minimum": 0}} - } - } - }} - }, - "description": "A dictionary where each entry represents a channel configuration and contains configuration values such as the channel's mapping to qubits." - } - }}, - "gateconfig": { - "type": "object", - "required": ["name","parameters","qasm_def"], - "properties": { - "name": { - "type": "string", - "description": "The gate name as it will be referred to in QASM" - }, - "parameters": { - "type": "array", - "minItems": 0, - "items": {"type": "string"}, - "description": "Variable names for the gate parameters (if any)" - }, - "coupling_map": { - "type": "array", - "minItems": 1, - "items": {"type": "array", "minItems": 1, "items": {"type": "integer"}}, - "description": "List of qubit groupings which are coupled by this gate" - }, - "qasm_def": { - "type": "string", - "description": "Definition of this gate in terms of QASM primitives U and CX" - }, - "conditional": { - "type": "boolean", - "description": "This specified gate supports conditional operations (true/false). If this is not specified, then the gate inherits the conditional property of the backend.", - "default": false - }, - "latency_map": { - "type": "array", - "minItems": 1, - "items": {"type": "array", "minItems": 1, "items": {"enum": [0,1]}}, - "description": "An array of dimension len(coupling_map) X n_registers that specifies (1 - fast, 0 - slow) the register latency conditional operations on the gate" - }, - "description": { - "type": "string", - "description": "Description of the gate operation" - } - }}, - "complexnumber": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [{"type": "number"},{"type": "number"}]} - }, - "oneOf": [ - {"allOf": [{"$ref": "#/definitions/coreconfig"}, - {"$ref": "#/definitions/openpulse_config"}]}, - {"allOf": [{"$ref": "#/definitions/coreconfig"}, - { - "required": ["open_pulse"], - "properties": { - "open_pulse": {"enum": [ false ]} - }}]} - ] -} diff --git a/qiskit/schemas/backend_properties_schema.json b/qiskit/schemas/backend_properties_schema.json deleted file mode 100644 index 1fc3157fc131..000000000000 --- a/qiskit/schemas/backend_properties_schema.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/backend_props_schema.json", - "description": "OpenQuantum backend properties schema", - "version": "1.0.0", - "definitions": { - "gate": { - "properties": { - "gate": { - "type": "string" - }, - "parameters": { - "items": { - "$ref": "#/definitions/nduv" - }, - "minItems": 1, - "type": "array" - }, - "qubits": { - "items": { - "type": "integer" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "qubits", - "gate", - "parameters" - ], - "type": "object" - }, - "general_parameters": { - "description": "General system parameters", - "items": { - "$ref": "#/definitions/nduv" - }, - "minItems": 0, - "type": "array" - }, - "nduv": { - "description": "Recorded parameter as a name-date-unit-value", - "properties": { - "date": { - "format": "date-time", - "type": "string" - }, - "name": { - "type": "string" - }, - "unit": { - "type": "string" - }, - "value": { - "type": "number" - } - }, - "required": [ - "name", - "date", - "unit", - "value" - ], - "type": "object" - } - }, - "properties": { - "backend_name": { - "description": "Backend name", - "type": "string" - }, - "backend_version": { - "description": "Backend version in the form X.X.X", - "pattern": "[0-9]+.[0-9]+.[0-9]+$", - "type": "string" - }, - "gates": { - "description": "System gate parameters", - "items": { - "$ref": "#/definitions/gate" - }, - "minItems": 1, - "type": "array" - }, - "general": { - "$ref": "#/definitions/general_parameters" - }, - "last_update_date": { - "description": "Last date/time that a property was updated.", - "format": "date-time", - "type": "string" - }, - "qubits": { - "description": "System qubit parameters", - "items": { - "items": { - "$ref": "#/definitions/nduv" - }, - "minItems": 1, - "type": "array" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "backend_name", - "backend_version", - "last_update_date", - "qubits", - "gates", - "general" - ], - "type": "object" -} diff --git a/qiskit/schemas/backend_status_schema.json b/qiskit/schemas/backend_status_schema.json deleted file mode 100644 index f00712e584b8..000000000000 --- a/qiskit/schemas/backend_status_schema.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/backendstatus_schema.json", - "description": "OpenQuantum backend status schema", - "version": "1.0.0", - "type": "object", - "required": [ - "backend_name", - "backend_version", - "operational", - "pending_jobs", - "status_msg" - ], - "properties": { - "backend_name": { - "type": "string", - "description": "Backend name" - }, - "backend_version": { - "description": "Backend version in the form X.X.X", - "pattern": "[0-9]+.[0-9]+.[0-9]+$", - "type": "string" - }, - "operational": { - "type": "boolean", - "description": "Backend operational and accepting jobs (true/false)" - }, - "pending_jobs": { - "type": "integer", "minimum": 0, - "description": "Number of pending jobs on the backend" - }, - "status_msg": { - "type": "string", - "description": "Status message" - } - } -} diff --git a/qiskit/schemas/default_pulse_configuration_schema.json b/qiskit/schemas/default_pulse_configuration_schema.json deleted file mode 100644 index b5dbce194ba4..000000000000 --- a/qiskit/schemas/default_pulse_configuration_schema.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/default_pulse_config_schema.json", - "description": "Default OpenPulse backend configuration", - "version": "1.0.0", - "definitions": { - "cmd_def": { - "description": "OpenPulse command definition schema. Defines QASM commands in terms of pulses.", - "properties": { - "name": { - "description": "QASM command name", - "type": "string" - }, - "qubits": { - "description": "Qubits to which this command def applies", - "items": { - "minimum": 0, - "type": "integer" - }, - "minItems": 1, - "type": "array" - }, - "sequence": { - "description": "Sequence of pulse instructions", - "items": { - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "complex": { - "description": "JSON representation of a complex number", - "items": { - "type": "number" - }, - "maxItems": 2, - "minItems": 2, - "type": "array" - }, - "complex_array": { - "description": "JSON representation of a complex vector", - "items": { - "$ref": "#/definitions/complex" - }, - "minItems": 1, - "type": "array" - }, - "complex_matrix": { - "description": "JSON representation of a complex matrix", - "items": { - "$ref": "#/definitions/complex_array" - }, - "minItems": 1, - "type": "array" - }, - "discriminator": { - "description": "Default measurement kernel", - "properties": { - "name": { - "type": "string" - }, - "params": { - "type": "object" - } - }, - "type": "object" - }, - "meas_kernel": { - "description": "Default measurement kernel", - "properties": { - "name": { - "type": "string" - }, - "params": { - "type": "object" - } - }, - "type": "object" - } - }, - "properties": { - "buffer": { - "default": 1, - "description": "Default buffer time between pulses", - "minimum": 0, - "type": "integer" - }, - "cmd_def": { - "description": "Backend calibrated QASM to Pulse definitions", - "items": { - "$ref": "#/definitions/cmd_def" - }, - "type": "array" - }, - "discriminator": { - "$ref": "#/definitions/discriminator" - }, - "meas_freq_est": { - "description": "Backend calibrated qubit frequencies", - "items": { - "type": "number" - }, - "minItems": 1, - "type": "array" - }, - "meas_kernel": { - "$ref": "#/definitions/meas_kernel" - }, - "pulse_library": { - "description": "Backend pulse library", - "items": { - "properties": { - "name": { - "description": "Pulse name", - "type": "string" - }, - "samples": { - "$ref": "#/definitions/complex_array" - } - }, - "required": [ - "name", - "samples" - ], - "type": "object" - }, - "type": "array" - }, - "qubit_freq_est": { - "description": "Backend calibrated qubit frequencies", - "items": { - "type": "number" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "qubit_freq_est", - "meas_freq_est", - "pulse_library", - "buffer" - ], - "type": "object" -} diff --git a/qiskit/schemas/deprecated/backends/backend_calibration_example.json b/qiskit/schemas/deprecated/backends/backend_calibration_example.json deleted file mode 100644 index 2e94fe332a00..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_calibration_example.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "lastUpdateDate": "2017-08-31T08:32:12Z", - "multiQubitGates": [ - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.030172186236362503 - }, - "name": "CX0_1", - "qubits": [ - 0, - 1 - ], - "type": "CX" - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.02439953511237683 - }, - "name": "CX0_2", - "qubits": [ - 0, - 2 - ], - "type": "CX" - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.0336469083512502 - }, - "name": "CX1_2", - "qubits": [ - 1, - 2 - ], - "type": "CX" - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.049009587345366284 - }, - "name": "CX3_2", - "qubits": [ - 3, - 2 - ], - "type": "CX" - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.03241957543776744 - }, - "name": "CX3_4", - "qubits": [ - 3, - 4 - ], - "type": "CX" - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.031193291229275444 - }, - "name": "CX4_2", - "qubits": [ - 4, - 2 - ], - "type": "CX" - } - ], - "qubits": [ - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.0013737021608475342 - }, - "name": "Q0", - "readoutError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.05 - } - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.0013737021608475342 - }, - "name": "Q1", - "readoutError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.07 - } - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.0024043886349084387 - }, - "name": "Q2", - "readoutError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.03 - } - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.001889001411209068 - }, - "name": "Q3", - "readoutError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.056 - } - }, - { - "gateError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.00197489316929661 - }, - "name": "Q4", - "readoutError": { - "date": "2017-08-31T08:32:12Z", - "value": 0.053 - } - } - ] -} diff --git a/qiskit/schemas/deprecated/backends/backend_calibration_schema.json b/qiskit/schemas/deprecated/backends/backend_calibration_schema.json deleted file mode 100644 index a4b7f9dc31cf..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_calibration_schema.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/device-file/calibration-01/schema#", - "description": "Qiskit device backend calibration", - "definitions": { - "errorParameter": { - "description": "recorded error value", - "type": "object", - "required": [ - "date", - "value" - ], - "properties": { - "date": { - "type": "string", - "format": "date-time" - }, - "value": { - "type": "number" - } - } - } - }, - "type": "object", - "required": [ - "lastUpdateDate", - "multiQubitGates", - "qubits" - ], - "properties": { - "lastUpdateData": { - "description": "date of last calibration routine", - "type": "string", - "format": "date-time" - }, - "multiQubitGates": { - "title": "Multi-qubit gate error parameters", - "type": "array", - "minLength": 0, - "items": { - "type": "object", - "required": [ - "name", - "gateError", - "qubits", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "gateError": { - "$ref": "#/definitions/errorParameter" - }, - "qubits": { - "type": "array", - "minLength": 2, - "items": { - "type": "integer", - "minimum": 0 - } - }, - "type": { - "type": "string" - } - } - } - }, - "qubits": { - "title": "Single-qubit gate error parameters", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": [ - "name", - "gateError", - "readoutError" - ], - "properties": { - "name": { - "type": "string" - }, - "gateError": { - "$ref": "#/definitions/errorParameter" - }, - "readoutError": { - "$ref": "#/definitions/errorParameter" - } - } - } - } - } -} diff --git a/qiskit/schemas/deprecated/backends/backend_configuration_example_old.json b/qiskit/schemas/deprecated/backends/backend_configuration_example_old.json deleted file mode 100644 index 47085afe11b6..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_configuration_example_old.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "ibmqx2", - "version": "1", - "url": "https://ibm.biz/qiskit-ibmqx2", - "simulator": false, - "local": false, - "description": "5 qubit transmon bowtie chip 2", - "nQubits": 5, - "couplingMap": [ [0, 1], [0, 2], - [1, 2], - [3, 2], [3, 4], - [4, 2] ], - "basisGates": "u1,u2,u3,cx,id", - "onlineDate": "2017-01-10", - "chipName": "Sparrow" -} diff --git a/qiskit/schemas/deprecated/backends/backend_configuration_schema_old_py.json b/qiskit/schemas/deprecated/backends/backend_configuration_schema_old_py.json deleted file mode 100644 index ba2dc71d423a..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_configuration_schema_old_py.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/backend/configuration-01/schema#", - "description": "Qiskit device backend configuration", - "type": "object", - "required": [ - "name", - "coupling_map", - "basis_gates", - "simulator", - "local" - ], - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - }, - "simulator": { - "type": "boolean", - "default": false - }, - "local": { - "type": "boolean", - "default": false - }, - "description": { - "type": "string" - }, - "n_qubits": { - "type": "integer", - "minimum": 1 - }, - "coupling_map": { - "oneOf": [ - { - "type": "string", - "enum": [ - "all-to-all" - ] - }, - { - "type": "array", - "items": { - "type": "array", - "item": "integer", - "minItems": 2, - "maxItems": 2, - "uniqueItems": true - }, - "uniqueItems": true - } - ] - }, - "basis_gates": { - "type": "string" - }, - "online_date": { - "type": "string", - "format": "date" - }, - "chip_name": { - "type": "string" - } - } -} diff --git a/qiskit/schemas/deprecated/backends/backend_parameters_example.json b/qiskit/schemas/deprecated/backends/backend_parameters_example.json deleted file mode 100644 index 56c3b82fb9ab..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_parameters_example.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "fridgeParameters": { - "Temperature": { - "date": "2017-08-31T08:32:12Z", - "unit": "K", - "value": 0.0161 - }, - "cooldownDate": "2017-05-07" - }, - "lastUpdateDate": "2017-08-31T08:32:12Z", - "qubits": [ - { - "T1": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 46.9 - }, - "T2": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 44.4 - }, - "buffer": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 6.7 - }, - "frequency": { - "date": "2017-08-31T08:32:12Z", - "unit": "GHz", - "value": 5.27218 - }, - "gateTime": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 83.3 - }, - "name": "Q0" - }, - { - "T1": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 28.3 - }, - "T2": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 27.4 - }, - "buffer": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 6.7 - }, - "frequency": { - "date": "2017-08-31T08:32:12Z", - "unit": "GHz", - "value": 5.2146 - }, - "gateTime": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 83.3 - }, - "name": "Q1" - }, - { - "T1": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 59.9 - }, - "T2": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 98.6 - }, - "buffer": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 6.7 - }, - "frequency": { - "date": "2017-08-31T08:32:12Z", - "unit": "GHz", - "value": 5.0289 - }, - "gateTime": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 83.3 - }, - "name": "Q2" - }, - { - "T1": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 50.5 - }, - "T2": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 57.7 - }, - "buffer": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 6.7 - }, - "frequency": { - "date": "2017-08-31T08:32:12Z", - "unit": "GHz", - "value": 5.29705 - }, - "gateTime": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 83.3 - }, - "name": "Q3" - }, - { - "T1": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 67.5 - }, - "T2": { - "date": "2017-08-31T08:32:12Z", - "unit": "\u00b5s", - "value": 98.8 - }, - "buffer": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 6.7 - }, - "frequency": { - "date": "2017-08-31T08:32:12Z", - "unit": "GHz", - "value": 5.05575 - }, - "gateTime": { - "date": "2017-08-31T08:32:12Z", - "unit": "ns", - "value": 83.3 - }, - "name": "Q4" - } - ] -} \ No newline at end of file diff --git a/qiskit/schemas/deprecated/backends/backend_parameters_schema.json b/qiskit/schemas/deprecated/backends/backend_parameters_schema.json deleted file mode 100644 index e3cb5ec62b3e..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_parameters_schema.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/device-file/parameters-01/schema#", - "description": "Qiskit device backend parameters", - "definitions": { - "measuredParameter": { - "description": "recorded parameter value", - "type": "object", - "required": [ - "date", - "unit", - "value" - ], - "properties": { - "date": { - "type": "string", - "format": "date-time" - }, - "unit": { - "type": "string" - }, - "value": { - "type": "number" - } - } - } - }, - "type": "object", - "required": [ - "fridgeParameters", - "lastUpdateDate", - "qubits" - ], - "properties": { - "fridgeParameters": { - "type": "object", - "required": [ - "Temperature", - "cooldownDate" - ], - "properties": { - "Temperature": { - "$ref": "#/definitions/measuredParameter" - } - }, - "cooldownDate": { - "type": "string", - "format": "date-time" - } - }, - "lastUpdateData": { - "type": "string", - "format": "date-time" - }, - "qubits": { - "title": "System qubit parameters", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": [ - "T1", - "T2", - "buffer", - "frequency", - "gateTime", - "name" - ], - "properties": { - "T1": { - "$ref": "#/definitions/measuredParameter" - }, - "T2": { - "$ref": "#/definitions/measuredParameter" - }, - "buffer": { - "$ref": "#/definitions/measuredParameter" - }, - "frequency": { - "$ref": "#/definitions/measuredParameter" - }, - "gateTime": { - "$ref": "#/definitions/measuredParameter" - }, - "name": { - "type": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/qiskit/schemas/deprecated/backends/backend_status_example.json b/qiskit/schemas/deprecated/backends/backend_status_example.json deleted file mode 100644 index 9116f3ef9e96..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_status_example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "ibmqx2", - "available": false, - "pendingJobs": 261 -} \ No newline at end of file diff --git a/qiskit/schemas/deprecated/backends/backend_status_schema_py.json b/qiskit/schemas/deprecated/backends/backend_status_schema_py.json deleted file mode 100644 index bb61f312fc10..000000000000 --- a/qiskit/schemas/deprecated/backends/backend_status_schema_py.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/backend/configuration-01/schema#", - "description": "Qiskit backend states", - "type": "object", - "required": [ - "name", - "available" - ], - "properties": { - "name": { - "type": "string" - }, - "pending_jobs":{ - "type": "number" - }, - "available": { - "type": "boolean", - "default": true - } - } -} diff --git a/qiskit/schemas/deprecated/qobj/qobj_core_schema.json b/qiskit/schemas/deprecated/qobj/qobj_core_schema.json deleted file mode 100644 index 3651c6cca237..000000000000 --- a/qiskit/schemas/deprecated/qobj/qobj_core_schema.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/qobj/core-01/schema#", - "type": "object", - "required": ["id", "experiments"], - "properties": { - "type": { - "type": "string", - "enum": ["QASM", "PULSE"] - }, - "id": {"type": "string"}, - "config": { - "title": "Qobj-level configuration", - "description": "Configuration options that apply to all experiments in this qobj. For options that may be set on a per-experiment basis, these are the defaults.", - "type": "object", - "properties": { - "backend": { - "type": "string", - "description": "The backend this qobj was generated for. It may also be able to execute on other backends." - }, - "max_credits": {"type": "integer", "default": 3}, - "seed": {"type": "integer"}, - "shots": {"type": "integer", "minimum": 1} - } - }, - "experiments": { - "title": "Experiments to run", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": ["header", "instructions"], - "properties": { - "name": {"type": "string"}, - "config": { - "title": "Experiment-level configuration", - "description": "Configuration options that apply to only this experiment. Overrides settings from the qobj-level config", - "type": "object", - "properties": { - "seed": {"type": "integer"}, - "shots": {"type": "integer", "minimum": 1} - } - }, - "header": { - "$ref": "#/definitions/header" - }, - "instructions": { - "$ref": "#/definitions/instructions" - } - } - } - } - }, - "definitions": { - "header": { - "description": "Header information about the experiment. Defines the classical and quantum bits", - "required": ["number_of_qubits", "number_of_clbits", "qubit_labels", "clbit_labels"], - "properties": { - "number_of_qubits": { - "type": "integer", - "minimum": 1 - }, - "number_of_clbits": { - "type": "integer", - "minimum": 0 - }, - "qubit_labels": { - "title": "Map physical qubits to qregs", - "description": "A list of length number_of_qubits, where each element is either [qreg_name, n] to identify the corresponding physical qubit as the n-th qubit of qreg qreg_name, or null to identify that the corresponding physical qubit has no corresponding qreg", - "examples": [ - [["q", 0], ["q", 1], ["r", 0], ["r", 1], ["r", 2]], - [["q", 2], null, ["q", 1], null, ["q", 0]] - ], - "type": "array", - "minItems": 1, - "items": { - "type": ["array", "null"], - "minItems": 2, - "maxItems": 2, - "items": [ - { - "title": "qreg", - "type": "string", - "minLength": 1 - }, - { - "title": "qubit number", - "description": "The qubit number within the qreg", - "type": "integer", - "minimum": 0 - }] - } - }, - "clbit_labels": { - "title": "Map physical clbits to clregs", - "description": "A list of pairs [clreg_name, size], to allocate the next size contiguous clbits to clreg clreg_name. The sum of the size-s should equal number_of_clbits", - "examples": [ - [["c", 2], ["d", 3]] - ], - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": [{ - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [{ - "title": "clreg", - "type": "string", - "minLength": 1 - }, { - "title": "size", - "description": "Size of the clreg", - "type": "integer", - "minimum": 1 - }] - }] - } - }, - "_constraints": "sum(x[1] for x in clbit_labels) == number_of_clbits" - }, - "instructions": { - "description": "The instructions that describe the quantum experiment", - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": {"type": "string"}, - "qubits": { - "type": "array", - "uniqueItems": true, - "items": {"type": "integer", "minimum": 0} - }, - "params": {"type": "array", "items": {"type": "number"}}, - "texparams": {"type": "array", "items": {"type": "string"}}, - "clbits": { - "type": "array", - "uniqueItems": true, - "items": {"type": "integer", "minimum": 0}}, - "key": {"type": "string"}, - "conditional": { - "type": "object", - "required": ["type", "mask", "val"], - "properties": { - "type": {"type": "string"}, - "mask": {"$ref": "#/definitions/hexstring"}, - "val": {"$ref": "#/definitions/hexstring"} - } - } - } - } - }, - "hexstring": {"type": "string", "pattern": "^0x[0-9a-fA-F]+$"} - } -} diff --git a/qiskit/schemas/deprecated/qobj/qobj_example.json b/qiskit/schemas/deprecated/qobj/qobj_example.json deleted file mode 100644 index 102d4a7156f2..000000000000 --- a/qiskit/schemas/deprecated/qobj/qobj_example.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "type": "QASM", - "id": "S4cmORrEe5OtQXwecLQSCLmDpw13NC", - "config": { - "backend": "ibmqx4", - "max_credits": 3, - "shots": 1024 - }, - "experiments": [ - { - "name": "test", - "config": { - "shots": 2048 - }, - "header": { - "number_of_qubits": 5, - "qubit_labels": [["qr",0], ["qr",1], ["qr",2],["qr",3],["qr",4]], - "number_of_clbits": 5, - "clbit_labels": [["cr",5]] - }, - "instructions": [ - { - "name": "u2", - "params": [0.0, 3.141592653589793], - "texparams": ["0","\\pi"], - "qubits": [1] - }, - { - "name": "measure", - "qubits": [1], - "clbits": [1] - } - ] - } - ] -} diff --git a/qiskit/schemas/deprecated/qobj/qobj_generic_schema.json b/qiskit/schemas/deprecated/qobj/qobj_generic_schema.json deleted file mode 100644 index 17f2aa62a389..000000000000 --- a/qiskit/schemas/deprecated/qobj/qobj_generic_schema.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/qobj/generic-01/schema#", - "properties": { - "experiments": { - "properties": { - "instructions": { - "$ref": "#/definitions/generic_instructions" - } - } - } - }, - "definitions": { - "generic_instructions": { - "anyOf": [{ - "title": "3-param 1Q op", - "required": ["qubits", "params"], - "properties": { - "name": {"enum": ["u3", "U"]}, - "qubits": {"maxItems": 1}, - "clbits": {"maxItems": 0}, - "params": {"minItems": 3, "maxItems": 3}, - "texparams": {"minItems": 3, "maxItems": 3} - } - }, { - "title": "fixed 1Q op", - "required": ["qubits"], - "properties": { - "name": {"enum": ["reset", "id", "h", "s", "sdg", "t", "tdg", "x", "y", "z"]}, - "qubits": {"maxItems": 1}, - "clbits": {"maxItems": 0}, - "params": {"maxItems": 0}, - "texparams": {"maxItems": 0} - } - }, { - "title": "1-param 1Q op", - "required": ["qubits", "params"], - "properties": { - "name": {"enum": ["u1", "rx", "ry", "rz"]}, - "qubits": {"maxItems": 1}, - "clbits": {"maxItems": 0}, - "params": {"minItems": 1, "maxItems": 1}, - "texparams": {"minItems": 1, "maxItems": 1} - } - }, { - "title": "2-param 1Q op", - "required": ["qubits", "params"], - "properties": { - "name": {"enum": ["u2"]}, - "qubits": {"maxItems": 1}, - "clbits": {"maxItems": 0}, - "params": {"minItems": 2, "maxItems": 2}, - "texparams": {"minItems": 2, "maxItems": 2} - } - }, { - "title": "fixed 2Q gate", - "required": ["qubits"], - "properties": { - "name": {"enum": ["cx", "CX", "cy", "cz", "ch", "swap"]}, - "qubits": {"description": "[control, target]", "minItems": 2, "maxItems": 2}, - "clbits": {"maxItems": 0}, - "params": {"maxItems": 0}, - "texparams": {"maxItems": 0} - } - }, { - "title": "1-param 2Q controlled gate", - "required": ["qubits", "params"], - "properties": { - "name": {"enum": ["cu1", "crz"]}, - "qubits": {"description": "[control, target]", "minItems": 2, "maxItems": 2}, - "clbits": {"maxItems": 0}, - "params": {"minItems": 1, "maxItems": 1}, - "texparams": {"minItems": 1, "maxItems": 1} - } - }, { - "title": "3-param 2Q controlled gate", - "required": ["qubits", "params"], - "properties": { - "name": {"enum": ["cu3"]}, - "qubits": {"description": "[control, target]", "minItems": 2, "maxItems": 2}, - "clbits": {"maxItems": 0}, - "params": {"minItems":3, "maxItems": 3}, - "texparams": {"minItems":3, "maxItems": 3} - } - }, { - "title": "fixed 3Q doubly controlled gate", - "required": ["qubits"], - "properties": { - "name": {"enum": ["ccx"]}, - "qubits": {"description": "[control, control, target]", "minItems": 3, "maxItems": 3}, - "clbits": {"maxItems": 0}, - "params": {"maxItems": 0}, - "texparams": {"maxItems": 0} - } - }, { - "title": "measurement", - "required": ["qubits", "clbits"], - "properties": { - "name": {"enum": ["measure"]}, - "qubits": {"maxItems": 1}, - "clbits": {"minItems": 1, "maxItems": 1}, - "params": {"maxItems": 0}, - "texparams": {"maxItems": 0} - } - }, { - "title": "barrier", - "required": ["qubits"], - "properties": { - "name": {"enum": ["barrier"]}, - "clbits": {"maxItems": 0}, - "params": {"maxItems": 0}, - "texparams": {"maxItems": 0} - } - }, { - "description": "Operations named with leading # are pragma-like (safe to ignore by backends that don't understand them).", - "properties": { - "name": { - "pattern": "^#.+" - } - } - }, { - "description": "Operations named with leading _ are non-generic (specific to certain backends) and not specified here. Not safe to ignore.", - "properties": { - "name": { - "pattern": "^_.+" - } - } - }] - } - } -} - diff --git a/qiskit/schemas/deprecated/result/result_example.json b/qiskit/schemas/deprecated/result/result_example.json deleted file mode 100644 index b49d978c64c7..000000000000 --- a/qiskit/schemas/deprecated/result/result_example.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "backend": "qasm_simulator", - "cpp_simulator_kernel": "qasm_simulator_cpp", - "id": "test", - "result": [{ - "data": { - "counts": { - "00": 1000 - }, - "snapshots": { - "0": { - "quantum_state": [[[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]] - } - }, - "time_taken": 0.0013900000000000002 - }, - "name": "test", - "seed": 1, - "shots": 1000, - "status": "DONE", - "success": true - }], - "status": "COMPLETED", - "success": true, - "time_taken": 0.016975 -} diff --git a/qiskit/schemas/deprecated/result/result_schema.json b/qiskit/schemas/deprecated/result/result_schema.json deleted file mode 100644 index 7606fbbdf752..000000000000 --- a/qiskit/schemas/deprecated/result/result_schema.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://qiskit.org/qobj/results-01/schema#", - "title": "qobj results", - "description": "The results of executing a qobj", - "type": "object", - "required": ["backend", "id", "status"], - "properties": { - "backend": { - "type": "string", - "description": "Backend who produced this result" - }, - "id": { - "type": "string", - "description": "Job id passed back from the input qobj" - }, - "execution_id": { - "type": "string", - "description": "Unique execution id. May be useful for matching with backend logfiles, etc" - }, - "date": { - "type": "string", - "format": "date-time", - "description": "Date/time of job execution" - }, - "result": { - "type": "array", - "description": "Corresponding results for array of experiments of the input qobj", - "items": { - "type": "object", - "required": ["status", "success"], - "properties": { - "success": { - "type": "boolean", - "description": "If true, we can trust results for this experiment." - }, - "status": { - "type": "string", - "description": "Human-readable description of status of this experiment" - }, - "name": { - "type": "string", - "description": "Experiment name" - }, - "seed": { - "type": "string", - "description": "Experiment-level random seed" - }, - "shots": { - "type": "string", - "description": "Experiment-level number of shots" - }, - "data": { - "type": "object", - "properties": { - "counts": { - "type": "object", - "description": "Histogram of results", - "example": {"01011": 10, "10001": 102}, - "additionalProperties": { - "type": "integer", - "minimum": 0 - } - }, - "snapshots": { - "type": "object", - "description": "Snapshot of simulator internal representation", - "example": { - "0": { - "statevector": [[0,0.707], [0,0], [0,0], [0.707,0]], - "probabilities": [0.5, 0, 0, 0.5] - } - }, - "properties": { - "type": "object", - "properties": { - } - } - } - } - } - } - } - } - }, - "success": { - "type": "boolean", - "description": "True if complete input qobj executed correctly. (Implies each experiment success)" - }, - "status": { - "type": "string", - "description": "Human-readable status of complete qobj execution" - } -} diff --git a/qiskit/schemas/examples/backend_configuration_openpulse_example.json b/qiskit/schemas/examples/backend_configuration_openpulse_example.json deleted file mode 100644 index a90670b58a57..000000000000 --- a/qiskit/schemas/examples/backend_configuration_openpulse_example.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "backend_name": "quantumbackend1", - "sample_name": "sample1", - "backend_version": "1.1.1", - "n_qubits": 3, - "basis_gates": ["u1","u2","u3","cx"], - "coupling_map": [[0,1,2]], - "gates": [ - {"name": "u1", - "parameters": ["lambda"], - "coupling_map": [[0],[1],[2]], - "qasm_def": "gate u1(lambda) q { U(0,0,lambda) q; }", - "latency_map": [[1,1],[1,1],[0,1]]}, - {"name": "u2", - "parameters": ["phi","lambda"], - "coupling_map": [[0],[1],[2]], - "qasm_def": "gate u2(phi,lambda) q { U(pi/2,phi,lambda) q; }", - "latency_map": [[1,1],[1,1],[0,1]]}, - {"name": "u3", - "parameters": ["theta","phi","lambda"], - "coupling_map": [[0],[1],[2]], - "qasm_def": "u3(theta,phi,lambda) q { U(theta,phi,lambda) q; }", - "latency_map": [[1,1],[1,1],[0,1]]}, - {"name": "cx", - "parameters": [], - "coupling_map": [[0,1],[1,2]], - "qasm_def": "gate cx q1,q2 { CX q1,q2; }", - "latency_map": [[1,1],[0,1]]} - ], - "local": false, - "simulator": false, - "conditional": true, - "memory": true, - "max_shots": 8192, - "n_registers": 2, - "register_map": [[1,1],[1,1],[0,1]], - "open_pulse": true, - "tags": ["credits_required","readable_hamiltonian","all_meas"], - "n_uchannels": 2, - "hamiltonian": { - "h_latex": "H = \\sum_{i}^{N} D_i(t) \\sigma_i^{X} +\\sum_{i}^{N} 2\\pi \\nu_i \\sigma_i^{+}\\sigma_i^{-}", - "h_str": ["__SUM[i,0,N,_X{i}_||_D{i}_]","__SUM[i,0,N,2*pi*_v{i}_*_O{i}_]"], - "vars": {}, - "osc": {} - }, - "u_channel_lo": [[{"q": 0, "scale": [0,1]}],[{"q": 1, "scale": [1.0,0]}, {"q": 2, "scale": [-1.0,0]}]], - "meas_levels": [0,1,2], - "qubit_lo_range": [[5,6],[5,6],[5,6]], - "meas_lo_range": [[6.5,7.5],[6.5,7.5],[6.5,7.5]], - "dt": 1, - "dtm": 10, - "rep_times": [1000,100,50], - "meas_map": [[0],[1],[2]], - "channel_bandwidth": [[-0.5,0.5],[-0.5,0.5],[-0.5,0.5],[-0.1,0.1],[-0.1,0.1],[-0.1,0.1],[-0.2,0.2],[-0.1,0.3]], - "meas_kernels": ["kern1","kern2"], - "discriminators": ["disc1","dis2"], - "acquisition_latency": [[100,120],[90,150],[500,100]], - "conditional_latency": [[200,200],[190,160],[500,100],[200,200],[190,160],[200,200],[190,160],[500,100]], - "parametric_pulses": ["constant", "gaussian_square", "gaussian"] -} diff --git a/qiskit/schemas/examples/backend_configuration_openqasm_example.json b/qiskit/schemas/examples/backend_configuration_openqasm_example.json deleted file mode 100644 index 58586a643d4c..000000000000 --- a/qiskit/schemas/examples/backend_configuration_openqasm_example.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "backend_name": "quantumbackend1", - "sample_name": "sample1", - "backend_version": "1.2.0", - "n_qubits": 3, - "basis_gates": ["u1","u2","u3","cx"], - "coupling_map": [[0,1,2]], - "gates": [ - {"name": "u1", - "parameters": ["lambda"], - "coupling_map": [[0],[1],[2]], - "qasm_def": "gate u1(lambda) q { U(0,0,lambda) q; }", - "conditional": false}, - {"name": "u2", - "parameters": ["phi","lambda"], - "coupling_map": [[0],[1],[2]], - "qasm_def": "gate u2(phi,lambda) q { U(pi/2,phi,lambda) q; }", - "latency_map": [[1],[1],[1]]}, - {"name": "u3", - "parameters": ["theta","phi","lambda"], - "coupling_map": [[0],[1],[2]], - "qasm_def": "u3(theta,phi,lambda) q { U(theta,phi,lambda) q; }", - "latency_map": [[1],[1],[1]]}, - {"name": "cx", - "parameters": [], - "coupling_map": [[0,1],[1,2]], - "qasm_def": "gate cx q1,q2 { CX q1,q2; }", - "latency_map": [[1],[0]]} - ], - "local": false, - "simulator": false, - "conditional": true, - "memory": true, - "max_shots": 8192, - "n_registers": 1, - "register_map": [[1],[1],[1]], - "credits_required": false, - "open_pulse": false, - "dt": 1.33, - "dtm": 10.5 -} diff --git a/qiskit/schemas/examples/backend_configuration_openqasm_simulator_example.json b/qiskit/schemas/examples/backend_configuration_openqasm_simulator_example.json deleted file mode 100644 index 918d7687dd53..000000000000 --- a/qiskit/schemas/examples/backend_configuration_openqasm_simulator_example.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "backend_name": "quantumsimbackend1", - "backend_version": "1.2.0", - "n_qubits": 32, - "basis_gates": ["u1","u2","u3","cx"], - "gates": [ - {"name": "u1", - "parameters": ["lambda"], - "qasm_def": "gate u1(lambda) q { U(0,0,lambda) q; }"}, - {"name": "u2", - "parameters": ["phi","lambda"], - "qasm_def": "gate u2(phi,lambda) q { U(pi/2,phi,lambda) q; }"}, - {"name": "u3", - "parameters": ["theta","phi","lambda"], - "qasm_def": "u3(theta,phi,lambda) q { U(theta,phi,lambda) q; }"}, - {"name": "cx", - "parameters": [], - "qasm_def": "gate cx q1,q2 { CX q1,q2; }"} - ], - "local": true, - "simulator": true, - "conditional": true, - "memory": true, - "max_shots": 8192, - "open_pulse": false, - "dt": 1.33, - "dtm": 10.5 -} diff --git a/qiskit/schemas/examples/backend_properties_example.json b/qiskit/schemas/examples/backend_properties_example.json deleted file mode 100644 index bc544d59522d..000000000000 --- a/qiskit/schemas/examples/backend_properties_example.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "backend_name": "ibmqx5", - "backend_version": "1.1.1", - "last_update_date": "2018-04-02 15:00:00Z", - "qubits": [ - [ - {"name": "T1", "date": "2018-04-02 15:00:00Z", "unit": "us", "value": 60}, - {"name": "T2", "date": "2018-04-02 15:00:00Z", "unit": "us", "value": 60}, - {"name": "frequency", "date": "2018-04-02 15:00:00Z", "unit": "GHz", "value": 5.2} - ], - [ - {"name": "T1", "date": "2018-04-02 15:00:00Z", "unit": "us", "value": 60}, - {"name": "T2", "date": "2018-04-02 15:00:00Z", "unit": "us", "value": 60}, - {"name": "frequency", "date": "2018-04-02 15:00:00Z", "unit": "us", "value": 5.2} - ] - ], - "gates": [ - {"qubits": [0], "gate": "u2", "parameters": [ - {"name": "gate_error", "date": "2018-04-02 15:00:00Z", "unit": "", "value": 0.002}] - }, - {"qubits": [1], "gate": "u2", "parameters": [ - {"name": "gate_error", "date": "2018-04-02 15:00:00Z", "unit": "", "value": 0.002}] - }, - {"qubits": [0,1], "gate": "cx", "parameters": [ - {"name": "gate_error", "date": "2018-04-02 15:00:00Z", "unit": "", "value": 0.02}] - }], - "general": [{"name": "fridge_temperature", "date": "2018-04-02 15:00:00Z", "unit": "mK", "value": 10}] -} diff --git a/qiskit/schemas/examples/backend_status_example.json b/qiskit/schemas/examples/backend_status_example.json deleted file mode 100644 index d0c4a5585696..000000000000 --- a/qiskit/schemas/examples/backend_status_example.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "backend_name": "ibmqx5", - "backend_version": "1.1.1", - "operational": false, - "pending_jobs": 10, - "status_msg": "Paused for recalibration" -} diff --git a/qiskit/schemas/examples/default_pulse_configuration_example.json b/qiskit/schemas/examples/default_pulse_configuration_example.json deleted file mode 100644 index ba3ecebf754a..000000000000 --- a/qiskit/schemas/examples/default_pulse_configuration_example.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "qubit_freq_est": [5.34221,5.24654,5.67543], - "meas_freq_est": [6.87,7.1,7.4], - "cmd_def": [ - {"name":"u1", "qubits": [0], - "sequence" :[{"name": "fc", "phase": "P0", - "t0": 0, "ch": "d0"}]}, - {"name": "u2", "qubits": [0], - "sequence": [{"name": "fc", "phase": "P1", - "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": 1.5708, "t0": 0, "ch": "d0"}, - {"name": "pulse_0", "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": -1.5708, "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": "P0", "t0": 11, "ch": "d0"}]}, - {"name": "u3", "qubits": [0], - "sequence": [{"name": "fc", "phase": "P2", - "t0": 0, "ch": "d0"}, - {"name": "pulse_0", "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": "P0", "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": 3.14, "t0": 11, "ch": "d0"}, - {"name": "pulse_0", "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": 3.14, "t0": 22, "ch": "d0"}, - {"name": "fc", "phase": "P1", "t0": 22, "ch": "d0"}]}, - {"name": "measure", "qubits": [0], - "sequence": [{"name": "square_1", - "t0": 0, "ch": "m0"}, - {"name": "acquire", "t0": 3, "duration": 10, "qubits":[0,1,2], "memory_slot": [0,1,2]}]}, - {"name":"u1", "qubits": [1], - "sequence" :[{"name": "fc", "phase": "P0", - "t0": 0, "ch": "d0"}]}, - {"name": "u2", "qubits": [1], - "sequence": [{"name": "fc", "phase": "P1", - "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": 1.5708, "t0": 0, "ch": "d0"}, - {"name": "pulse_0", "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": -1.5708, "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": "P0", "t0": 11, "ch": "d0"}]}, - {"name": "u3", "qubits": [1], - "sequence": [{"name": "fc", "phase": "P2", - "t0": 0, "ch": "d0"}, - {"name": "pulse_0", "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": "P0", "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": 3.14, "t0": 11, "ch": "d0"}, - {"name": "pulse_0", "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": 3.14, "t0": 22, "ch": "d0"}, - {"name": "fc", "phase": "P1", "t0": 22, "ch": "d0"}]}, - {"name": "measure", "qubits": [1], - "sequence": [{"name": "square_1", - "t0": 0, "ch": "m0"}, - {"name": "acquire", "t0": 3, "duration": 10, "qubits":[0,1,2], "memory_slot": [0,1,2]}]}, - {"name":"u1", "qubits": [2], - "sequence" :[{"name": "fc", "phase": "P0", - "t0": 0, "ch": "d0"}]}, - {"name": "u2", "qubits": [2], - "sequence": [{"name": "fc", "phase": "P1", - "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": 1.5708, "t0": 0, "ch": "d0"}, - {"name": "pulse_0", "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": -1.5708, "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": "P0", "t0": 11, "ch": "d0"}]}, - {"name": "u3", "qubits": [2], - "sequence": [{"name": "fc", "phase": "P2", - "t0": 0, "ch": "d0"}, - {"name": "pulse_0", "t0": 0, "ch": "d0"}, - {"name": "fc", "phase": "P0", "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": 3.14, "t0": 11, "ch": "d0"}, - {"name": "pulse_0", "t0": 11, "ch": "d0"}, - {"name": "fc", "phase": 3.14, "t0": 22, "ch": "d0"}, - {"name": "fc", "phase": "P1", "t0": 22, "ch": "d0"}]}, - {"name": "measure", "qubits": [2], - "sequence": [{"name": "square_1", - "t0": 0, "ch": "m0"}, - {"name": "acquire", "t0": 3, "duration": 10, "qubits":[0,1,2], "memory_slot": [0,1,2]}]} - ], - "pulse_library": [ - {"name": "pulse_0", "samples": [[0.5,0],[1.0,0],[0.5,0]]}, - {"name": "square_1", "samples": [[0.5,0],[0.5,0],[0.5,0],[0.5,0],[0.5,0],[0.5,0]]} - ], - "meas_kernel": {"name": "boxcar", "params": {}}, - "discriminator": {"name": "max_1Q_fidelity", "params": {}}, - "buffer": 2 -} diff --git a/qiskit/schemas/examples/job_status_example.json b/qiskit/schemas/examples/job_status_example.json deleted file mode 100644 index 5548274d05db..000000000000 --- a/qiskit/schemas/examples/job_status_example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "job_id": "1x56222G", - "status": "RUNNING", - "status_msg": "Currently running, estimated time remaining: 45s" -} \ No newline at end of file diff --git a/qiskit/schemas/examples/qasm_w_pulse_gates.json b/qiskit/schemas/examples/qasm_w_pulse_gates.json deleted file mode 100644 index 0efe80ae1a75..000000000000 --- a/qiskit/schemas/examples/qasm_w_pulse_gates.json +++ /dev/null @@ -1,797 +0,0 @@ -{ - "qobj_id": "762bf8dd-8ec1-4241-b606-8249b38a922f", - "header": { - "backend_name": "fake_almaden", - "backend_version": "1.4.6" - }, - "config": { - "shots": 1024, - "memory": false, - "parameter_binds": [], - "init_qubits": true, - "parametric_pulses": [ - "gaussian" - ], - "memory_slots": 3, - "n_qubits": 20, - "pulse_library": [ - { - "name": "1c5a0346ff72c04c45d536d50d13b0d42cf65dc8e320d32385d36861d3bb1e41", - "samples": [ - [ - 0.000293973741723399, - 0 - ], - [ - 0.0006061156705983722, - 0 - ], - [ - 0.0010529363460618408, - 0 - ], - [ - 0.0016816340894609918, - 0 - ], - [ - 0.0025510324687094362, - 0 - ], - [ - 0.0037324323669642883, - 0 - ], - [ - 0.005309679452559498, - 0 - ], - [ - 0.007378103423579345, - 0 - ], - [ - 0.01004198697717997, - 0 - ], - [ - 0.013410274492023352, - 0 - ], - [ - 0.017590344314623686, - 0 - ], - [ - 0.02267984896088997, - 0 - ], - [ - 0.02875686896878555, - 0 - ], - [ - 0.03586891039602005, - 0 - ], - [ - 0.04402157155522451, - 0 - ], - [ - 0.05316796861270546, - 0 - ], - [ - 0.06320019267589688, - 0 - ], - [ - 0.07394412447755479, - 0 - ], - [ - 0.08515881854928489, - 0 - ], - [ - 0.09654136844205609, - 0 - ], - [ - 0.10773768702210337, - 0 - ], - [ - 0.1183590210887793, - 0 - ], - [ - 0.12800333669616534, - 0 - ], - [ - 0.13628005118799236, - 0 - ], - [ - 0.1428360489048848, - 0 - ], - [ - 0.1473805904084687, - 0 - ], - [ - 0.14970667552142972, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.15, - 0 - ], - [ - 0.14970667552142972, - 0 - ], - [ - 0.1473805904084687, - 0 - ], - [ - 0.1428360489048848, - 0 - ], - [ - 0.13628005118799236, - 0 - ], - [ - 0.12800333669616534, - 0 - ], - [ - 0.1183590210887793, - 0 - ], - [ - 0.10773768702210337, - 0 - ], - [ - 0.09654136844205609, - 0 - ], - [ - 0.08515881854928489, - 0 - ], - [ - 0.07394412447755479, - 0 - ], - [ - 0.06320019267589688, - 0 - ], - [ - 0.05316796861270546, - 0 - ], - [ - 0.04402157155522451, - 0 - ], - [ - 0.03586891039602005, - 0 - ], - [ - 0.02875686896878555, - 0 - ], - [ - 0.02267984896088997, - 0 - ], - [ - 0.017590344314623686, - 0 - ], - [ - 0.013410274492023352, - 0 - ], - [ - 0.01004198697717997, - 0 - ], - [ - 0.007378103423579345, - 0 - ], - [ - 0.005309679452559498, - 0 - ], - [ - 0.0037324323669642883, - 0 - ], - [ - 0.0025510324687094362, - 0 - ], - [ - 0.0016816340894609918, - 0 - ], - [ - 0.0010529363460618408, - 0 - ], - [ - 0.0006061156705983722, - 0 - ], - [ - 0.000293973741723399, - 0 - ] - ] - } - ], - "calibrations": { - "gates": [ - { - "name": "rxt", - "qubits": [ - 0 - ], - "params": [ - 3.14 - ], - "instructions": [ - { - "name": "parametric_pulse", - "t0": 0, - "ch": "d0", - "pulse_shape": "gaussian", - "parameters": { - "duration": 128, - "amp": [ - 0.2, - 0 - ], - "sigma": 16 - } - }, - { - "name": "parametric_pulse", - "t0": 128, - "ch": "d0", - "pulse_shape": "gaussian", - "parameters": { - "duration": 128, - "amp": [ - 0.2, - 0 - ], - "sigma": 16 - } - } - ] - }, - { - "name": "rxt", - "qubits": [ - 1 - ], - "params": [ - 3.14 - ], - "instructions": [ - { - "name": "1c5a0346ff72c04c45d536d50d13b0d42cf65dc8e320d32385d36861d3bb1e41", - "t0": 0, - "ch": "d1" - } - ] - }, - { - "name": "rxt", - "qubits": [ - 1 - ], - "params": [ - 1.57 - ], - "instructions": [ - { - "name": "1c5a0346ff72c04c45d536d50d13b0d42cf65dc8e320d32385d36861d3bb1e41", - "t0": 0, - "ch": "d1" - } - ] - } - ] - } - }, - "schema_version": "1.3.0", - "type": "QASM", - "experiments": [ - { - "config": { - "n_qubits": 20, - "memory_slots": 3, - "calibrations": { - "gates": [ - { - "name": "h", - "qubits": [ - 0 - ], - "params": [], - "instructions": [ - { - "name": "fc", - "t0": 0, - "ch": "d0", - "phase": 1.57 - }, - { - "name": "parametric_pulse", - "t0": 0, - "ch": "d0", - "pulse_shape": "gaussian", - "parameters": { - "duration": 128, - "amp": [ - 0.2, - 0 - ], - "sigma": 16 - } - } - ] - } - ] - } - }, - "header": { - "qubit_labels": [ - [ - "q", - 0 - ], - [ - "q", - 1 - ], - [ - "q", - 2 - ], - [ - "q", - 3 - ], - [ - "q", - 4 - ], - [ - "q", - 5 - ], - [ - "q", - 6 - ], - [ - "q", - 7 - ], - [ - "q", - 8 - ], - [ - "q", - 9 - ], - [ - "q", - 10 - ], - [ - "q", - 11 - ], - [ - "q", - 12 - ], - [ - "q", - 13 - ], - [ - "q", - 14 - ], - [ - "q", - 15 - ], - [ - "q", - 16 - ], - [ - "q", - 17 - ], - [ - "q", - 18 - ], - [ - "q", - 19 - ] - ], - "n_qubits": 20, - "qreg_sizes": [ - [ - "q", - 20 - ] - ], - "clbit_labels": [ - [ - "c", - 0 - ], - [ - "c", - 1 - ], - [ - "c", - 2 - ] - ], - "memory_slots": 3, - "creg_sizes": [ - [ - "c", - 3 - ] - ], - "name": "circuit7", - "global_phase": 0 - }, - "instructions": [ - { - "name": "h", - "qubits": [ - 0 - ] - }, - { - "name": "u3", - "params": [ - 3.141592653589793, - 0, - 3.141592653589793 - ], - "qubits": [ - 1 - ] - }, - { - "name": "cx", - "qubits": [ - 0, - 1 - ] - }, - { - "name": "rxt", - "params": [ - 3.14 - ], - "qubits": [ - 0 - ] - }, - { - "name": "rxt", - "params": [ - 1.57 - ], - "qubits": [ - 1 - ] - }, - { - "name": "rxt", - "params": [ - 3.14 - ], - "qubits": [ - 1 - ] - }, - { - "name": "rxt", - "params": [ - 1.57 - ], - "qubits": [ - 1 - ] - }, - { - "name": "measure", - "qubits": [ - 0 - ], - "memory": [ - 0 - ] - }, - { - "name": "measure", - "qubits": [ - 1 - ], - "memory": [ - 1 - ] - } - ] - }, - { - "config": { - "n_qubits": 20, - "memory_slots": 3 - }, - "header": { - "qubit_labels": [ - [ - "q", - 0 - ], - [ - "q", - 1 - ], - [ - "q", - 2 - ], - [ - "q", - 3 - ], - [ - "q", - 4 - ], - [ - "q", - 5 - ], - [ - "q", - 6 - ], - [ - "q", - 7 - ], - [ - "q", - 8 - ], - [ - "q", - 9 - ], - [ - "q", - 10 - ], - [ - "q", - 11 - ], - [ - "q", - 12 - ], - [ - "q", - 13 - ], - [ - "q", - 14 - ], - [ - "q", - 15 - ], - [ - "q", - 16 - ], - [ - "q", - 17 - ], - [ - "q", - 18 - ], - [ - "q", - 19 - ] - ], - "n_qubits": 20, - "qreg_sizes": [ - [ - "q", - 20 - ] - ], - "clbit_labels": [ - [ - "c", - 0 - ], - [ - "c", - 1 - ], - [ - "c", - 2 - ] - ], - "memory_slots": 3, - "creg_sizes": [ - [ - "c", - 3 - ] - ], - "name": "circuit8", - "global_phase": 0 - }, - "instructions": [ - { - "name": "u2", - "params": [ - 0, - 3.141592653589793 - ], - "qubits": [ - 0 - ] - }, - { - "name": "u3", - "params": [ - 3.141592653589793, - 0, - 3.141592653589793 - ], - "qubits": [ - 1 - ] - }, - { - "name": "cx", - "qubits": [ - 0, - 1 - ] - }, - { - "name": "rxt", - "params": [ - 3.14 - ], - "qubits": [ - 0 - ] - }, - { - "name": "rxt", - "params": [ - 1.57 - ], - "qubits": [ - 1 - ] - }, - { - "name": "rxt", - "params": [ - 3.14 - ], - "qubits": [ - 1 - ] - }, - { - "name": "rxt", - "params": [ - 1.57 - ], - "qubits": [ - 1 - ] - }, - { - "name": "measure", - "qubits": [ - 0 - ], - "memory": [ - 0 - ] - }, - { - "name": "measure", - "qubits": [ - 1 - ], - "memory": [ - 1 - ] - } - ] - } - ] -} diff --git a/qiskit/schemas/examples/qobj_openpulse_example.json b/qiskit/schemas/examples/qobj_openpulse_example.json deleted file mode 100644 index c4f787336336..000000000000 --- a/qiskit/schemas/examples/qobj_openpulse_example.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "qobj_id": "exp123_072018_op", - "schema_version": "1.0.0", - "type": "PULSE", - "header": { - "description": "Set of Experiments 1", - "backend_name": "pulse_simulator2" - }, - "config": { - "shots": 1024, - "memory_slots": 3, - "meas_return": "avg", - "meas_level": 2, - "memory_slot_size": 1, - "rep_time": 1000, - "init_qubits": false, - "qubit_lo_freq": [5.2,5.15,5.05], - "meas_lo_freq": [6.9,6.8,6.7], - "pulse_library": [ - {"name": "pulse1", "samples": [[0,0],[0,0],[0,0]]}, - {"name": "pulse2", "samples": [[0,0],[0,0],[0,0]]}, - {"name": "pulse3", "samples": [[0,0],[0,0],[0,0]]} - ] - }, - "experiments": [ - { - "header": {}, - "config": {"shots": 512}, - "instructions": [ - {"name": "pulse1", "ch": "d0", "t0": 0}, - {"name": "setp", "ch": "u0", "t0": 10, "phase": 3.14}, - {"name": "setf", "ch": "d0", "t0": 10, "frequency": 8.0}, - {"name": "acquire", "t0": 10, "duration": 90, "qubits": [0,1,2], "register_slot": [0,1,2], "memory_slot": [0,1,2]}, - {"name": "shiftf", "ch": "d0", "t0": 20, "frequency": 4.0}, - {"name": "shiftp", "ch": "u0", "t0": 20, "phase": -0.1}, - {"name": "copy", "register_orig": 1, "register_copy": [3,4]}, - {"name": "bfunc", "mask": "0xE", "relation": "==", "val": "0xA", "register": 3, "memory": 3}, - {"name": "pulse1", "ch": "d0", "t0": 120, "conditional": 3}, - {"name": "parametric_pulse", "t0": 0, "parameters": {"amp": [0.0, 0.5], "sigma": 4, "duration": 25}, "ch": "d0", "pulse_shape": "gaussian"} - ] - } - ] -} diff --git a/qiskit/schemas/examples/qobj_openqasm_example.json b/qiskit/schemas/examples/qobj_openqasm_example.json deleted file mode 100644 index f1e160ba7797..000000000000 --- a/qiskit/schemas/examples/qobj_openqasm_example.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "qobj_id": "exp123_072018", - "schema_version": "1.0.0", - "type": "QASM", - "header": { - "description": "Set of Experiments 1", - "backend_name": "ibmqx2"}, - "config": { - "shots": 1024, - "memory_slots": 1, - "init_qubits": true - }, - "experiments": [ - { - "header": { - "memory_slots": 1, - "n_qubits": 3, - "clbit_labels": [["c1", 0]], - "qubit_labels": [null,["q", 0],["q",1]] - }, - "config": {}, - "instructions": [ - {"name": "u1", "qubits": [1], "params": [0.4]}, - {"name": "u2", "qubits": [1], "params": [0.4,0.2]}, - {"name": "u3", "qubits": [1], "params": [0.4,0.2,-0.3]}, - {"name": "snapshot", "label": "snapstate1", "snapshot_type": "statevector"}, - {"name": "cx", "qubits": [1,2]}, - {"name": "barrier", "qubits": [1]}, - {"name": "measure", "qubits": [1], "register": [2], "memory": [0]}, - {"name": "u2", "qubits": [1], "params": [0.4,0.2], "conditional": 2} - ] - }, - { - "header": { - "memory_slots": 3, - "n_qubits": 3, - "clbit_labels": [["c1", 0]], - "qubit_labels": [null,["q", 0],["q",1]] - }, - "config": {}, - "instructions": [ - {"name": "u1", "qubits": [1], "params": [0.4]}, - {"name": "cx", "qubits": [1,2]}, - {"name": "snapshot", "label": "snapstate1", "snapshot_type": "statevector"}, - {"name": "cx", "qubits": [1,2]}, - {"name": "barrier", "qubits": [1]}, - {"name": "measure", "qubits": [1], "register": [2], "memory": [0]}, - {"name": "u1", "qubits": [1], "params": [0.4], "conditional": 2} - ] - } - ] -} - diff --git a/qiskit/schemas/examples/result_openpulse_level_0_example.json b/qiskit/schemas/examples/result_openpulse_level_0_example.json deleted file mode 100644 index 9faccf8a0d4e..000000000000 --- a/qiskit/schemas/examples/result_openpulse_level_0_example.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "backend_name": "ibmqx2", - "backend_version": "1.1.11", - "job_id": "XC1323XG2", - "qobj_id": "Experiment1", - "date": "2018-04-02 15:00:00Z", - "status": "COMPLETED", - "success": true, - "header": {"description": "T1 with cals"}, - "results": [ - {"header": {"name": "Ground state calibration"}, - "shots": 1024, - "seed": 88, - "status": "DONE", - "success": true, - "meas_return": "avg", - "data": { - "memory": [[0,0],[0.75,0],[1.0,0],[1.5,0],[1.5,0],[1.5,0]] - } - }, - {"header": {"name": "Excited state calibration"}, - "shots": 1024, - "seed": 88, - "status": "DONE", - "success": true, - "meas_return": "avg", - "data": { - "memory": [[0,0],[0.0,0.75],[0.0,1.0],[0,1.5],[0,1.5],[0,1.5]] - } - }, - {"header": {"name": "T1", "t1_time": 0}, - "shots": [1020,1024], - "seed": 88, - "status": "DONE", - "success": true, - "meas_return": "single", - "data": { - "memory": [[[[0,0],[0.0,0.75],[0.0,1.0],[0,1.5],[0,1.5],[0,1.5]]], - [[[0,0],[0.0,0.75],[0.0,1.0],[0,1.5],[0,1.5],[0,1.5]]], - [[[0,0],[0.0,0.75],[0.0,1.0],[0,1.5],[0,1.5],[0,1.5]]], - [[[0,0],[0.0,0.75],[0.0,1.0],[0,1.5],[0,1.5],[0,1.5]]], - [[[0,0],[0.0,0.75],[0.0,1.0],[0,1.5],[0,1.5],[0,1.5]]]] - } - } - ] -} diff --git a/qiskit/schemas/examples/result_openpulse_level_1_example.json b/qiskit/schemas/examples/result_openpulse_level_1_example.json deleted file mode 100644 index 6517151be9d3..000000000000 --- a/qiskit/schemas/examples/result_openpulse_level_1_example.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "backend_name": "ibmqx2", - "sample_name": "chip1", - "backend_version": "1.1.11", - "job_id": "XC1323XG2", - "qobj_id": "Experiment1", - "date": "2018-04-02 15:00:00Z", - "status": "COMPLETED", - "success": true, - "header": {"description": "T1 Experiment with Cals"}, - "results": [ - {"header": {"name": "Ground state calibration"}, - "shots": 1024, - "status": "DONE", - "success": true, - "meas_return": "avg", - "data": { - "memory": [[1.5,0]] - } - }, - {"header": {"name": "Excited state calibration"}, - "shots": 1024, - "status": "DONE", - "success": true, - "meas_return": "avg", - "data": { - "memory": [[0,1.5]] - } - }, - {"header": {"name": "T1", "t1_time": 0}, - "shots": 5, - "status": "DONE", - "success": true, - "meas_return": "single", - "data": { - "memory": [[[0.1,1.6]],[[-0.2,1.4]],[[0.2,1.3]],[[-0.1,1.6]],[[0,1.5]]] - } - } - ] -} diff --git a/qiskit/schemas/examples/result_openqasm_example.json b/qiskit/schemas/examples/result_openqasm_example.json deleted file mode 100644 index 542f36e5a7f4..000000000000 --- a/qiskit/schemas/examples/result_openqasm_example.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "backend_name": "ibmqx2", - "sample_name": "sample1", - "backend_version": "1.1.1", - "job_id": "XC1323XG2", - "qobj_id": "Experiment1", - "date": "2018-04-02 15:00:00Z", - "status": "COMPLETED", - "success": true, - "header": {"description": "Bell state in ZZ and XY"}, - "results": [ - { - "header": { - "name": "Bell state", - "memory_slots": 2, - "n_qubits": 2, - "clbit_labels": [["c1", 0],["c1", 1]], - "qubit_labels": [["q", 0],["q",1]] - }, - "shots": 1024, - "seed": 88, - "status": "DONE", - "success": true, - "data": { - "counts": { - "0x0": 480, "0x3": 490, "0x1": 20, "0x2": 34 - }, - "memory": ["0x1", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x1", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x1", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x1", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x2", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x2", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x2", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x2", "0x3", "0x3", "0x1", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x2", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x2", "0x0", "0x2", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x3", "0x0", "0x1", "0x0", "0x3", "0x1", "0x0", "0x3", "0x3", "0x3", "0x1", "0x0", "0x0", "0x0", "0x0", "0x2", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x2", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x1", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x2", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x2", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x2", "0x0", "0x2", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x1", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x1", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x2", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x2", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x1", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x1", "0x0", "0x3", "0x0", "0x1", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x2", "0x3", "0x0", "0x0", "0x0", "0x2", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x2", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x2", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x2", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x0", "0x2", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x1", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x3", "0x2", "0x0", "0x0", "0x3", "0x0", "0x0", "0x1", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x2", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x2", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x2", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x2", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x1", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x2", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x0", "0x2", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x3", "0x3", "0x3", "0x3", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x3", "0x2", "0x3", "0x2", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x1", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x2", "0x3", "0x1", "0x0", "0x3", "0x3", "0x3", "0x0", "0x2", "0x0", "0x0", "0x3", "0x0", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x2", "0x3", "0x1", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x2", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x3", "0x0", "0x0", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x3", "0x3", "0x0", "0x3", "0x0", "0x0", "0x0", "0x3", "0x0", "0x3", "0x3", "0x3", "0x0", "0x0", "0x0", "0x0", "0x3", "0x0"] - } - }, - { - "header": { - "name": "Bell state XY", - "memory_slots": 2, - "n_qubits": 2, - "clbit_labels": [["c1", 0],["c1", 1]], - "qubit_labels": [["q", 0],["q",1]] - }, - "shots": 1024, - "status": "DONE", - "success": true, - "data": { - "counts": { - "0x0": 29, "0x3": 15, "0x1": 510, "0x2": 470 - }, - "memory": ["0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x3", "0x2", "0x2", "0x1", "0x3", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x0", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x0", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x0", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x0", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x0", "0x1", "0x2", "0x2", "0x1", "0x3", "0x2", "0x2", "0x0", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x0", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x3", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x0", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x3", "0x2", "0x0", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x0", "0x3", "0x1", "0x0", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x3", "0x1", "0x1", "0x0", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x0", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x3", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x3", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x0", "0x2", "0x2", "0x2", "0x2", "0x3", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x0", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x3", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x0", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x0", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x3", "0x0", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x0", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x3", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x3", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x0", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x0", "0x1", "0x0", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x3", "0x0", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x0", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x0", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x0", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x0", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x2", "0x2", "0x2", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x1", "0x2", "0x1", "0x2", "0x0", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2", "0x0", "0x2", "0x1", "0x1", "0x2", "0x2", "0x1", "0x1", "0x2", "0x1", "0x2", "0x1"] - } - } - ] -} diff --git a/qiskit/schemas/examples/result_statevector_simulator_example.json b/qiskit/schemas/examples/result_statevector_simulator_example.json deleted file mode 100644 index 1470510e150b..000000000000 --- a/qiskit/schemas/examples/result_statevector_simulator_example.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "backend_name": "statevector_simulator", - "backend_version": "2.1.0", - "job_id": "XC1323XG2", - "qobj_id": "Experiment1", - "date": "2018-04-02 15:00:00Z", - "status": "COMPLETED", - "success": true, - "header": {"description": "Bell state statevector simulator test"}, - "results": [ - { - "header": { - "name": "Bell state" - }, - "shots": 1, - "status": "DONE", - "success": true, - "data": { - "statevector": [[0.7071067811865475, 0.0], [0.0, 0.0], [0.0, 0.0], [0.7071067811865475, 0.0]] - } - } - ] -} diff --git a/qiskit/schemas/examples/result_unitary_simulator_example.json b/qiskit/schemas/examples/result_unitary_simulator_example.json deleted file mode 100644 index 34c54ab10760..000000000000 --- a/qiskit/schemas/examples/result_unitary_simulator_example.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "backend_name": "qasm_simulator", - "backend_version": "1.0.3", - "job_id": "XC1323XG2", - "qobj_id": "Experiment1", - "date": "2018-04-02 15:00:00Z", - "status": "COMPLETED", - "success": true, - "header": {"description": "Bell state unitary simulator test"}, - "results": [ - { - "header": { - "name": "Bell state circuit (h q[0]; cx q[0], q[1];)" - }, - "shots": 1, - "status": "DONE", - "success": true, - "data": { - "unitary": - [[[0.70710678, 0.0], [0.70710678, 0.0], [0.0, 0.0], [0.0, 0.0]], - [[0.0, 0.0], [0.0, 0.0], [0.70710678, 0.0], [-0.70710678, 0.0]], - [[0.0, 0.0], [0.0, 0.0], [0.70710678, 0.0], [0.70710678, 0.0]], - [[0.70710678, 0.0], [-0.70710678, 0.0], [0.0, 0.0], [0.0, 0.0]]] - } - } - ] -} diff --git a/qiskit/schemas/ibmq_device_qobj_schema.json b/qiskit/schemas/ibmq_device_qobj_schema.json deleted file mode 100644 index b718fa9a0272..000000000000 --- a/qiskit/schemas/ibmq_device_qobj_schema.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/ibm_backend_device_qobj_schema.json", - "description": "OpenQuantum quantum object data structure for running experiments. IBM Backend specific instructions for experimental devices. Must also validate against qobj_schema.json", - "version": "1.0.0", - "definitions": { - "openqasm_instructions": { - "oneOf": [ - { - "properties": { - "name": { - "enum": ["u3", "U", "id", "u1", "u0", "u2", "cx", "CX", "snapshot", "reset", "barrier", "bfunc", "copy", "measure"] - } - } - } - ], - "required": [ - "name" - ], - "type": "object" - }, - "qobjexp": { - "description": "Quantum experiment", - "properties": { - "instructions": { - "description": "List of experiment instructions.", - "type": "array" - } - }, - "required": [ - "instructions" - ], - "type": "object" - }, - "qobj_qasm": { - "properties": { - "config": { - "description": "Configuration options that apply to all experiments in this qobj. For options that may be set on a per-experiment basis, these are the defaults. Use this space to set backend specific configuration requirements.", - "title": "Qobj-level configuration", - "type": "object" - }, - "experiments": { - "description": "List of experiments to run", - "minItems": 1, - "type": "array" - }, - "header": { - "description": "QObj metadata that does not affect how the experiments are run on the backend. Carried through to the result.", - "type": "object" - } - }, - "required": [ - "type", - "experiments", - "config", - "header" - ], - "type": "object" - } - }, - "oneOf": [ - { - "allOf": [ - { - "$ref": "#/definitions/qobj_qasm" - }, - { - "properties": { - "experiments": { - "items": { - "allOf": [ - { - "$ref": "#/definitions/qobjexp" - }, - { - "properties": { - "instructions": { - "items": { - "$ref": "#definitions/openqasm_instructions" - } - } - } - } - ] - } - }, - "type": { - "enum": [ - "QASM" - ] - } - } - } - ] - }, - { - "allOf": [ - { - "$ref": "#/definitions/qobj_qasm" - }, - { - "properties": {"type": {"enum": ["PULSE"]}} - } - ] - } - ] -} diff --git a/qiskit/schemas/ibmq_simulator_qobj_schema.json b/qiskit/schemas/ibmq_simulator_qobj_schema.json deleted file mode 100644 index 1fd76e82661b..000000000000 --- a/qiskit/schemas/ibmq_simulator_qobj_schema.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/ibm_backend_simulator_qobj_schema.json", - "description": "OpenQuantum quantum object data structure for running experiments. IBM Backend specific instructions for simulators. Must also validate against qobj_schema.json", - "version": "1.0.0", - "definitions": { - "openqasm_instructions": { - "oneOf": [ - { - "properties": { - "name": { - "enum": ["u3", "U", "id", "h", "s", "sdg", "t", "tdg", "x", "y", "z", "u1", - "u0", "rx", "ry", "rz", "u2", "cx", "CX", "cy", "cz", "ch", "swap", - "cu1", "crz", "rzz", "cu3", "ccx", "cswap", "snapshot", "reset", "barrier", "bfunc", "copy", "measure"] - } - } - }, - { - "properties": { - "name": { - "enum": [ - "wait", - "noise", - "save", - "load" - ] - } - }, - "title": "Simulator specific instructions" - } - ], - "required": [ - "name" - ], - "type": "object" - }, - "qobjexp": { - "description": "Quantum experiment", - "properties": { - "instructions": { - "description": "List of experiment instructions.", - "type": "array" - } - }, - "required": [ - "instructions" - ], - "type": "object" - }, - "qobj_qasm": { - "properties": { - "config": { - "description": "Configuration options that apply to all experiments in this qobj. For options that may be set on a per-experiment basis, these are the defaults. Use this space to set backend specific configuration requirements.", - "title": "Qobj-level configuration", - "type": "object" - }, - "experiments": { - "description": "List of experiments to run", - "minItems": 1, - "type": "array" - }, - "header": { - "description": "QObj metadata that does not affect how the experiments are run on the backend. Carried through to the result.", - "type": "object" - } - }, - "required": [ - "type", - "experiments", - "config", - "header" - ], - "type": "object" - } - }, - "oneOf": [ - { - "allOf": [ - { - "$ref": "#/definitions/qobj_qasm" - }, - { - "properties": { - "experiments": { - "items": { - "allOf": [ - { - "$ref": "#/definitions/qobjexp" - }, - { - "properties": { - "instructions": { - "items": { - "$ref": "#definitions/openqasm_instructions" - } - } - } - } - ] - } - }, - "type": { - "enum": [ - "QASM" - ] - } - } - } - ] - }, - { - "allOf": [ - { - "$ref": "#/definitions/qobj_qasm" - }, - { - "properties": {"type": {"enum": ["PULSE"]}} - } - ] - } - ] -} diff --git a/qiskit/schemas/job_status_schema.json b/qiskit/schemas/job_status_schema.json deleted file mode 100644 index 27154de83221..000000000000 --- a/qiskit/schemas/job_status_schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/job_status_schema.json", - "description": "OpenQuantum job status schema", - "version": "1.0.0", - "type": "object", - "required": [ - "job_id", - "status", - "status_msg" - ], - "properties": { - "job_id": { - "type": "string", - "description": "Backend job_id" - }, - "status": { - "enum": ["DONE", "QUEUED", "CANCELLED", "RUNNING", "ERROR"], - "description": "Status of the job" - }, - "status_msg": { - "type": "string", - "description": "Status message" - } - } -} \ No newline at end of file diff --git a/qiskit/schemas/qobj_schema.json b/qiskit/schemas/qobj_schema.json deleted file mode 100644 index 0ff2a58d64f9..000000000000 --- a/qiskit/schemas/qobj_schema.json +++ /dev/null @@ -1,1319 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/qobj_schema.json", - "description": "OpenQuantum quantum object data structure for running experiments", - "version": "1.5.1", - "definitions": { - "bfunc": { - "properties": { - "mask": { - "type": "string" - }, - "memory": { - "minimum": 0, - "type": "integer" - }, - "name": { - "enum": [ - "bfunc" - ] - }, - "register": { - "minimum": 0, - "type": "integer" - }, - "relation": { - "type": "string" - }, - "val": { - "type": "string" - } - }, - "required": [ - "mask", - "relation", - "val" - ], - "type": "object" - }, - "complex": { - "description": "JSON representation of a complex number", - "items": { - "type": "number" - }, - "maxItems": 2, - "minItems": 2, - "type": "array" - }, - "complex_array": { - "description": "JSON representation of a complex vector", - "items": { - "$ref": "#/definitions/complex" - }, - "minItems": 1, - "type": "array" - }, - "complex_matrix": { - "description": "JSON representation of a complex matrix", - "items": { - "$ref": "#/definitions/complex_array" - }, - "minItems": 1, - "type": "array" - }, - "copy": { - "properties": { - "name": { - "enum": [ - "copy" - ] - }, - "register_copy": { - "items": { - "minimum": 0, - "type": "integer" - }, - "minItems": 1, - "type": "array" - }, - "register_orig": { - "minimum": 0, - "type": "integer" - } - }, - "required": [ - "register_orig", - "register_copy" - ], - "type": "object" - }, - "discriminator": { - "description": "JSON representation of a discriminator object", - "type": "object", - "properties": { - "name": { "type": "string" }, - "params": { "type": "object" } - } - }, - "kernel": { - "description": "JSON representation of a kernel object", - "type": "object", - "properties": { - "name": { "type": "string" }, - "params": { "type": "object" } - } - }, - "openpulse_instructions": { - "oneOf": [ - { - "properties": { - "name": { - "not": { - "enum": [ - "pv", - "fc", - "setp", - "shiftp", - "setf", - "shiftf", - "acquire", - "delay", - "parametric_pulse" - ] - } - } - }, - "required": [ - "t0", - "ch" - ], - "title": "Standard pulse" - }, - { - "properties": { - "name": { - "enum": [ - "pv" - ] - }, - "val": { - "OneOf": [ - {"items": { - "type": "number" - }, - "maxItems": 2, - "minItems": 2, - "type": "array"}, - {"type": "string"} - ]} - }, - "required": [ - "val", - "t0", - "ch" - ], - "title": "Persistent value pulse" - }, - { - "properties": { - "name": { - "enum": [ - "fc" - ] - }, - "phase": { - "OneOf":[ - {"type": "number"}, - {"type": "string"}] - } - }, - "required": [ - "phase", - "t0", - "ch" - ], - "title": "Frame change pulse" - }, - { - "properties": { - "name": { - "enum": [ - "setp" - ] - }, - "phase": { - "type": "number" - } - }, - "required": [ - "phase", - "t0", - "ch" - ], - "title": "Set Phase" - }, - { - "properties": { - "name": { - "enum": [ - "shiftp" - ] - }, - "phase": { - "type": "number" - } - }, - "required": [ - "phase", - "t0", - "ch" - ], - "title": "Shift Phase" - }, - { - "properties": { - "name": { - "enum": [ - "setf" - ] - }, - "frequency": { - "OneOf":[ - {"type": "number"}, - {"type": "string"}] - } - }, - "required": [ - "frequency", - "t0", - "ch" - ], - "title": "Set frequency" - }, - { - "properties": { - "name": { - "enum": [ - "shiftf" - ] - }, - "frequency": { - "type": "number" - } - }, - "required": [ - "frequency", - "t0", - "ch" - ], - "title": "Shift frequency" - }, - { - "properties": { - "name": { - "enum": [ - "delay" - ] - }, - "duration": { - "type": "integer" - } - }, - "required": [ - "duration", - "t0", - "ch" - ], - "title": "Delay in pulse" - }, - { - "properties": { - "name": { - "enum": [ - "parametric_pulse" - ] - }, - "label": {"type": "string"}, - "pulse_shape": {"type": "string"}, - "parameters": {"type": "object"} - }, - "required": [ - "pulse_shape", - "parameters", - "t0", - "ch" - ], - "title": "Parametric pulse" - }, - { - "properties": { - "discriminators": { - "type": "array", - "items": { - "$ref": "#/definitions/discriminator" - } - }, - "duration": { - "type": "number" - }, - "kernels": { - "type": "array", - "items": { - "$ref": "#/definitions/kernel" - } - }, - "memory_slot": { - "items": { - "minimum": 0, - "type": "integer" - }, - "minItems": 1, - "type": "array" - }, - "name": { - "enum": [ - "acquire" - ] - }, - "qubits": { - "items": { - "minimum": 0, - "type": "integer" - }, - "minItems": 1, - "type": "array" - }, - "register_slot": { - "items": { - "minimum": 0, - "type": "integer" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "t0", - "duration", - "qubits", - "memory_slot" - ], - "title": "Acquisition" - }, - { - "properties": { - "label": { - "type": "string" - }, - "name": { - "enum": [ - "snapshot" - ] - }, - "type": { - "type": "string" - } - }, - "required": [ - "t0", - "label", - "type" - ], - "title": "snapshot" - }, - { - "$ref": "#/definitions/bfunc" - }, - { - "$ref": "#/definitions/copy" - } - ], - "properties": { - "ch": { - "type": "string" - }, - "conditional": { - "minimum": 0, - "type": "integer" - }, - "name": { - "type": "string" - }, - "params": { - "type": "array" - }, - "t0": { - "minimum": 0, - "type": "integer" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "openqasm_instructions": { - "oneOf": [ - { - "properties": { - "name": {"not": { - "enum": ["u3", "U", "id", "h", "s", "sdg", "t", "tdg", "x", "y", "z", - "u1", "u0", "rx", "ry", "rz", "u2", "cx", "CX", "cy", "cz", "ch", - "swap", "cu1", "crz", "rzz", "cu3", "ccx", "cswap", "snapshot", - "reset", "barrier", "bfunc", "copy", "measure"] - }, - "type": "string" - } - } - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "u3", - "U" - ] - }, - "params": { - "maxItems": 3, - "minItems": 3 - }, - "qubits": { - "maxItems": 1 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 3, - "minItems": 3 - } - }, - "required": [ - "qubits", - "params" - ], - "title": "3-param 1Q gate" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "reset", - "id", - "h", - "s", - "sdg", - "t", - "tdg", - "x", - "y", - "z" - ] - }, - "params": { - "maxItems": 0 - }, - "qubits": { - "maxItems": 1, - "minItems": 1 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 0 - } - }, - "required": [ - "qubits" - ], - "title": "fixed 1Q gate/operation" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "u1", - "u0", - "rx", - "ry", - "rz" - ] - }, - "params": { - "maxItems": 1, - "minItems": 1 - }, - "qubits": { - "maxItems": 1, - "minItems": 1 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 1, - "minItems": 1 - } - }, - "required": [ - "qubits", - "params" - ], - "title": "1-param 1Q gate" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "u2" - ] - }, - "params": { - "maxItems": 2, - "minItems": 2 - }, - "qubits": { - "maxItems": 1, - "minItems": 1 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 2, - "minItems": 2 - } - }, - "required": [ - "qubits", - "params" - ], - "title": "2-param 1Q gate" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "cx", - "CX", - "cy", - "cz", - "ch", - "swap" - ] - }, - "params": { - "maxItems": 0 - }, - "qubits": { - "description": "[control, target]", - "maxItems": 2, - "minItems": 2 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 0 - } - }, - "required": [ - "qubits" - ], - "title": "fixed 2Q gate" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "cu1", - "crz", - "rzz" - ] - }, - "params": { - "maxItems": 1, - "minItems": 1 - }, - "qubits": { - "description": "[control, target]", - "maxItems": 2, - "minItems": 2 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 1, - "minItems": 1 - } - }, - "required": [ - "qubits", - "params" - ], - "title": "1-param 2Q gate" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "cu3" - ] - }, - "params": { - "maxItems": 3, - "minItems": 3 - }, - "qubits": { - "description": "[control, target]", - "maxItems": 2, - "minItems": 2 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 3, - "minItems": 3 - } - }, - "required": [ - "qubits", - "params" - ], - "title": "3-param 2Q controlled gate" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "ccx", - "cswap" - ] - }, - "params": { - "maxItems": 0 - }, - "qubits": { - "description": "[control, control, target]", - "maxItems": 3, - "minItems": 3 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 0 - } - }, - "required": [ - "qubits" - ], - "title": "fixed 3Q gate" - }, - { - "properties": { - "memory": { - "type": "array", - "minItems": 1 - }, - "name": { - "enum": [ - "measure" - ] - }, - "params": { - "maxItems": 0 - }, - "qubits": { - "minItems": 1 - }, - "register": { - "type": "array", - "minItems": 1 - }, - "texparams": { - "maxItems": 0 - } - }, - "required": [ - "qubits", - "memory" - ], - "title": "measurement" - }, - { - "properties": { - "memory": { - "type": "array", - "maxItems": 0 - }, - "name": { - "enum": [ - "barrier" - ] - }, - "params": { - "maxItems": 0 - }, - "qubits": { - "minItems": 1 - }, - "register": { - "type": "array", - "maxItems": 0 - }, - "texparams": { - "maxItems": 0 - } - }, - "required": [ - "qubits" - ], - "title": "barrier" - }, - { - "properties": { - "label": { - "type": "string" - }, - "memory": { - "type": "array" - }, - "name": { - "enum": [ - "snapshot" - ] - }, - "params": { - "type": "array" - }, - "qubits": { - "type": "array" - }, - "register": { - "type": "array" - }, - "snapshot_type": { - "type": "string" - }, - "texparams": { - "maxItems": 0 - } - }, - "required": [ - "label", - "snapshot_type" - ], - "title": "snapshot" - }, - { - "$ref": "#/definitions/bfunc" - }, - { - "$ref": "#/definitions/copy" - } - ], - "properties": { - "conditional": { - "oneOf": [ - { - "minimum": 0, - "type": "integer" - }, - { - "type": "object" - } - ] - - }, - "name": { - "type": "string" - }, - "params": { - "type": "array" - }, - "qubits": { - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "pulse": { - "properties": { - "name": { - "description": "Pulse name", - "type": "string" - }, - "samples": { - "$ref": "#/definitions/complex_array" - } - }, - "required": [ - "name", - "samples" - ], - "type": "object" - }, - "pulse_library": { - "description": "Pulse library for the backend to use", - "items": { - "$ref": "#/definitions/pulse" - }, - "type": "array" - }, - "calibration_entry": { - "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" - }, - "instructions": { - "description": "Pulse instructions implementing the given gate.", - "type": "array", - "items": { - "$ref": "#/definitions/qobjinstructions" - } - } - }, - "required": [ - "name", - "qubits", - "params", - "instructions" - ] - }, - "qobjexp": { - "description": "Quantum experiment", - "properties": { - "config": { - "description": "Configuration options that apply to specific experiments in this qobj. Overwrites qobj level configuration.", - "properties": { - "memory_slots": { - "description": "Total number of (slow) measurement slots used in this experiment.", - "minimum": 0, - "type": "integer" - }, - "n_qubits": { - "description": "Total number of qubits used in this experiment.", - "minimum": 1, - "type": "integer" - }, - "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": { - "description": "A list of dicts which contain all the required information to lower a gate to waveforms.", - "type": "array", - "items": { - "$ref": "#/definitions/calibration_entry" - } - } - } - } - }, - "title": "Experiment level configuration", - "type": "object" - }, - "header": { - "description": "Experiment metadata that does not affect how the experiment is run on the backend. Carried through to the result.", - "properties": { - "name": { - "description": "Experiment name.", - "type": "string" - }, - "memory_slots": { - "description": "Total number of (slow) measurement slots used in this experiment.", - "minimum": 0, - "type": "integer" - }, - "n_qubits": { - "description": "Total number of qubits used in this experiment.", - "minimum": 1, - "type": "integer" - }, - "qreg_sizes": { - "description": "A list of [qreg_name, size], to identify the QASM quantum registers and their size, where the most significant register appears first, and the least significant register last.", - "items": - { - "items": [ - { - "minLength": 1, - "title": "qreg", - "type": "string" - }, - { - "description": "size of corresponding quantum register", - "minimum": 1, - "title": "qreg size", - "type": "integer" - } - ], - "maxItems": 2, - "minItems": 2, - "type": [ - "array" - ] - }, - "minItems": 1, - "title": "List of quantum registers and their sizes.", - "type": "array" - }, - "creg_sizes": { - "description": "A list of [creg_name, size], to identify the QASM classical registers and their size, where the most significant register appears first, and the least significant register last.", - "items": - { - "items": [ - { - "minLength": 1, - "title": "creg", - "type": "string" - }, - { - "description": "size of corresponding classical register", - "minimum": 1, - "title": "creg size", - "type": "integer" - } - ], - "maxItems": 2, - "minItems": 2, - "type": [ - "array" - ] - }, - "minItems": 0, - "title": "List of classical registers and their sizes.", - "type": "array" - }, - "qubit_labels": { - "description": "A list of length total physical qubits (from backend.configuration), where each element is either [qreg_name, n] to identify the corresponding physical qubit as the n-th qubit of qreg qreg_name, or null to identify that the corresponding physical qubit has no corresponding qreg", - "items": { - "items": [ - { - "minLength": 1, - "title": "qreg", - "type": "string" - }, - { - "description": "The qubit index within the qreg", - "minimum": 0, - "title": "qubit index", - "type": "integer" - } - ], - "maxItems": 2, - "minItems": 2, - "type": [ - "array", - "null" - ] - }, - "minItems": 1, - "title": "Map physical qubits to qregs (for QASM)", - "type": "array" - }, - "clbit_labels": { - "description": "A list of length memory_slots, where each element is [creg_name, n] to identify the corresponding memory slot as the n-th element of creg creg_name.", - "items": [ - { - "items": [ - { - "minLength": 1, - "title": "creg", - "type": "string" - }, - { - "description": "The clbit index within creg", - "minimum": 0, - "title": "clbit index", - "type": "integer" - } - ], - "maxItems": 2, - "minItems": 2, - "type": [ - "array" - ] - } - ], - "minItems": 0, - "title": "Map physical clbits to register_slots (for QASM)", - "type": "array" - } - }, - "type": "object", - "_constraints": [ - "sum(x[1] for x in qreg_sizes) == n_qubits", - "sum(x[1] for x in creg_sizes) == memory_slots" - ] - }, - "instructions": { - "description": "List of experiment instructions.", - "type": "array" - } - }, - "required": [ - "instructions" - ], - "type": "object" - }, - "qobjinstructions": { - "properties": { - "instructions": { - "items": { - "$ref": "#/definitions/openpulse_instructions" - } - } - } - }, - "qobj_qasm": { - "properties": { - "config": { - "description": "Configuration options that apply to all experiments in this qobj. For options that may be set on a per-experiment basis, these are the defaults.", - "properties": { - "max_credits": { - "type": "integer" - }, - "memory_slots": { - "description": "The number of (slow) measurement slots requested on the backend, equivalent to the max of memory_slot requested by individual experiments.", - "minimum": 0, - "type": "integer" - }, - "n_qubits": { - "description": "The number of qubits requested on the backend, equivalent to the max of n_qubits requested by individual experiments.", - "minimum": 1, - "type": "integer" - }, - "seed": { - "type": "integer" - }, - "shots": { - "description": "Number of repetitions of each experiment", - "minimum": 1, - "type": "integer" - }, - "kernels": { - "type": "object", - "patternProperties": { - "^q[0-9]+$": { - "$ref": "#/definitions/kernel" - } - } - }, - "discriminators": { - "type": "object", - "patternProperties": { - "^q[0-9]+$": { - "$ref": "#/definitions/discriminator" - } - } - }, - "pulse_library": { - "$ref": "#/definitions/pulse_library" - }, - "rep_delay": { - "minimum": 0, - "description": "Delay between programs (microseconds).", - "type": "number" - }, - "calibrations": { - "description": "User-specified pulse-level calibrations for operations utilized across all experiments in this job.", - "type": "object", - "properties": { - "gates": { - "description": "A list of dicts which contain all the required information to lower a gate to waveforms.", - "type": "array", - "items": { - "$ref": "#/definitions/calibration_entry" - } - } - } - }, - "qubit_lo_freq": { - "description": "Qubit drive LO frequencies", - "items": { - "minimum": 0, - "type": "number" - }, - "minItems": 1, - "type": "array" - }, - "meas_lo_freq": { - "description": "Measurement LO frequencies", - "items": { - "minimum": 0, - "type": "number" - }, - "minItems": 1, - "type": "array" - } - }, - "title": "Qobj-level configuration", - "type": "object" - }, - "experiments": { - "description": "List of experiments to run", - "minItems": 1, - "type": "array" - }, - "header": { - "description": "QObj metadata that does not affect how the experiments are run on the backend. Carried through to the result.", - "properties": { - "backend_name": { - "description": "The backend this set of experiments was generated for. It may also be able to execute on other backends.", - "type": "string" - }, - "backend_version": { - "description": "The backend version this set of experiments was generated for. ", - "type": "string" - } - }, - "type": "object" - }, - "qobj_id": { - "description": "User generated qobj ID", - "type": "string" - }, - "schema_version": { - "description": "Schema version used to compile the qobj", - "type": "string" - }, - "type": { - "description": "Type of instruction set used for the experiment, QASM or PULSE", - "enum": [ - "QASM", - "PULSE" - ], - "type": "string" - } - }, - "required": [ - "qobj_id", - "schema_version", - "type", - "experiments", - "config", - "header" - ], - "type": "object" - }, - "qobj_openpulse": { - "properties": { - "config": { - "properties": { - "meas_level": { - "enum": [ - 0, - 1, - 2 - ] - }, - "meas_return": { - "description": "Return each shot of data or average over the shots", - "enum": [ - "single", - "avg" - ] - }, - "memory_slot_size": { - "default": 1, - "description": "Size of each memory slot. For measurement level 0 (raw) this sets the length of each measurement acquisition", - "minimum": 0, - "type": "integer" - }, - "pulse_library": { - "$ref": "#/definitions/pulse_library" - }, - "rep_time": { - "minimum": 1, - "description": "Execution time of program (microseconds).", - "type": "integer" - }, - "rep_delay": { - "minimum": 0, - "description": "Delay between programs (microseconds).", - "type": "number" - } - }, - "required": [ - "meas_level", - "meas_lo_freq", - "meas_return", - "pulse_library", - "qubit_lo_freq" - ] - }, - "experiments": { - "items": { - "allOf": [ - { - "$ref": "#/definitions/qobjexp" - }, - { - "$ref": "#/definitions/qobjinstructions" - } - ] - }, - "type": "array" - }, - "type": { - "enum": [ - "PULSE" - ] - } - } - } - }, - "oneOf": [ - { - "allOf": [ - { - "$ref": "#/definitions/qobj_qasm" - }, - { - "properties": { - "experiments": { - "items": { - "allOf": [ - { - "$ref": "#/definitions/qobjexp" - }, - { - "properties": { - "instructions": { - "items": { - "$ref": "#/definitions/openqasm_instructions" - } - } - } - } - ] - } - }, - "type": { - "enum": [ - "QASM" - ] - } - } - } - ] - }, - { - "allOf": [ - { - "$ref": "#/definitions/qobj_qasm" - }, - { - "$ref": "#/definitions/qobj_openpulse" - } - ] - } - ] -} diff --git a/qiskit/schemas/result_schema.json b/qiskit/schemas/result_schema.json deleted file mode 100644 index 7dafee27e5f0..000000000000 --- a/qiskit/schemas/result_schema.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://www.qiskit.org/schemas/result_schema.json", - "title": "qobj results", - "description": "The results of executing a qobj", - "version": "1.0.0", - "definitions": { - "complex": { - "description": "JSON representation of a complex number", - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": "number" - } - }, - "complex_array": { - "description": "JSON representation of a complex vector", - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/complex" - } - }, - "complex_matrix": { - "description": "JSON representation of a complex matrix", - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/complex_array" - } - }, - "memory": { - "type": "array", - "minItems": 1, - "description": "Output of the memory"}, - "resultobj": { - "type": "object", - "required": ["success", "shots", "data"], - "properties": { - "shots": { - "oneOf": [{ - "type": "array", - "minItems": 2, "maxItems": 2, - "items": {"type": "integer", "minimum": 1}}, - {"type": "integer"}], - "description": "The starting and ending shot for this data. If there is only one shot to the experiment this is [1,1]" - }, - "success": { - "type": "boolean", - "description": "If true, we can trust results for this experiment." - }, - "status": { - "type": "string", - "description": "Human-readable description of status of this experiment" - }, - "seed": { - "type": "integer", - "description": "Experiment-level random seed" - }, - "meas_level": { - "type": "integer", - "enum": [0, 1, 2], - "description": "Measurement level of experiment" - }, - "meas_return": { - "type": "string", - "enum": ["single","avg"], - "description": "Is the data averaged or from each shot" - }, - "header": { - "type": "object", - "properties": {}, - "description": "Header passed through from the qobj with experiment metadata"}, - "data": { - "type": "object", - "properties": { - "counts": { - "type": "object", - "description": "Histogram of the memory over the indicated shots", - "patternProperties": { - "^0x([0-9A-Fa-f])+$": {"type": "integer", - "minimum": 0 } - }, - "additionalProperties": false - }, - "snapshots": { - "description": "collection of all snapshots of simulator state", - "type": "object" - }, - "memory": { - "$ref": "#/definitions/memory" - }, - "statevector": { - "$ref": "#/definitions/complex_array" - }, - "unitary": { - "$ref": "#/definitions/complex_matrix" - } - - } - } - } - } - }, - "type": "object", - "required": ["backend_name", "backend_version", "qobj_id", "job_id", "success", "results"], - "properties": { - "backend_name": { - "type": "string", - "description": "Backend name" - }, - "backend_version": { - "type": "string", - "pattern": "[0-9]+.[0-9]+.[0-9]+$", - "description": "Backend version in the form X.X.X" - }, - "qobj_id": { - "type": "string", - "description": "User generated Qobj id" - }, - "job_id": { - "type": "string", - "description": "Unique execution id from the backend" - }, - "date": { - "type": "string", - "format": "date-time", - "description": "Date/time of job execution" - }, - "success": { - "type": "boolean", - "description": "True if complete input qobj executed correctly. (Implies each experiment success)" - }, - "status": { - "type": "string", - "description": "Human-readable status of complete qobj execution" - }, - "header": { - "type": "object", - "properties": {}, - "description": "Header passed through from the qobj with job metadata"}, - "results": { - "type": "array", - "description": "Corresponding results for array of experiments of the input qobj", - "items": {"$ref": "#/definitions/resultobj"} - } - } -} diff --git a/qiskit/validation/__init__.py b/qiskit/validation/__init__.py deleted file mode 100644 index e2a4285dab61..000000000000 --- a/qiskit/validation/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2017, 2018. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -""" -============================================= -Models and Schemas (:mod:`qiskit.validation`) -============================================= - -.. currentmodule:: qiskit.validation - -JSON Schema -=========== - -.. autosummary:: - :toctree: ../stubs/ - - jsonschema.validate_json_against_schema - -Exceptions -========== - -.. autosummary:: - :toctree: ../stubs/ - - jsonschema.SchemaValidationError -""" diff --git a/qiskit/validation/jsonschema/__init__.py b/qiskit/validation/jsonschema/__init__.py deleted file mode 100644 index df24fdbd61c1..000000000000 --- a/qiskit/validation/jsonschema/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2017, 2019. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -"""DEPRECATED: Validation using the .json schemas.""" - -from .exceptions import SchemaValidationError -from .schema_validation import validate_json_against_schema diff --git a/qiskit/validation/jsonschema/exceptions.py b/qiskit/validation/jsonschema/exceptions.py deleted file mode 100644 index af60459b6811..000000000000 --- a/qiskit/validation/jsonschema/exceptions.py +++ /dev/null @@ -1,45 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2017, 2018. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -"""Error handling for jsonschema validation.""" - -from qiskit.exceptions import QiskitError - - -class SchemaValidationError(QiskitError): - """Represents an error during JSON Schema validation.""" - - pass - - -class _SummaryValidationError(QiskitError): - """Cut off the message of a jsonschema.ValidationError for compactness. - - Cut off the message of a jsonschema.ValidationError to avoid printing - noise in the standard output. The original validation error is in the - `validation_error` property. - - Attributes: - validation_error (jsonschema.ValidationError): original validations - error. - """ - - def __init__(self, validation_error): - super().__init__(self._shorten_message(str(validation_error))) - self.validation_error = validation_error - - @staticmethod - def _shorten_message(message): - if len(message) > 1000: - return "Original message too long to be useful: {}[...]" "".format(message[:1000]) - - return message diff --git a/qiskit/validation/jsonschema/schema_validation.py b/qiskit/validation/jsonschema/schema_validation.py deleted file mode 100644 index b7be8d9f82c4..000000000000 --- a/qiskit/validation/jsonschema/schema_validation.py +++ /dev/null @@ -1,236 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2017, 2018. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -"""Validation module for validation against JSON schemas.""" - -import json -import os -import warnings - -import jsonschema - -from .exceptions import SchemaValidationError, _SummaryValidationError - - -_DEFAULT_SCHEMA_PATHS = { - "backend_configuration": "schemas/backend_configuration_schema.json", - "backend_properties": "schemas/backend_properties_schema.json", - "backend_status": "schemas/backend_status_schema.json", - "default_pulse_configuration": "schemas/default_pulse_configuration_schema.json", - "job_status": "schemas/job_status_schema.json", - "qobj": "schemas/qobj_schema.json", - "result": "schemas/result_schema.json", -} -# Schema and Validator storage -_SCHEMAS = {} -_VALIDATORS = {} - - -def _load_schema(file_path, name=None): - """Loads the QObj schema for use in future validations. - - Caches schema in _SCHEMAS module attribute. - - Args: - file_path(str): Path to schema. - name(str): Given name for schema. Defaults to file_path filename - without schema. - Return: - schema(dict): Loaded schema. - """ - if name is None: - # filename without extension - name = os.path.splitext(os.path.basename(file_path))[0] - if name not in _SCHEMAS: - with open(file_path) as schema_file: - _SCHEMAS[name] = json.load(schema_file) - - return _SCHEMAS[name] - - -def _get_validator(name, schema=None, check_schema=True, validator_class=None, **validator_kwargs): - """Generate validator for JSON schema. - - Args: - name (str): Name for validator. Will be validator key in - `_VALIDATORS` dict. - schema (dict): JSON schema `dict`. If not provided searches for schema - in `_SCHEMAS`. - check_schema (bool): Verify schema is valid. - validator_class (jsonschema.IValidator): jsonschema IValidator instance. - Default behavior is to determine this from the schema `$schema` - field. - **validator_kwargs: Additional keyword arguments for validator. - - Return: - jsonschema.IValidator: Validator for JSON schema. - - Raises: - SchemaValidationError: Raised if validation fails. - """ - if schema is None: - try: - schema = _SCHEMAS[name] - except KeyError as ex: - raise SchemaValidationError("Valid schema name or schema must be provided.") from ex - - if name not in _VALIDATORS: - # Resolve JSON spec from schema if needed - if validator_class is None: - validator_class = jsonschema.validators.validator_for(schema) - - # Generate and store validator in _VALIDATORS - _VALIDATORS[name] = validator_class(schema, **validator_kwargs) - if check_schema: - _VALIDATORS[name].check_schema(schema) - - validator = _VALIDATORS[name] - return validator - - -def _load_schemas_and_validators(): - """Load all default schemas into `_SCHEMAS`.""" - schema_base_path = os.path.join(os.path.dirname(__file__), "../..") - for name, path in _DEFAULT_SCHEMA_PATHS.items(): - _load_schema(os.path.join(schema_base_path, path), name) - _get_validator(name) - - -# Load all schemas on import -_load_schemas_and_validators() - - -def validate_json_against_schema(json_dict, schema, err_msg=None): - """Validates JSON dict against a schema. - - Args: - json_dict (dict): JSON to be validated. - schema (dict or str): JSON schema dictionary or the name of one of the - standards schemas in Qiskit to validate against it. The list of - standard schemas is: ``backend_configuration``, - ``backend_properties``, ``backend_status``, - ``default_pulse_configuration``, ``job_status``, ``qobj``, - ``result``. - err_msg (str): Optional error message. - - Raises: - SchemaValidationError: Raised if validation fails. - """ - warnings.warn( - "The jsonschema validation included in qiskit-terra is " - "deprecated and will be removed in a future release. " - "If you're relying on this schema validation you should " - "pull the schemas from the Qiskit/ibmq-schemas and directly " - "validate your payloads with that", - DeprecationWarning, - stacklevel=2, - ) - if isinstance(schema, str): - schema_name = schema - schema = _SCHEMAS[schema_name] - validator = _get_validator(schema_name) - errors = list(validator.iter_errors(json_dict)) - if errors: - best_match_error = jsonschema.exceptions.best_match(errors) - failure_path = list(best_match_error.absolute_path) - if len(failure_path) > 1: - failure_path = failure_path[:-1] - error_path = "" - for component in failure_path: - if isinstance(component, int): - error_path += "[%s]" % component - else: - error_path += "['%s']" % component - if failure_path: - err_message = "Validation failed. Possibly at %s" % error_path - err_message += " because of %s" % best_match_error.message - else: - err_message = "Validation failed. " - err_message += "Possibly because %s" % best_match_error.message - raise SchemaValidationError(err_message) - else: - try: - jsonschema.validate(json_dict, schema) - except jsonschema.ValidationError as err: - if err_msg is None: - err_msg = ( - "JSON failed validation. Set Qiskit log level to " - "DEBUG for further information." - ) - newerr = SchemaValidationError(err_msg) - newerr.__cause__ = _SummaryValidationError(err) - raise newerr - - -def _format_causes(err, level=0): - """Return a cascading explanation of the validation error. - - Returns a cascading explanation of the validation error in the form of:: - - failed @ because of: - failed @ because of: - ... - failed @ because of: - ... - ... - - For example:: - - 'oneOf' failed @ '' because of: - 'required' failed @ '.config' because of: - 'meas_level' is a required property - - Meaning the validator 'oneOf' failed while validating the whole object - because of the validator 'required' failing while validating the property - 'config' because its 'meas_level' field is missing. - - The cascade repeats the format " failed @ because of" - until there are no deeper causes. In this case, the string representation - of the error is shown. - - Args: - err (jsonschema.ValidationError): the instance to explain. - level (int): starting level of indentation for the cascade of - explanations. - - Return: - str: a formatted string with the explanation of the error. - - """ - lines = [] - - def _print(string, offset=0): - lines.append(_pad(string, offset=offset)) - - def _pad(string, offset=0): - padding = " " * (level + offset) - padded_lines = [padding + line for line in string.split("\n")] - return "\n".join(padded_lines) - - def _format_path(path): - def _format(item): - if isinstance(item, str): - return ".{}".format(item) - - return "[{}]".format(item) - - return "".join([""] + list(map(_format, path))) - - _print("'{}' failed @ '{}' because of:".format(err.validator, _format_path(err.absolute_path))) - - if not err.context: - _print(str(err.message), offset=1) - else: - for suberr in err.context: - lines.append(_format_causes(suberr, level + 1)) - - return "\n".join(lines) diff --git a/releasenotes/notes/remove-schemas-ca9f3f2e0f08bca8.yaml b/releasenotes/notes/remove-schemas-ca9f3f2e0f08bca8.yaml new file mode 100644 index 000000000000..8b508bed64d0 --- /dev/null +++ b/releasenotes/notes/remove-schemas-ca9f3f2e0f08bca8.yaml @@ -0,0 +1,36 @@ +--- +upgrade: + - | + The deprecated ``qiskit.schemas`` module and the ``qiskit.validation`` + module which build jsonschema validator from the schemas have been removed. + This was deprecated in the 0.17.0 release and has been replaced with a + dedicated repository for the IBM Quantum API payload schemas: + + https://github.com/Qiskit/ibm-quantum-schemas + + If you were relying on the schema files previously packaged in + ``qiskit.schemas`` or the validators built on them you should use that + repository and create validators from the schema files it contains. + - | + The functions ``qiskit.qobj.validate_qobj_against_schema`` and + ``qiskit.qobj.common.validator`` along with the ``validate`` kwarg of + the methods :meth:`qiskit.qobj.QasmQobj.to_dict`, + :meth:`qiskit.qobj.PulseQobj.to_dict`, and :meth:`qiskit.qobj.Qobj.to_dict` + have been removed. These were deprecated in the 0.17.0 release. If you were + using these function you will have to manually build jsonschema validation + functions for ``Qobj`` objects using the jsonschema files from: + https://github.com/Qiskit/ibm-quantum-schemas + - | + The ``fastjsonschema`` and ``jsonschema`` are no longer in the requirements + list for qiskit-terra. The internal use of jsonschema has been removed and + they are no longer required to use qiskit-terra. + - | + The exception raised by the :func:`qiskit.compiler.assemble` function when + invalid parameters are passed in for constructing a + :class:`~qiskit.qobj.PulseQobj` have changed from a ``SchemaValidationError` + to a :class:`qiskit.execeptions.QiskitError`. This was necessary because + the ``SchemaValidationError`` class was removed along with the rest of + the deprecated ``qiskit.schemas`` and ``qiskit.validation``. This also + makes it more consistent with other error conditions from + :func:`~qiskit.compiler.assemble` which were already raising a + :class:`qiskit.execeptions.QiskitError`. diff --git a/requirements.txt b/requirements.txt index 9e7be907d3a2..3d6dd5c5b8fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ contextvars>=2.4;python_version<'3.7' -jsonschema>=2.6 retworkx>=0.9.0 numpy>=1.17 ply>=3.10 @@ -7,7 +6,6 @@ psutil>=5 scipy>=1.4 sympy>=1.3 dill>=0.3 -fastjsonschema>=2.10 python-constraint>=1.4 python-dateutil>=2.8.0 symengine>0.7 ; platform_machine == 'x86_64' or platform_machine == 'aarch64' or platform_machine == 'ppc64le' or platform_machine == 'amd64' or platform_machine == 'arm64' diff --git a/test/python/circuit/test_unitary.py b/test/python/circuit/test_unitary.py index 2c0af5254d41..923ab1573140 100644 --- a/test/python/circuit/test_unitary.py +++ b/test/python/circuit/test_unitary.py @@ -174,7 +174,7 @@ def test_qobj_with_unitary_matrix(self): self.assertEqual(instr.name, "unitary") assert_allclose(numpy.array(instr.params[0]).astype(numpy.complex64), matrix) # check conversion to dict - qobj_dict = qobj.to_dict(validate=True) + qobj_dict = qobj.to_dict() class NumpyEncoder(json.JSONEncoder): """Class for encoding json str with complex and numpy arrays.""" diff --git a/test/python/compiler/test_assembler.py b/test/python/compiler/test_assembler.py index 99d71821dc0d..9754894c5795 100644 --- a/test/python/compiler/test_assembler.py +++ b/test/python/compiler/test_assembler.py @@ -28,12 +28,11 @@ from qiskit.pulse.channels import MemorySlot, AcquireChannel, DriveChannel, MeasureChannel from qiskit.pulse.configuration import Kernel, Discriminator from qiskit.pulse.library import gaussian -from qiskit.qobj import QasmQobj, validate_qobj_against_schema +from qiskit.qobj import QasmQobj, PulseQobj from qiskit.qobj.utils import MeasLevel, MeasReturnType from qiskit.pulse.macros import measure from qiskit.test import QiskitTestCase from qiskit.test.mock import FakeOpenPulse2Q, FakeOpenPulse3Q, FakeYorktown, FakeAlmaden -from qiskit.validation.jsonschema import SchemaValidationError class RxGate(Gate): @@ -78,7 +77,6 @@ def setUp(self): def test_assemble_single_circuit(self): """Test assembling a single circuit.""" qobj = assemble(self.circ, shots=2000, memory=True) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.config.shots, 2000) @@ -104,7 +102,6 @@ def test_assemble_multiple_circuits(self): circ1.measure(qr1, qc1) qobj = assemble([circ0, circ1], shots=100, memory=False, seed_simulator=6) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.config.seed_simulator, 6) @@ -116,7 +113,6 @@ def test_assemble_multiple_circuits(self): def test_assemble_no_run_config(self): """Test assembling with no run_config, relying on default.""" qobj = assemble(self.circ) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.config.shots, 1024) @@ -135,8 +131,6 @@ def test_default_shots_greater_than_max_shots(self): qobj = assemble(self.circ, self.backend) - validate_qobj_against_schema(qobj) - self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.config.shots, 5) @@ -147,7 +141,6 @@ def test_assemble_initialize(self): circ.initialize([1 / np.sqrt(2), 0, 0, 1 / np.sqrt(2)], q[:]) qobj = assemble(circ) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.experiments[0].instructions[0].name, "initialize") @@ -158,7 +151,6 @@ def test_assemble_initialize(self): def test_assemble_meas_level_meas_return(self): """Test assembling a circuit schedule with `meas_level`.""" qobj = assemble(self.circ, meas_level=1, meas_return="single") - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.config.meas_level, 1) @@ -166,7 +158,6 @@ def test_assemble_meas_level_meas_return(self): # no meas_level set qobj = assemble(self.circ) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.config.meas_level, 2) @@ -212,7 +203,7 @@ def test_assemble_user_rep_time_delay(self): # use ``rep_delay`` outside of ``rep_delay_range``` rep_delay_large = 5.0e-6 - with self.assertRaises(SchemaValidationError): + with self.assertRaises(QiskitError): assemble(self.circ, self.backend, rep_delay=rep_delay_large) def test_assemble_opaque_inst(self): @@ -224,7 +215,6 @@ def test_assemble_opaque_inst(self): circ.append(opaque_inst, [q[0], q[2], q[5], q[3]], [c[3], c[0]]) qobj = assemble(circ) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(len(qobj.experiments[0].instructions), 1) @@ -247,7 +237,6 @@ def test_assemble_unroll_parametervector(self): qc.bind_parameters({pv1: [0.1, 0.2, 0.3], pv2: [0.4, 0.5, 0.6]}) qobj = assemble(qc, parameter_binds=[{pv1: [0.1, 0.2, 0.3], pv2: [0.4, 0.5, 0.6]}]) - validate_qobj_against_schema(qobj) self.assertIsInstance(qobj, QasmQobj) self.assertEqual(qobj.experiments[0].instructions[0].params[0], 0.100000000000000) @@ -270,7 +259,6 @@ def test_measure_to_registers_when_conditionals(self): qc.h(qr[1]).c_if(cr2, 3) qobj = assemble(qc) - validate_qobj_against_schema(qobj) first_measure, second_measure = [ op for op in qobj.experiments[0].instructions if op.name == "measure" @@ -290,7 +278,6 @@ def test_convert_to_bfunc_plus_conditional(self): qc.h(qr[0]).c_if(cr, 1) qobj = assemble(qc) - validate_qobj_against_schema(qobj) bfunc_op, h_op = qobj.experiments[0].instructions @@ -311,7 +298,6 @@ def test_convert_to_bfunc_plus_conditional_onebit(self): qc.h(qr[0]).c_if(cr[2], 1) qobj = assemble(qc) - validate_qobj_against_schema(qobj) inst_set = qobj.experiments[0].instructions [bfunc_op, h_op] = inst_set @@ -337,7 +323,6 @@ def test_resize_value_to_register(self): qc.h(qr[0]).c_if(cr2, 2) qobj = assemble(qc) - validate_qobj_against_schema(qobj) bfunc_op, h_op = qobj.experiments[0].instructions @@ -429,7 +414,6 @@ def test_assemble_circuits_binds_parameters(self): bind_args = {"parameter_binds": [{x: 0, y: 0}, {x: 1, y: 0}, {x: 1, y: 1}]} qobj = assemble([qc1, qc2, qc3], **bind_args) - validate_qobj_against_schema(qobj) self.assertEqual(len(qobj.experiments), 9) self.assertEqual( @@ -628,7 +612,6 @@ def test_job_qubit_meas_los_no_range(self): qubit_lo_freq=self.default_qubit_lo_freq, meas_lo_freq=self.default_meas_lo_freq, ) - validate_qobj_against_schema(qobj) # convert to ghz qubit_lo_freq_ghz = [freq / 1e9 for freq in self.default_qubit_lo_freq] @@ -710,7 +693,6 @@ def test_job_qubit_meas_los_w_range(self): qubit_lo_range=qubit_lo_range, meas_lo_range=meas_lo_range, ) - validate_qobj_against_schema(qobj) # convert to ghz qubit_lo_freq_ghz = [freq / 1e9 for freq in self.default_qubit_lo_freq] @@ -729,7 +711,6 @@ def test_assemble_single_circ_single_lo_config(self): meas_lo_freq=self.default_meas_lo_freq, schedule_los=self.user_lo_config, ) - validate_qobj_against_schema(qobj) self.assertListEqual(qobj.config.qubit_lo_freq, [5.55, 5, 5, 4.91, 5]) self.assertListEqual(qobj.config.meas_lo_freq, [6.64, 6.7, 6.7, 6.7, 6.1]) @@ -745,7 +726,6 @@ def test_assemble_single_circ_single_lo_config_dict(self): meas_lo_freq=self.default_meas_lo_freq, schedule_los=self.user_lo_config_dict, ) - validate_qobj_against_schema(qobj) self.assertListEqual(qobj.config.qubit_lo_freq, [5.55, 5, 5, 4.91, 5]) self.assertListEqual(qobj.config.meas_lo_freq, [6.64, 6.7, 6.7, 6.7, 6.1]) @@ -769,7 +749,6 @@ def test_assemble_single_circ_multi_lo_config(self): meas_lo_freq=self.default_meas_lo_freq, schedule_los=[self.user_lo_config, user_lo_config2], ) - validate_qobj_against_schema(qobj) qubit_lo_freq_ghz = [freq / 1e9 for freq in self.default_qubit_lo_freq] meas_lo_freq_ghz = [freq / 1e9 for freq in self.default_meas_lo_freq] @@ -801,7 +780,6 @@ def test_assemble_multi_circ_multi_lo_config(self): meas_lo_freq=self.default_meas_lo_freq, schedule_los=[self.user_lo_config, user_lo_config2], ) - validate_qobj_against_schema(qobj) qubit_lo_freq_ghz = [freq / 1e9 for freq in self.default_qubit_lo_freq] meas_lo_freq_ghz = [freq / 1e9 for freq in self.default_meas_lo_freq] @@ -826,7 +804,6 @@ def test_assemble_multi_circ_single_lo_config(self): meas_lo_freq=self.default_meas_lo_freq, schedule_los=self.user_lo_config, ) - validate_qobj_against_schema(qobj) self.assertListEqual(qobj.config.qubit_lo_freq, [5.55, 5, 5, 4.91, 5]) self.assertListEqual(qobj.config.meas_lo_freq, [6.64, 6.7, 6.7, 6.7, 6.1]) @@ -864,7 +841,6 @@ def test_assemble_circ_lo_config_errors(self): } qobj = assemble(self.circ, self.backend, schedule_los=full_lo_config_dict) - validate_qobj_against_schema(qobj) self.assertListEqual(qobj.config.qubit_lo_freq, [4.85, 4.9, 4.95, 5, 5.05]) self.assertListEqual(qobj.config.meas_lo_freq, [6.8, 6.85, 6.9, 6.95, 7]) @@ -974,7 +950,6 @@ def test_assemble_sample_pulse(self): schedule_los=[], **self.config, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() experiment = test_dict["experiments"][0] @@ -1000,7 +975,6 @@ def test_assemble_single_schedule_without_lo_config(self): schedule_los=[], **self.config, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() self.assertListEqual(test_dict["config"]["qubit_lo_freq"], [4.9, 5.0]) @@ -1016,7 +990,6 @@ def test_assemble_multi_schedules_without_lo_config(self): meas_lo_freq=self.default_meas_lo_freq, **self.config, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() self.assertListEqual(test_dict["config"]["qubit_lo_freq"], [4.9, 5.0]) @@ -1033,7 +1006,6 @@ def test_assemble_single_schedule_with_lo_config(self): schedule_los=self.user_lo_config, **self.config, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() self.assertListEqual(test_dict["config"]["qubit_lo_freq"], [4.91, 5.0]) @@ -1050,7 +1022,6 @@ def test_assemble_single_schedule_with_lo_config_dict(self): schedule_los=self.user_lo_config_dict, **self.config, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() self.assertListEqual(test_dict["config"]["qubit_lo_freq"], [4.91, 5.0]) @@ -1084,7 +1055,6 @@ def test_assemble_multi_schedules_with_multi_lo_configs(self): schedule_los=[self.user_lo_config, self.user_lo_config], **self.config, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() self.assertListEqual(test_dict["config"]["qubit_lo_freq"], [4.9, 5.0]) @@ -1116,15 +1086,15 @@ def test_assemble_meas_map(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0], [1]], ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) - assemble( + qobj = assemble( schedule, qubit_lo_freq=self.default_qubit_lo_freq, meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1, 2]], ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_assemble_memory_slots(self): """Test assembling a schedule and inferring number of memoryslots.""" @@ -1141,7 +1111,6 @@ def test_assemble_memory_slots(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0], [1]], ) - validate_qobj_against_schema(qobj) self.assertEqual(qobj.config.memory_slots, n_memoryslots) # this should be in experimental header as well @@ -1164,7 +1133,6 @@ def test_assemble_memory_slots(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0], [1]], ) - validate_qobj_against_schema(qobj) self.assertEqual(qobj.config.memory_slots, n_memoryslots) # this should be in experimental header as well @@ -1187,7 +1155,6 @@ def test_assemble_memory_slots_for_schedules(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0], [1]], ) - validate_qobj_against_schema(qobj) self.assertEqual(qobj.config.memory_slots, max(n_memoryslots)) self.assertEqual(qobj.experiments[0].header.memory_slots, n_memoryslots[0]) @@ -1212,7 +1179,6 @@ def test_pulse_name_conflicts(self): schedule_los=[], **self.config, ) - validate_qobj_against_schema(qobj) self.assertNotEqual(qobj.config.pulse_library[0].name, qobj.config.pulse_library[1].name) @@ -1239,7 +1205,6 @@ def test_assemble_with_delay(self): delay_schedule += self.schedule delay_qobj = assemble(delay_schedule, self.backend) - validate_qobj_against_schema(delay_qobj) self.assertEqual(delay_qobj.experiments[0].instructions[0].name, "delay") self.assertEqual(delay_qobj.experiments[0].instructions[0].duration, 10) self.assertEqual(delay_qobj.experiments[0].instructions[0].t0, 0) @@ -1264,7 +1229,6 @@ def test_delay_removed_on_acq_ch(self): sched2 += self.schedule # includes ``Acquire`` instr delay_qobj = assemble([sched0, sched1, sched2], self.backend) - validate_qobj_against_schema(delay_qobj) # check that no delay instrs occur on acquire channels is_acq_delay = False @@ -1294,7 +1258,6 @@ def test_assemble_schedule_enum(self): meas_level=MeasLevel.CLASSIFIED, meas_return=MeasReturnType.AVERAGE, ) - validate_qobj_against_schema(qobj) test_dict = qobj.to_dict() self.assertEqual(test_dict["config"]["meas_return"], "avg") @@ -1436,7 +1399,7 @@ def test_assemble_user_rep_time_delay(self): # use ``rep_delay`` outside of ``rep_delay_range self.config["rep_delay"] = 5.0e-6 - with self.assertRaises(SchemaValidationError): + with self.assertRaises(QiskitError): assemble(self.schedule, self.backend, **self.config) def test_assemble_with_individual_discriminators(self): @@ -1458,7 +1421,6 @@ def test_assemble_with_individual_discriminators(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1]], ) - validate_qobj_against_schema(qobj) qobj_discriminators = qobj.experiments[0].instructions[0].discriminators self.assertEqual(len(qobj_discriminators), 2) @@ -1485,7 +1447,6 @@ def test_assemble_with_single_discriminators(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1]], ) - validate_qobj_against_schema(qobj) qobj_discriminators = qobj.experiments[0].instructions[0].discriminators self.assertEqual(len(qobj_discriminators), 1) @@ -1530,7 +1491,6 @@ def test_assemble_with_individual_kernels(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1]], ) - validate_qobj_against_schema(qobj) qobj_kernels = qobj.experiments[0].instructions[0].kernels self.assertEqual(len(qobj_kernels), 2) @@ -1557,7 +1517,6 @@ def test_assemble_with_single_kernels(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1]], ) - validate_qobj_against_schema(qobj) qobj_kernels = qobj.experiments[0].instructions[0].kernels self.assertEqual(len(qobj_kernels), 1) @@ -1586,8 +1545,7 @@ def test_assemble_with_unequal_kernels(self): def test_assemble_single_instruction(self): """Test assembling schedules, no lo config.""" inst = pulse.Play(pulse.Constant(100, 1.0), pulse.DriveChannel(0)) - qobj = assemble(inst, self.backend) - validate_qobj_against_schema(qobj) + self.assertIsInstance(assemble(inst, self.backend), PulseQobj) def test_assemble_overlapping_time(self): """Test that assembly errors when qubits are measured in overlapping time.""" @@ -1639,7 +1597,7 @@ def test_assemble_non_overlapping_time_single_meas_map(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1]], ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_assemble_disjoint_time(self): """Test that assembly works when qubits are in disjoint meas map sets.""" @@ -1656,7 +1614,7 @@ def test_assemble_disjoint_time(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 2], [1, 3]], ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_assemble_valid_qubits(self): """Test that assembly works when qubits that are in the measurement map @@ -1677,7 +1635,7 @@ def test_assemble_valid_qubits(self): meas_lo_freq=self.default_meas_lo_freq, meas_map=[[0, 1, 2], [3]], ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) class TestPulseAssemblerMissingKwargs(QiskitTestCase): @@ -1721,7 +1679,7 @@ def test_defaults(self): rep_time=self.rep_time, rep_delay=self.rep_delay, ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_missing_qubit_lo_freq(self): """Test error raised if qubit_lo_freq missing.""" @@ -1769,7 +1727,7 @@ def test_missing_memory_slots(self): rep_time=self.rep_time, rep_delay=self.rep_delay, ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_missing_rep_time_and_delay(self): """Test qobj is valid if rep_time and rep_delay are missing.""" @@ -1785,7 +1743,6 @@ def test_missing_rep_time_and_delay(self): rep_time=None, rep_delay=None, ) - validate_qobj_against_schema(qobj) self.assertEqual(hasattr(qobj, "rep_time"), False) self.assertEqual(hasattr(qobj, "rep_delay"), False) @@ -1803,7 +1760,7 @@ def test_missing_meas_map(self): rep_time=self.rep_time, rep_delay=self.rep_delay, ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_missing_lo_ranges(self): """Test that assembly still works if lo_ranges are missing.""" @@ -1819,13 +1776,13 @@ def test_missing_lo_ranges(self): rep_time=self.rep_time, rep_delay=self.rep_delay, ) - validate_qobj_against_schema(qobj) + self.assertIsInstance(qobj, PulseQobj) def test_unsupported_meas_level(self): """Test that assembly raises an error if meas_level is not supported""" backend = FakeOpenPulse2Q() backend.configuration().meas_levels = [1, 2] - with self.assertRaises(SchemaValidationError): + with self.assertRaises(QiskitError): assemble( self.schedule, backend, diff --git a/test/python/qobj/test_qobj.py b/test/python/qobj/test_qobj.py index d87bed0bd6e1..14bc6ea5f5d0 100644 --- a/test/python/qobj/test_qobj.py +++ b/test/python/qobj/test_qobj.py @@ -15,8 +15,6 @@ import copy -import jsonschema - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit from qiskit.compiler import assemble @@ -35,7 +33,6 @@ QasmExperimentCalibrations, GateCalibration, ) -from qiskit.qobj import validate_qobj_against_schema from qiskit.test import QiskitTestCase @@ -78,13 +75,6 @@ def setUp(self): self.bad_qobj = copy.deepcopy(self.valid_qobj) self.bad_qobj.experiments = [] - def test_to_dict_against_schema(self): - """Test dictionary representation of Qobj against its schema.""" - try: - validate_qobj_against_schema(self.valid_qobj) - except jsonschema.ValidationError as validation_error: - self.fail(str(validation_error)) - def test_from_dict_per_class(self): """Test Qobj and its subclass representations given a dictionary.""" test_parameters = { @@ -130,7 +120,7 @@ def test_snapshot_instruction_to_dict(self): ) ], ) - res = valid_qobj.to_dict(validate=True) + res = valid_qobj.to_dict() expected_dict = { "qobj_id": "12345", "type": "QASM", @@ -245,7 +235,7 @@ def test_gate_calibrations_to_dict(self): ) ], ) - res = valid_qobj.to_dict(validate=True) + res = valid_qobj.to_dict() expected_dict = { "qobj_id": "12345", "type": "QASM", @@ -364,13 +354,6 @@ def setUp(self): ], } - def test_to_dict_against_schema(self): - """Test dictionary representation of Qobj against its schema.""" - try: - validate_qobj_against_schema(self.valid_qobj) - except jsonschema.ValidationError as validation_error: - self.fail(str(validation_error)) - def test_from_dict_per_class(self): """Test converting to Qobj and its subclass representations given a dictionary.""" test_parameters = { diff --git a/test/python/test_schemas.py b/test/python/test_schemas.py deleted file mode 100644 index 31b37c99368c..000000000000 --- a/test/python/test_schemas.py +++ /dev/null @@ -1,126 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2017, 2018. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -"""Schemas test.""" - -import json -import os - -from qiskit.validation.jsonschema.schema_validation import ( - validate_json_against_schema, - _get_validator, -) -from qiskit.providers.models import ( - QasmBackendConfiguration, - PulseBackendConfiguration, - BackendProperties, - BackendStatus, - JobStatus, - PulseDefaults, -) -import qiskit -from qiskit.result import Result -from qiskit.test import QiskitTestCase - -SCHEMAS_PATH = os.path.join(os.path.dirname(os.path.abspath(qiskit.__file__)), "schemas") - - -class TestSchemaExamples(QiskitTestCase): - """ - Tests schema validation - """ - - _json_examples_per_schema = { - "qasm_backend_configuration": ( - "backend_configuration", - [ - "backend_configuration_openqasm_example.json", - "backend_configuration_openqasm_simulator_example.json", - ], - ), - "pulse_backend_configuration": ( - "backend_configuration", - ["backend_configuration_openpulse_example.json"], - ), - "backend_properties": ["backend_properties_example.json"], - "backend_status": ["backend_status_example.json"], - "default_pulse_configuration": ["default_pulse_configuration_example.json"], - "job_status": ["job_status_example.json"], - "qobj": [ - "qobj_openpulse_example.json", - "qobj_openqasm_example.json", - "qasm_w_pulse_gates.json", - ], - "result": [ - "result_openqasm_example.json", - "result_openpulse_level_0_example.json", - "result_openpulse_level_1_example.json", - "result_statevector_simulator_example.json", - "result_unitary_simulator_example.json", - ], - } - - def setUp(self): - super().setUp() - self.examples_base_path = os.path.join(SCHEMAS_PATH, "examples") - - def test_examples_are_valid(self): - """Validate example json files against respective schemas""" - schemas = TestSchemaExamples._json_examples_per_schema - for test_name, examples in schemas.items(): - if isinstance(examples, tuple): - schema_name = examples[0] - examples = examples[1] - else: - schema_name = test_name - - with self.subTest(schema_test=test_name): - for example_schema in examples: - with self.subTest(example=example_schema): - with open( - os.path.join(self.examples_base_path, example_schema) - ) as example_file: - example = json.load(example_file) - msg = ( - "JSON failed validation of {}." - "Set Qiskit log level to DEBUG" - "for further information." - "".format(test_name) - ) - - validate_json_against_schema(example, schema_name, msg) - - # Check for validating examples using the qiskit models. - obj_map = { - "result": Result, - "qasm_backend_configuration": QasmBackendConfiguration, - "pulse_backend_configuration": PulseBackendConfiguration, - "backend_properties": BackendProperties, - "backend_status": BackendStatus, - "job_status": JobStatus, - "default_pulse_configuration": PulseDefaults, - } - cls = obj_map.get(schema_name, None) - if cls and "openpulse" not in example_schema: - _ = cls.from_dict(example) - - def test_schemas_are_valid(self): - """Validate that schemas are valid jsonschema""" - schemas = TestSchemaExamples._json_examples_per_schema - for test_name, examples in schemas.items(): - if isinstance(examples, tuple): - schema_name = examples[0] - examples = examples[1] - else: - schema_name = test_name - with self.subTest(schema_test=schema_name): - _get_validator(schema_name, check_schema=True) From e475e6e3d389b6a30814ff144e1ee6e4c4107d99 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 10 Jun 2021 15:58:31 -0400 Subject: [PATCH 2/2] Remove docs for validation module --- docs/apidocs/terra.rst | 1 - docs/apidocs/validation.rst | 6 ------ 2 files changed, 7 deletions(-) delete mode 100644 docs/apidocs/validation.rst diff --git a/docs/apidocs/terra.rst b/docs/apidocs/terra.rst index 65ddd20199ac..0d9e209869ca 100644 --- a/docs/apidocs/terra.rst +++ b/docs/apidocs/terra.rst @@ -32,7 +32,6 @@ Qiskit Terra API Reference transpiler_passes transpiler_preset utils - validation visualization opflow algorithms diff --git a/docs/apidocs/validation.rst b/docs/apidocs/validation.rst deleted file mode 100644 index cf0f3035c5a3..000000000000 --- a/docs/apidocs/validation.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. _qiskit-validation: - -.. automodule:: qiskit.validation - :no-members: - :no-inherited-members: - :no-special-members: