What is the Quantum Circuit Simulator?

In summary, Strilanc has been working on a quantum circuit simulator that can be used in-browser. It allows users to drag-and-drop gates and provides information about the resulting superposition or mixed state. Strilanc is looking for feedback and has made the source code available on github, as well as a live version for users to play with. The simulator works on Firefox and Chrome on both Ubuntu and Windows, and on Chrome on mobile devices. However, there may be errors on browsers or machines that Strilanc does not have access to. A user reported a TypeError on Safari, and Strilanc suspects it may be due to the machine not having a GPU with support for high precision floats. Strilanc has pushed an updated version
  • #1
Strilanc
Science Advisor
612
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
  • #2
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?
 
  • #3
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.
 
  • #4
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.
 
  • #5
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...)
 
  • #7
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).
 
  • #8
Thanks Strilanc, it looks pretty cool. If I encounter any other issues I'll report them via github.
 

1. What is a quantum circuit simulator?

A quantum circuit simulator is a computer program or tool that is used to simulate the behavior and operations of quantum circuits. It allows scientists and researchers to study the effects and outcomes of various quantum operations and algorithms without the need for physical quantum computers.

2. How does a quantum circuit simulator work?

A quantum circuit simulator works by using mathematical models and algorithms to simulate the behavior of quantum systems and circuits. It uses classical computing resources to simulate the quantum behavior, making it much faster and more accessible than using physical quantum computers.

3. What are the benefits of using a quantum circuit simulator?

Using a quantum circuit simulator allows scientists to study and test quantum algorithms and operations without the limitations and expenses of using physical quantum computers. It also offers a cost-effective and efficient way to explore the capabilities of quantum computing.

4. Can a quantum circuit simulator accurately represent real quantum systems?

Yes, a quantum circuit simulator can accurately represent real quantum systems and their behavior. However, it is limited by the precision and complexity of the mathematical models and algorithms used in the simulation.

5. How is a quantum circuit simulator different from a classical circuit simulator?

A quantum circuit simulator differs from a classical circuit simulator in that it uses quantum mechanics principles and algorithms to simulate the behavior of quantum systems, while a classical circuit simulator only models classical systems. Additionally, quantum circuit simulators are much more complex and require more computational resources compared to classical circuit simulators.

Back
Top