quantastica / quantum-circuit

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

the problem on simulating of the BV algorithm #17

Closed xhzha closed 5 years ago

xhzha commented 5 years ago

Dear Sir, Today, I have tried the BV algorithm as discussed in P12 of arXiv:1804.03719v1. The result is quite strange, the probabilities are huge numbers larger than 1. The quantum circuit is as follows. I suppose that there are some problems in these related gates. Could you give a test on this circuit? OPENQASM 2.0; include "qelib1.inc"; qreg q[3]; creg c[2]; h q[0]; h q[1]; x q[2]; h q[0]; x q[1]; h q[2]; u2 (0, -1.5708) q[2]; cx q[2], q[0]; u3 (0.785398, 0, 0) q[2]; cx q[2], q[0]; u2 (0.785398, -3.14159) q[0]; u3 (2.35619, 3.14159, 0) q[2]; cx q[1], q[0]; h q[0]; cx q[2], q[0]; u3 (0.785398, 0, 0) q[2]; cx q[2], q[0]; u2 (-0.785398, 3.14159) q[0]; u3 (2.35619, -3.14159, 0) q[2]; cx q[1], q[0]; h q[0]; h q[1]; cx q[2], q[1]; u3 (0.785398, 0, 0) q[2]; cx q[2], q[1]; u2 (-0.785398, 0) q[1]; u3 (0.785398, -3.14159, 0) q[2]; cx q[2], q[0]; u3 (0.785398, 0, 0) q[2]; cx q[2], q[0]; u2 (0.785398, -3.14159) q[0]; u3 (2.35619, 3.14159, 0) q[2]; cx q[1], q[0]; h q[0]; cx q[2], q[0]; u3 (0.785398, 0, 0) q[2]; cx q[2], q[0]; u2 (-0.785398, -3.14159) q[0]; u3 (2.53619, -3.14159, 0) q[2]; cx q[1], q[0]; h q[0]; h q[1]; cx q[2], q[1]; u3 (0.785398, 0, 0) q[2]; cx q[2], q[1]; u2 (0.785398, -3.14159) q[1]; u3 (2.35619, -1.5708, 0) q[2]; h q[1]; measure q[0] -> c[0]; measure q[1] -> c[1];

perak commented 5 years ago

@xhzha thanks for reporting. I will check later when I reach my computer. Until then to be sure: are you using Quantum Programming Studio UI https://quantum-circuit.com or you are directly using quantum-circuit npm package in node.js? Asking this because yesterday we fixed issues with u2 and u3 gates. If you are using quantum-circuit npm module, please update it to latest version.

xhzha commented 5 years ago

Hi, @perak, I just simulate the circuit on the website of https://quantum-circuit.com. thanks!

perak commented 5 years ago

Hi @xhzha ... I just tried it and looks good to me:

Screen Shot 2019-05-24 at 11 06 25 AM

What is desired output?

If you have different results, then please provide me with: what operating system and browser (with version) are you using.

Thanks!

xhzha commented 5 years ago

Hi, &perak, thank you very much! It's really the brower problem. Inspired by your answer, I have tried the IE brower, the result is OK, just like yours. Previously, I used the 360 browser. The result is quite strange. image

perak commented 5 years ago

@xhzha thank you for reporting the issue.

I will close this one, and open new issue for browser incompatibility.

👍