As I am curious since I am developing some quantum simulation on my own (https://github.com/stared/quantum-game - one photon, but spatial degrees of freedom and more physical interactions).
Side remark - for plotting states:
- did you consider using colors (see http://nbviewer.jupyter.org/github/qutip/qutip-notebooks/blo...)?
- is there some slider, so I can lookup state at any stage (not only the last one)?
I did consider it, but I never experimented with it. For a small number of qubits, I think oriented circles are much clearer. Then they get gradually worse as you move up towards 16 qubits. Once the amplitudes get close to pixel-sized, you're probably forced to use color if you want to show a decent 1-to-1 representation.
Some of the downsides:
- Color-blind unfriendly.
- Worse absolute accuracy at a glance. I can guess the absolute angle of a short line to within a couple degrees (~100 distinguishable buckets). For hues that's probably more like 20-30 buckets, though relative comparisons would still be ~100 buckets accurate. The angular velocity at a glance probably also suffers.
- Circular motion, where the center is not at 0 (e.g. watch the X^t gate), won't look quite so circular.
- I already use color to hint at meaning (green is densities/probabilities, blue is amplitudes, yellow is volatility).
> is there some slider, so I can lookup state at any stage (not only the last one)?
Drag an amplitude display (the green 'Amps' thing in the toolbox) onto the circuit. Put it where you want to see the state. Resize it to cover everything.
(At the moment the inline displays are limited to covering 8 qubits. I was worried about performance when they get large. It'll be fixed in the future.)
Edit: Gah, there's a bug where the amplitude display is showing 'NaN' unless all the covered qubits are not entirely Off. Not sure how that slipped in.
Edit #2: Oh, it's happening on my work machine but not on my home machine. So probably related to webgl being terrible.
In high school, whenever I felt that I suddenly couldn't follow some explanation on the whiteboard, that's when I knew the drawings were color coded. The fact that things were color coded was usually communicated implicitly. Often, this is done by drawing two sets of things in different colors, usually red and green, and then just pointing at one instance from each category while giving some explanation regarding that category. This is simple, possibly not even a conscious choice, and it works perfectly as long as the students have the slightest bit of logical reasoning skills... and can actually tell that there are multiple colors being used.
For measurement in between - the things that are there are interesting. But I was thinking about some mouseover - when you get full plot (intensity, phases), as something built-in. For not time-dependent circuits it would be cool to lookup step-by step.
In any case, this time-dependent operators is a thing beyond-expectations, so special thanks for that!
Quirk doesn't have menus.. you might be thinking of the recording of Davy's simulator? Those menus also look custom-made. I actually wouldn't call them "nice", because they lack important polish. Read this: http://bjk5.com/post/44698559168/breaking-down-amazons-mega-...
I'm sure there are libraries for menus and things like that, but I generally prefer to try to do it myself unless those libraries have a really good interface.
You're being polite... Those drop downs are hideous!
If you're more familiar with physics than programming, Leonard Susskind's 'Quantum Mechanics: The Theoretical Minimum' [2] might work better. But I agree with Scott Aaronson that learning about quantum information before learning about quantum physics is easier than the opposite direction [3]:
> There are two ways to teach quantum mechanics. The first way -- which for most physicists today is still the only way -- follows the historical order in which the ideas were discovered. [...]
> Today, in the quantum information age, the fact that all the physicists had to learn quantum this way seems increasingly humorous. For example, I've had experts in quantum field theory -- people who've spent years calculating path integrals of mind-boggling complexity -- ask me to explain the Bell inequality to them. That's like Andrew Wiles asking me to explain the Pythagorean Theorem. [...]
> The second way [...] starts directly from the conceptual core -- namely, a certain generalization of probability theory to allow minus signs.
1: https://www.youtube.com/playlist?list=PL1826E60FD05B44E4
2: http://www.amazon.com/Quantum-Mechanics-Theoretical-Leonard-...
I'm unconvinced that this is anything but Scott's personal opinion. Basically all teaching methodology advocates for concrete examples over abstract concepts. You can't get much more abstract than generalization of probability theory to allow minus signs.
It might work well for some people, and I'm happy it worked for you.
Frankly having taken both QC courses and QM courses, I found the physics-oriented exposition used a bunch of verbiage to phrase things in an experimental/physical way without really specializing the mathematical objects in any sense (eg, Stern-Gerlach experiments). That particular sort of concreteness can be helpful in other parts of physics, but physical intuition is weak to nonexistent in QM.
Anyway, I'm nowhere near a physicist so take my review with a grain of salt.
Which is not to say that I think you should do two years of linear algebra before understanding how the heck it applies to reality. That would also be insane. I guess I just think that the first concrete case should be a qubit simulator. Something grounded that you can come back to and say "Well, what if I did this?" and get the right answer.
I noticed that custom gates were on your "work in progress" list. Does that include being able to reuse a circuit as a gate in another circuit? That's a killer feature for me. Being able to "abstract away" things like the Grover diffuse operation. That, or even copy & paste functionality to speed up designing those repetitions.
(You can copy individual gate parts by holding shift as you grab them. I'm considering adding ctrl as a another modifier, meaning 'grab the whole column'. I understand that these modifiers are not discoverable.)
(At the moment, when I want to make a really large repetitive circuit, I copy the URL into a text editor and do my copy pasting there. I understand that it would be totally ridiculous to expect users to do that.)
Ideally, from my perspective as a user, I'd like some kind of selection box that I can drag over a portion of the circuit and duplicate everything highlighted.
PS: I like that you maintain the circuit in a URL linkable form. Very handy!
Examples include the X-axis post-selection gates "|+⟩⟨+|" and "|-⟩⟨-|", some square-wave gates "X^⌈t⌉" and "X^⌈t-¼⌉" that were made redundant by the counting gate, the impossible universal-not gate "__unstable__UniversalNot" [1], and the error injection gate "__error__".
My one criticism: there's something about the visual style of the interactive elements that makes them appear non-interactive until interacted with. The whole application initially looked like a static image to me before I started clicking around and fiddling with it.