qiskit-community / qiskit-js

:atom_symbol: Qiskit (Quantum Information Science Kit) for JavaScript
115 stars 30 forks source link

Quantum State Visualization (with ECharts & ECharts-GL) #17

Open indisoluble opened 6 years ago

indisoluble commented 6 years ago

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 :)

jesusprubio commented 6 years ago

Hi, thanks for the idea. We use this project to experiment for now, so feel free to open a PR with any feature you want. Some steps to start:

:D

indisoluble commented 6 years ago

Oh, I will keep this in mind but JS and the ecosystem around it are not my strong suit, so it might take me a while :)

jesusprubio commented 6 years ago

I'll keep the issue opened just in case I could find time to take a look in deep to the JS stuff of that repo. I think that stuff is interesting. Thank you :)