qiskit-js icon indicating copy to clipboard operation
qiskit-js copied to clipboard

Quantum State Visualization (with ECharts & ECharts-GL)

Open indisoluble opened this issue 6 years ago • 3 comments

I am not sure if proving quantum state visualization is already in the roadmap but, one way or another, I think it might be worthy to comment here how I added this functionality to qiskit-sdk-swift.

On the contrary to the python repo where the visualization is based on matplotlib, there were nothing equivalent for Swift (that was also available on macOS, iOS & Linux); so I ended up using the following JavaScript libraries to display the graphs embedded in web views:

These libraries provided (out of the box) all I needed to plot the quantum states, also without any other dependency. They are under Apache license and behind them is a big company: Baidu, so I think we can assume they will be maintained for a while.

I hope the javascript code I wrote might serve as an example.

What is the expected behavior?

The code I mention above is located in:

Swift & JavaScript code are mixed in the same files but I think it is quite readable.

To end, any suggestion about how to improve the existing javascript code is welcome, in fact it would be very appreciated :)

indisoluble avatar Jun 20 '18 22:06 indisoluble