rmlarose / nisqai-dev

Development repository for NISQAI.
Apache License 2.0
15 stars 4 forks source link

Write a circuit/network drawer. #3

Open rmlarose opened 5 years ago

rmlarose commented 5 years ago

Thinking of something similar to printing a circuit in Cirq. This would be extremely useful for visualizing both circuits and the network.

Should take in an object that contains a pyquil Program and return a string corresponding to a visual representation of said program (for the circuit drawer).

For the network drawer, we may want to have "blackbox drawings" like

----[Encode]----[Transform]----[Measure]----[Relu]----[Encode]----...

or something similar.

naezzell commented 5 years ago

Though we do plan to meet tomorrow, I'm commenting this here for records sake.

At what level of sophistication should we consider the circuit drawer done? As it is written it is not extremely modular, so adding 'blackbox drawings' is not easily achieved unless we changed the way pyquil program.out() formats strings.

Alternatively, we could just ensure that each step 'blackbox step' draws its own circuit, append them all together in the end, and draw our own black boxes as desired/ mark them somehow as we append them.

rmlarose commented 5 years ago

The "blackbox drawings" can be handled in Network and related Network classes, most likely. This issue was mainly for drawing each gate in a program.

Can the drawer now handle DECLARE and other statements in the program (e.g., PRAGMAs?) If so, we can close this issue.

naezzell commented 5 years ago

It's been a while since I took a look at this (clear by the dates I'm sure), but is the Circuit Drawer since it was last implemented sufficient for your uses?

Are there any hang-ups/ features that you would like to see?

rmlarose commented 5 years ago

Did we ever take care of the PRAGMA, DECLARE, etc. statements?

If so, it's likely a functional drawer, but still needs to be tested a lot more. If it's passing all tests, it's fine for now. In the future, it would be good to upgrade to more a more sophisticated drawer.