zxlive icon indicating copy to clipboard operation
zxlive copied to clipboard

Easy way to add parts of quantum circuits

Open jvdwetering opened this issue 1 year ago • 1 comments

I think we should have an easy way to import a quantum circuit into ZXLive. For instance, right now if I want to make a cnot I have to laboriously add a z node, an x node, and then connect them, and also connect them to neighbours. Some possible suggestions for what we can do to make it easier:

  • Have a text window where you can type some simple qasm-like code to add it to your diagram. Maybe something like, press ctrl+Q, and you get a pop up. You then type CNOT 1 2; CNOT 2 3; and press enter and it adds the appropriate ZX diagram to your current working diagram.
  • In addition to the generators you can add in the side bar, have a collection of 'widgets' or 'patterns' that you can drag and drop onto your working window.
  • Something that might also help: right now if I want to add an identity spider I would have to disconnect two spiders, add an identity in the middle, and then reconnect this identity to both original spiders. In proof mode we can use magic wand to do the work for us, so maybe we could also allow that in Edit mode. Alternatively we could have a 'snap to edge' option where if you are adding generators, it automatically replaces the connectivity if you place it on top or very close to an existing edge.

jvdwetering avatar Nov 10 '23 13:11 jvdwetering

There is now qasm circuit input text window but it would more useful to have the widgets/patterns in the sidebar. A user can have a folder called 'widgets' and zxlive can automatically load a list of graphs from there in the sidebar.

RazinShaikh avatar Nov 15 '23 11:11 RazinShaikh

I am closing this because the suggestions in this issue have either been implemented or split into their own issues in #296, #311, or #318

RazinShaikh avatar Jul 10 '24 19:07 RazinShaikh