I What is the Quantum Circuit Simulator?

Click For Summary
A quantum circuit simulator has been developed that operates in-browser, allowing users to drag-and-drop gates and visualize resulting superpositions and mixed states. Feedback is being sought on its functionality, with the source code available on GitHub and a live version accessible online. Users have reported issues, particularly with Safari, where a TypeError occurs, prompting discussions about browser compatibility and GPU support. The developer acknowledged the problem and plans to enhance error messaging and testing across different machines. An updated version has been released to provide better information about issues encountered.
Strilanc
Science Advisor
Messages
612
Reaction score
229
I've been working on a quantum circuit simulator. It works in-browser; you drag-and-drop gates and it shows information about the resulting superposition / mixed state.

I'm looking for feedback about it. The source code is on github, but you can play with a live version at algorithmicassertions.com/quirk.[/PLAIN]

You can link to circuits. Here's a few:
 
Last edited by a moderator:
  • Like
Likes Greg Bernhardt, Mentz114, f95toli and 1 other person
Physics news on Phys.org
Hello Strilanc - I saw this posted somewhere else too, but since the live version is broken, I didn't look further. Are you aware of the TypeError?
 
Devin Bayer said:
Hello Strilanc - I saw this posted somewhere else too, but since the live version is broken, I didn't look further. Are you aware of the TypeError?

I'm not. Actually, part of the reason I posted was to find out about errors on browsers or machines I don't have.

The simulator does work on my desktop in Firefox and Chrome (on both Ubuntu and Windows). It also works on my phone in chrome, but there's a bug I reported in the mobile version of firefox that prevents it from working there. That bug doesn't cause a type error, though, it causes a FRAMEBUFFER_INCOMPLETE_ATTACHMENT error. (Also the touch interaction is wonky on mobile regardless.)

If you post a screenshot of the error, or copy-paste it from the console, and let me know what browser and OS you're using, that will be useful to me.
 
Sure, I am using Safari on OS X and this is all I see:
https://t-0.be/pub/Screen%20Shot%202016-04-05%20at%2010.42.09.png
If you decide not to support Safari, at least a message to that effect would be more helpful than an error.
 
Devin Bayer said:
Sure, I am using Safari on OS X and this is all I see:
https://t-0.be/pub/Screen%20Shot%202016-04-05%20at%2010.42.09.png
If you decide not to support Safari, at least a message to that effect would be more helpful than an error.

Hmmmm. I'm guessing your machine doesn't have a GPU with support for high precision floats. The code is supposed to fall back to lower precision in that case, so this is not intended. Looks like I forgot to check if getShaderPrecisionFormat flagged some errors before using its result. MDN's entry doesn't mention any errors, but MSDN's does.

Thanks, I'll fix it. (I'll need to find a test machine with an older GPU... and probably a lot more variation would be good in general. Maybe I should finally sign up for a testing service like SauceLabs...)
 
Devin Bayer said:
I have a NVIDIA GeForce GT 750M and I am not sure how I can determine it's support for that kind of shader, but this page seems to suggest it has it: https://devtalk.nvidia.com/default/topic/780628/cuda-on-15-quot-macbook-pro-disappointing-/

Also, according to apple it supports OpenGL 4.1, so that shouldn't be an issue: https://developer.apple.com/opengl/capabilities/

I pushed an updated version today. I don't expect it to have solved your problem, but it does give more information about the problem and even if it fails to use the GPU you should be able to edit the circuit (it's just that all the displays will show NaN).
 
Thanks Strilanc, it looks pretty cool. If I encounter any other issues I'll report them via github.