-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
qiskit.execute() does not use the scheduling_method argument #7640
Comments
+1, I've also encountered this error. |
Actually the following works for me with Qiskit Terra version 0.19.2
I tried a bunch of combinations and this was the only one that worked. |
So this behavior is actually by design. The I don't think this behavior of |
@mtreinish How about raising an error for calls to |
The problem there is we pass through all kwargs as run options to |
In this case, @yaelbh: it's a bit tricky to handle this, because |
According to @mtreinish and @jakelishman's explanations, I'd expect the backend to warn about an unknown run option. |
Ah I missed that, but it's bit weird because of the overloaded terminology. the |
In my example I attempted this method and got the same error. The transpiler outputs a circuit with (presumably) the correct extra delay to realign measurement but running that circuit leads to the same problem. I'm not sure why this is the case because it seems like the misalignment problem should be solved by pre-transpiling. |
When you manually transpile something, are you then passing it to @yaelbh: that's a fair point. At the moment, it looks like there should be a notice emitted by |
@jakelishman that makes a good deal of sense, thanks. |
This commit updates the documentation of the execute() function to clarify its purpose and intent. The execute() function is provided as a higher level abstraction and convenience function for use cases where you just want to execute a circuit and not worry about how it gets compiled for a particular backend. The set of options the function is minimal by design because it should just be about running circuits with no options needed and if you need to exert more control over the compilation you should use transpile() and backend.run() together instead. As part of this a large number of legacy kwargs defined on the function are deprecated as they are mostly holdovers from before the purpose of the function was clear and really are just needless duplication of transpile(), schedule(), and assemble() (even though this isn't used anymore after Qiskit#7886). Closes Qiskit#7640
Closing because:
|
Environment
What is happening?
I'm attempting to queue circuits to run on the devices that involve delays before the measurements. If I send a circuit with a delay then I may receive the error message:
TranspilerError: "This circuit None may involve a delay instruction violating the pulse controller alignment. To adjust instructions to right timing, you should call one of scheduling passes first. This is usually done by calling transpiler with scheduling_method='alap'."
If I try running
qiskit.execute
with the argumentscheduling_method='alap'
as suggested then I receive the same error. Furthermore if I try to pre-transpile the circuit withqiskit.transpile
with the same scheduling method argument and try to execute the transpiled circuit I get the same error.How can we reproduce the issue?
IN
OUT
IN
OUT
IN
OUT
IN
OUT
IN
OUT
IN
OUT
What should happen?
I expect the
execute
functions to finish running in a few seconds and for the job to be queued up to run on the device.Any suggestions?
I noticed in the traceback that when the execute function transpiles a circuit to run on the device it doesn't seem to use the
scheduling_method
argument, see lines 292-303 ofqiskit/execute_function.py
in my installationI tried making this edit to my local installation
and the code in the MWE above ran without errors, with my jobs getting queued and running with the expected results.
I'm hesitant to make a pull request with this change in case this causes problems elsewhere but it definitely solves my problem.
The text was updated successfully, but these errors were encountered: