Enable graphical visualizations for circuits
Describe the feature you'd like
Build functionality to visualize a Circuit object using matplotlib and/or LaTeX. The interface and functionality should be similar to the Qiskit function qiskit.visualization.circuit_drawer, although it does not have to support all of the customizations at first.
Braket already supports text-based visualizations of Circuit objects. Existing implementations are in src/braket/circuits/text_diagram_builders, which should provide a good starting point for seeing how to get the relevant information out of the Circuit object.
At a minimum, an implementation of this feature should support either matplotlib or LaTeX (both would be great!), and should support visualizing everything currently supported by the text-based circuit visualization.
How would this feature be used? Please describe. This would allow Braket circuit visualizations to be much more readable, for example, in Jupyter notebooks, or for use on websites or in academic papers.
Describe alternatives you've considered
The existing text-based visualization via print(circuit) works, but it is not very readable, and cannot be used as a graphical format for exporting a circuit.
Hey @rmshaffer,
Good to see this issue here, I went through the hacker guide on unitaryHack and want to work on this.
I have previously worked on circuit visualizers similar to Qiskit's using Matplotlib, Plotly as well as using latex(quantikz and otherwise).
Please let me know if this issue is open and if I can work on it.
Hi @skushagra, yes, this issue is open! Please feel free to start, and let us know if you have any questions.
Please let me know what is your preffered method of implementation. Latex or matplotlib?
I personally would choose LaTeX. But you're free to choose!
Hello @rmshaffer
Sorry for replying a little late. I saw the PR raised with respect to this last week and decided to let them continue with the issue. I'll be happy to help wherever required!
@skushagra thanks for checking in! @bryanhzaz, I know there's still a bit of work to do on your PR. If you think any help would be useful, please let us know!
@rmshaffer if it works, I keep sharing my ideas on the PR. I think it will be helpful! Here for any help required. I'll work on some other issues on the repo meanwhile!
Hi @rmshaffer,
The PR uses matplotlib to create the images. Please review at your convenience.