quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.28k stars 1.02k forks source link

Overhaul diagram drawing #1245

Open bryano opened 5 years ago

Strilanc commented 5 years ago

Here are some features that I would like diagram drawing to support:

bryano commented 5 years ago

Is anyone working on "image diagrams"? In a sense, that's what the latex diagrams are. It would be great to have an alternative, because Xy-pic (on which qcircuit is based) can be tricky to get to do what you want it to.

I'm skeptical of the utility of 3D diagrams. They're great to put on a poster or magazine cover, but it's hard to see them being informative for more than a handful of gates. I think it would be better to have a (maybe interactive) 2D diagram that shows the operations in a particular time slice.

Strilanc commented 5 years ago

No, no one is working on the image diagrams or 3d diagrams at the moment.

3d diagrams may be useful for tasks such as finding efficient cuts when optimizing tensor contraction order. They would definitely need to be interactive, with the ability to move the camera.

bryano commented 5 years ago

One first step along these lines would be separating the "text" and "diagram" parts of TextDiagramDrawer. For example, the padding attributes thereof seem specific to text diagrams (at least in they way they're being used now). I think this would more cleanly separate the semantics of the diagram from the rendering. This would involve classes such as the following:

dabacon commented 4 years ago

There are a couple parts of this issue that are actionable (qubit labels), and there has been a move to separate out block diagram from text diagram. We can either make this issue track those, or close this an open, but I'm not sure this issue is well defined enough as is.