-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
Great!I hope this gets simplified in the future!Thank you taking the time @GiggleLiu 😄 |
Yeah, but we need a proposal about how to make it simpler. I do not want to insert a name field to the ChainBlock. If you have any interesting idea, feel free to open an issue. |
Can you explain why we need an extra block node? It seems to me a method like nameof is sufficient for determining the name of a block. |
@Roger-luo Sounds great to me!🙂 |
But the name is not static. |
I think there at least should be a default fallback name for primitive gates, or why c1 = chain(5, [ContinuousBlockMarker(put(5, (2,3)=>SWAP), "my custom name for SWAP"),
ContinuousBlockMarker(put(5, 2=>I2), "explicit id"), put(5, 2=>X),
control(5, (5,3), put(3, (1,3)=>SWAP))]) where the X gate will be using a default name on the other hand, what does the word |
I2 is not shown because we use ContinuousBlockMarker(put(5, (2,3)=>SWAP)) We should use put(5, (2,3)=>put(5, (2,3)=>LabeledBlock(SWAP, "SWAP")) |
Whats the problem with,
|
Also, if you could shorten it or make a "lazy" version of LabeledBlock This looks perfect! |
It can not handle the following gate ContinuousBlockMarker(chain(5, put(5, 2=>X), put(5, 3=>X)), "XX") Instead, one has to change the circuit to chain(5, put(5, (2, 3)=>label(kron(X, X), "XX"))) It is not a big issue, the later looks more intuitive. |
What about
|
Just one more thing! |
@Roger-luo good now? |
LGTM |
We can also use ishermitian to detect whether the content in a labeled block is hermitian, so that we can save a dagger in this case (because the SWAP gate is hermitian). Which is better? |
Great!Sounds good to me! |
Thank you too for providing practical using cases to guide the design of visualization. @Roger-luo , I think this PR is ready to merge. |
I think we should just follow whatever user is written - we shouldn't perform optimization at this level. |
On the other side, if you try to visualize the following gate, you will get an error.