Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend.validate(qobj) #1057

Closed
jaygambetta opened this issue Oct 9, 2018 · 11 comments
Closed

backend.validate(qobj) #1057

jaygambetta opened this issue Oct 9, 2018 · 11 comments
Assignees

Comments

@jaygambetta
Copy link
Member

jaygambetta commented Oct 9, 2018

I would like to have a command to check that a qobj can be run on a backend.

I want to be able to go

val_test = backend.validate(qobj) 

and what this does is sends this to the backend and the backend does some simple checks.

  1. All the instructions are in its gate set or allowed by the connectivity
  2. is the number of circuits small enough
  3. the depth is not too long

I am not sure about the return type I would personally like this to be a token and then

backend.run(val_test) 

would run the same way as a qobj.

This is requested by many now and is a lot of the questions we get so I would like to have some solution for this.

@jaygambetta
Copy link
Member Author

@nonhermitian can you add to this the requests you have received about this as well.

@diego-plan9
Copy link
Member

For Aer, most (if not all) of the simulators do have a private backend._validate() method which we can "promote" to a first-class citizen indeed.

I'm more curious about the remotes, which are arguably the ones where this validation provides real value. Does it basically imply that we need help from the API (ie. a new endpoint) in order to perform those simple checks, to avoid hard-coding values and make it easier to adjust to changes in the limits of the devices, or are you thinking of something that can be done fully locally?

@jaygambetta
Copy link
Member Author

I think this needs to call the remote.

@ewinston
Copy link
Contributor

ewinston commented Oct 9, 2018

It looks like the information needed could be retrieved when the provider identifies backends. Could it be conveyed between configuration and properties?

@jaygambetta
Copy link
Member Author

I don't think so I would like to run a small calculation before we add it to queue to see that it would run.

@delapuente
Copy link
Contributor

This is tracked in #871: an outgoing Qobject must pass two schema validations (that can be generalized to two general validations).

Anyway, @jaygambetta, I would want to understand what are the advantages of providing this "try and send" workflow instead of the simpler: backend.run(circuit)?

@jaygambetta
Copy link
Member Author

jaygambetta commented Oct 9, 2018

this is not a schema validation. It is a resource calculation on the qobj that depends on the backend. Ie if i'm hardware that only support 1000 gates it will say the qobj will not run.

For the Clifford simulator, it would check all that gates are Cliffords.

There are things we can do that don't waste the time off being in the queue that will let you know the job will fail or not be useful. currently, we let it run and it errors and then we return an error.

@ajavadia
Copy link
Member

ajavadia commented Oct 10, 2018

Other examples of backend.validate() (i.e. things that cannot be checked with schema):

  • For some devices and simulators, check all measurements are at the end.
  • Check local hardware spec and give a warning if it cannot handle an Aer simulation (too many qubits, circuit too deep).
  • For hardware that supports feedback, some estimate of the feedback time can be included (on top of just depth). This can be contrasted with the T1 to ensure sanity.

@delapuente
Copy link
Contributor

Pinging @pacomf @jelcaf @francabrera to make them aware of this proposal.

@pacomf
Copy link
Member

pacomf commented Oct 11, 2018

Yes, I think that we need a microservice in the cloud to check these things of the qobj

@jaygambetta
Copy link
Member Author

closing with #4105

doichanj pushed a commit to doichanj/qiskit-aer that referenced this issue Oct 26, 2023
IBM Quantum has rewritten the code of conduct to put in place a stronger
enforcement process and tighten up the language. This commit updates the
contents of CODE_OF_CONDUCT.md with this new version.

Related to Qiskit/qiskit#1057
unhkd-dee pushed a commit to unhkd-dee/qiskit-tutorials that referenced this issue Dec 26, 2024
The tutorials repo was previously missing a code of conduct file for the
repository. Since IBM Quantum has rewritten the code of conduct to put in
place a stronger enforcement process and tighten up the language and the
other qiskit repos were going through and updating the contents of their
CODE_OF_CONDUCT.md. This commit takes the opportunity to add the missing
CODE_OF_CONDUCT.md with this new version.

Related to Qiskit/qiskit#1057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants