Conversation
…ks/rir-debug-metadata
…ks/circuit-ascii-groups
…ks/circuit-ux-classical-control
… into minestarks/rir-and-conditionals
…control' into minestarks/rir-and-conditionals
…nditionals-working
…d-conditionals-working
…d-conditionals-working
…nditionals-working
…tarks/rir-and-conditionals
…s/rir-and-conditionals
…d-conditionals-working
…tarks/rir-and-conditionals-working
… classical controls.
…s have the zoom buttons
| // Don't render classical wires for a group that is expanded - the wires | ||
| // will be coming out of the measurement operations *inside* the group. | ||
| continue; | ||
| const expanded = gate.dataAttributes?.["expanded"] === "true"; |
There was a problem hiding this comment.
IIRC, when we get here, expanded is already supposed to be true so this is an unnecessary check. Not sure yet if your changes have changed this assumption.
There was a problem hiding this comment.
Yah it used to be the case that GateType.Group meants specifically an "expanded" group, but this is changed. GateType.Group is now any gate with children, and the dataAttribute determines if it is expanded or not. This is because collapsed groups need to be rendered with the expand/collapse button and possibly classical control circles.
|
|
||
| const isCollapsedGroup = | ||
| renderData.type === GateType.Group && | ||
| renderData.dataAttributes?.["expanded"] !== "true"; |
There was a problem hiding this comment.
Can we get here? I thought GateType.Group implied expanded === "true" (again, I concluded this was the case before your changes, but you may have changed something, not sure yet)
There was a problem hiding this comment.
My understanding was that if the group is collapsed, it just shows up as Gate.Unitary
There was a problem hiding this comment.
This had to be changed, partly because we now have "collapsed" groups that have classical control circles, which are specific to groups, and partly because we dropped the data attribute "zoom" which used to tell us if a gate should have the expand/collapse button. Now it is just that GateType.Group gates have the expand/collapse button and optionally classical control circles.
Some internal cleaning of the circuit visualization code:
This has the additional effect of allowing classically controlled groups to be expandable/collapsible, which makes for a more conceptually consistent pattern for users.