From bc60af7a6ed93f2a4407b1d67a2380ae33f89e63 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 10 Apr 2020 13:32:43 -0400 Subject: [PATCH] Disable jsonschema validation by default Currently the aer backends are running jsonschema validation on the Qobj objects passed in via terra by default. This is unecessary overhead as terra is programatically creating these objects and they're extremely unlikely to be structurally invalid (which is all jsonschema will catch). Even, if it was this will be caught later when something goes to use it and the error message from that is more likely to be useful since the way the json schemas are constructed precludes useful error message. This commit changes the default value of this to be opt-in on the run() method to avoid this unecessary overhead. --- qiskit/providers/aer/backends/aerbackend.py | 2 +- .../notes/validation-opt-in-e43a002f160ddd11.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 qiskit/providers/aer/releasenotes/notes/validation-opt-in-e43a002f160ddd11.yaml diff --git a/qiskit/providers/aer/backends/aerbackend.py b/qiskit/providers/aer/backends/aerbackend.py index 44bfd68843..c641828397 100644 --- a/qiskit/providers/aer/backends/aerbackend.py +++ b/qiskit/providers/aer/backends/aerbackend.py @@ -83,7 +83,7 @@ def __init__(self, controller, configuration, provider=None): self._controller = controller # pylint: disable=arguments-differ - def run(self, qobj, backend_options=None, noise_model=None, validate=True): + def run(self, qobj, backend_options=None, noise_model=None, validate=False): """Run a qobj on the backend. Args: diff --git a/qiskit/providers/aer/releasenotes/notes/validation-opt-in-e43a002f160ddd11.yaml b/qiskit/providers/aer/releasenotes/notes/validation-opt-in-e43a002f160ddd11.yaml new file mode 100644 index 0000000000..1137a237b6 --- /dev/null +++ b/qiskit/providers/aer/releasenotes/notes/validation-opt-in-e43a002f160ddd11.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + For Aer's backend the jsonschema validation of input qobj objects from + terra is now opt-in instead of being enabled by default. If you want + to enable jsonschema validation of qobj set the ``validate`` kwarg on + the :meth:`qiskit.providers.aer.QasmSimualtor.run` method for the backend + object to ``True``.