Strilanc / Quirk

A drag-and-drop quantum circuit simulator that runs in your browser. A toy for exploring and understanding small quantum circuits.
http://algassert.com/quirk
Apache License 2.0
933 stars 158 forks source link

UI customization #470

Open amirebrahimi opened 3 years ago

amirebrahimi commented 3 years ago

Hi @Strilanc. A few of us are working on a Quirk-related project as part of QOSF and we're needing to allow for some customization with regards to the UI. Specifically, it is being able to turn off/on whole Toolboxes (e.g. Toolbox_2), individual columns in the toolbox (e.g. Spinning), and displays on individual wires. Before embarking on this work I'd like to know two things:

  1. Are you open to the contribution?
  2. Can we agree on the approach (I can lay out further details in comments) prior to starting? Ideally, I'll want to match how you might do this yourself.

I'd much prefer working on this with the intention of contributing rather than maintaining a separate fork.

Strilanc commented 3 years ago
  1. Are you open to the contribution?

Yes, although I'll note that the toolboxes are one of the things I'm more sensitive about changing.

  1. [..] I'll want to match how you might do this yourself.

The toolbox entries are specified in AllGates.js https://github.com/Strilanc/Quirk/blob/2880208814ccea2bb8d1c52efe2a4c3825d9c30a/src/gates/AllGates.js#L273

Turning entries on and off would require some sort of menu, and also code changes to deal with things like the toolbox image being cached to avoid redrawing costs.

amirebrahimi commented 3 years ago

Coming back to this now that we're wrapping up our QOSF projects for cohort 2. I'll likely start on this soon. If I determined that it isn't needed any more by our project, then I'll close out this issue.

The main project is a circuit and pulse dashboard that I'll post URLs for since Quirk is used for the circuit dashboard, but I'm still in the process of preparing those repos. For now, I'll post this auxiliary project that is standalone for anyone who wants to use Quirk in Jupyter with a little more control than the standard HTML widget: https://github.com/adgt/pyQuirk

Strilanc commented 3 years ago

That's pretty neat to use it as a UI element in a notebook.

amirebrahimi commented 3 years ago

Here's the full project: https://github.com/adgt/qonduit