PastaQ.jl icon indicating copy to clipboard operation
PastaQ.jl copied to clipboard

Hoe make plot circuit like qiskit have it?

Open Penghmed opened this issue 2 years ago • 2 comments

Penghmed avatar Oct 18 '22 08:10 Penghmed

Is having answer? Thanks you

Penghmed avatar Oct 19 '22 08:10 Penghmed

Unfortunately we don't have native support for that right now. There are two possible workarounds. You can ITensor's general tensor network visualization packages, and turn the quantum circuit into a tensor network. For example: https://github.com/ITensor/ITensors.jl/blob/main/ITensorGLMakie/examples/ex_quantum_circuit.jl

This can use a variety of backends for choosing the layout of the network, some of which will look more like a traditional quantum circuit visualization than others.

Another option would be to try using YaoPastaQ.jl (https://github.com/QuantumBFS/YaoPastaQ.jl) to convert the circuit to the Yao format, and then visualize the circuit with YaoPlots.jl (https://github.com/QuantumBFS/YaoPlots.jl). I haven't tried that so I'm curious how well it would work.

A third option would be to convert that PastaQ.jl circuit format to Qiskit's circuit format, and then visualize using Qiskit (say by calling Qiskit using PyCall.jl or PythonCall.jl). I don't think we have native support for converting from PastaQ.jl's circuit format to Qiskit's circuit format right now, maybe @GTorlai has something lying around for that but I presume it wouldn't be too hard to write.

mtfishman avatar Oct 19 '22 12:10 mtfishman