fix: FENCE blocks qubits, not frames #144
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #143
This takes a simple approach, reusing the
PreviousNodes
mechanism already employed for frame dependencies:FENCE
instructions "use" a qubit, in that they hold exclusive use of that qubit while "executing"NONBLOCKING PULSE 0 "'ro_tx"
to play concurrently withNONBLOCKING CAPTURE 0 "ro_rx"
as is commonly done.This does add a couple redundant edges on the timing graph, such as between subsequent
FENCE
andFENCE 1
, but I think that price is worth paying for the simplicity of the approach. It's not incorrect, it's just overkill.I initially added a new variant,
ExecutionDependency::Qubit
, but considered that the effect of a Qubit dependency is itself in nature nothing more than aStableOrdering
, and so it was not worth the breaking change to distinguish between the two. So, this change as written is just a bugfix and not a breaking change.Note the effect of this change in the timing graph (this is the non-overlapping fences snapshot test in
graphviz_dot.rs
):Prior to this change, the
FENCE
s would have serialized these instructions, because of the presence of a0 1 "cz"
frame in the program (not shown). EachFENCE
would have "used" that frame and thus they would have been seen as blocking one another, in turn serializing thePULSE
s that they wrap.