-
Notifications
You must be signed in to change notification settings - Fork 50
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
BloqInstance.i
index should not be an arbitrary index and should preserve insertion ordering
#1098
Comments
BloqInstance.i
index should not be an arbitrary index and have some meaningBloqInstance.i
index should not be an arbitrary index and should preserve insertion ordering
As noted, that's to support drawing circuits where you can flatten only parts of it while keeping the identity of the unmodified parts the same |
Do the drawings specifically depend upon the value of |
It's used in the prototype interactive drawing |
One way to satisfy both the requirements would be to make |
I think there are ways to preserve the insertion index. An easy one would be to have the |
I think it would be nice if
BloqInstance.i
has some semantic meaning in the context of aCompositeBloq
. Some possible options are:CompositeBloq
DAG (ordered based on (topological, insertion) order)CompositeBloq
It seems like these properties break down because of
Qualtran/qualtran/_infra/composite_bloq.py
Lines 346 to 352 in 79a880b
Is there a particular reason we chose to preserve this property where
binst.i
of bloqs which are not flattened is preserved? @mpharriganI'm particularly interested to query the following property:
x
andy
in thebinst_graph
of a composite bloq, I want to know which of these two bloqs (or their parents therefore, if we have flattened a composite bloq) was inserted earlier by the user when constructing the composite bloq? i.e. I want a way to preserve insertion ordering of bloq instances and query this property efficiently given access to bloq instances and a composite bloq / binst_graphThis is useful for a PR I'm working on to provide a greedy topological sorting with a heuristic that aims to help minimize qubit allocations / deallocations and would be useful for qubit count costs (xref #1097) and translation of a composite bloq to a cirq circuit (xref comment by Anurudh #963 (comment))
The text was updated successfully, but these errors were encountered: