-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Scheduling stage doesn't use custom dt when target provided #11994
Comments
For most options, this is currently the expected behaviour: the (Fwiw, we should also make implicit ignoring of settings a user-facing warning for certain.) |
The usual argument for why the target supersedes the |
@jakelishman Yes, we could easily make a copy of the target and change the |
From an API perspective, I don't really like our current situation of many arguments to The "option takes precedence" stuff is from the I'm not super certain one way or the other - I don't particularly love either situation, tbh. I think the transpiler interface should feel consistent, though, is I guess my overriding concern. Maybe us more aggressively warning on options that are being ignored will be enough to make it feel consistent if |
I see your point, I think that I will try to gather more context to raise the issue internally with the team, as long as the behavior is intentional and documented I think that there is no single answer. In the meantime, I have pushed 69ca591 to #11996 (which is the PR that led me to this issue in the first place) to encode these options in the converted target so that the behavior of transpile is maintained for both |
Sorry, I'm not trying to be super difficult here, I'm mostly just trying to see what we can do to sort out our current interface problem. It could well be that the way you were already going is the right way, if we can clarify the story around why the rest of the options don't override |
Yes, I get it, and I just want to understand all the angles (beyond what is needed for #11996), so no worries at all. I think there's also the perspective of ergonomics, especially with |
Yes, this issue was fixed in #12042. |
Environment
What is happening?
The expected behavior of
transpile
when a customdt
is specified (i.e. sth liketranspile(qc, backend=b, scheduling_method="asap", dt=dt / 2)
is that the scheduling stage will use this customdt
instead of the backend's one, but this behavior is not respected if the input backend contains atarget
. I believe that the root of the issue is thatdt
is encoded in theinst_durations
object that is passed around, but theTimeUnitConversion
transformation pass is designed to overwriteinst_durations
if a target is specified, so the custom dt never gets to be used:In other words, the priorities are not consistent between the preset passmanager/transpile and the
TimeUnitConversion
pass (one prioritizes the custom durations, the other prioritizes the target).How can we reproduce the issue?
This snippet works for the V1 backend and doesn't for the V2 backend:
What should happen?
The custom dt shouldn't be bypassed.
Any suggestions?
I think that this issue could be fixed if we establish a consistent priority of the custom
inst_durations
over the target's. A PR with a fix proposal will follow.The text was updated successfully, but these errors were encountered: