quantastica / quantum-circuit

Quantum Circuit Simulator implemented in JavaScript
MIT License
247 stars 49 forks source link

Repository of Examples to Illustrate Quantum Programming Concepts #45

Closed simplygreatwork closed 2 months ago

simplygreatwork commented 4 years ago

I've been on a mission lately to create lots of quantum computing examples in JavaScript. I had been using dabbling with qcsimulator, qics, and jsqubits but I finally settled on embedding a pared down version of quantum circuit.

I'm working with the O'Reilly book "Programming Quantum Computers", QASM examples, and anything I can comprehend online. These are some examples I've created so far which have not been reviewed. I did see this recent bug report and I'll need to review whether or not I have hacked around this bug or not. I may eventually re-integrate with the full Quantum Circuit library but this is just what I have so far.

The examples are in my Github repository.

perak commented 4 years ago

@simplygreatwork wow!

Let’s talk privatelly, can you send me a email to one of addresses which you will find at https://quantastica.com ?

perak commented 4 years ago

By the way, following gate matrices were changed this week: rz, crz, r2, r4, r8. If your code uses any of these gates then it will return different results with version >= 0.9.154

I believe that gate matrices will not change anymore.

If you are using some of changed gates, quick fix is to replace rz(theta) with u1(lambda) and crz(theta) with cu1(lambda). I believe that you didn't use r2, r4, r8, gates, but if you did, you can quickly replace them with u1(pi/2), pi/4 and pi/8 respectively.