Skip to content

Commit

Permalink
Disable jsonschema validation by default (Qiskit#688)
Browse files Browse the repository at this point in the history
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.

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
  • Loading branch information
mtreinish and chriseclectic committed Apr 20, 2020
1 parent 16174eb commit d38af7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qiskit/providers/aer/backends/aerbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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``.

0 comments on commit d38af7f

Please sign in to comment.