quantastica / quantum-circuit

Quantum Circuit Simulator implemented in JavaScript
MIT License
243 stars 47 forks source link

Adding classical control #1

Closed willzeng closed 5 years ago

willzeng commented 5 years ago

Any chance of adding classical control to circuits in the editor? This is often a great way of comparing QASM and Quil and takes some of the most effort to convert.

perak commented 5 years ago

@willzeng it is coming soon:

currently you can add only condition (QASM’s “if” translates to QUIL’s “jump”).

Other control constructs will be added soon - QUIL parser is next thing to be added to “quantum-circuit”.

perak commented 5 years ago

Later today I will publish video with instructions how to add classical control (condition) to circuit in GUI.

By the way, I found a bug related to exporting conditions to pyQuil and QUIL, will fix that later today and deploy fixed version of the GUI.

perak commented 5 years ago

@willzeng

OK, I fixed some bugs and published latest "quantum-circuit" npm module and latest "Quantum Programming Studio".

P.S. in the video you can see that I am simulating using Rigetti QCS (running on QVM inside QMI), but that feature is not available yet (qps-client which connects QMI to "Quantum Programming Studio") is not published yet.

willzeng commented 5 years ago

That's great! I was able to finish the teleportation example: https://quantum-circuit.com/app_details/about/YpHEBY4QEJyB5G5i5

perak commented 5 years ago

@willzeng OK, but it doesn't work correctly due to bug: https://github.com/perak/quantum-circuit/issues/5

currently, it teleports only "binary" values - qubit 2 will have resulting value of 0 or 1 whatever is "message" on qubit 0.

Bug is fixed now but not deployed yet. I will deploy in 1-2 hours.

perak commented 5 years ago

@willzeng fixed and deployed - works perfectly. I will close this issue now.