109 comments

[ 4.2 ms ] story [ 125 ms ] thread
I think you should try

http://physics.stackexchange.com/

I did. Well, I didn't ask the main QA site as questions about specific sites would be off-topic. I did ask chat (the H Bar) but didn't get much of a response. An hour on HN and my server log says several people have loaded the game and one made it to level 5, so we're doing better here already.
...3 hours in, 174 people have loaded the game and 5 made it to the final (16th) level. Still no completions though ;)

On the other hand, most of the comments have been about the Java rather than the physics. I suppose I should have expected that.

I read your blog and thought it was coherent (ha) and correct as far as I can tell with one course qm and one on quantum computing plus one other textbook as my background. Honestly one of the better descriptions of QM I've read though it's hard for me to judge how someone without any background would take to it.
It's a Java applet?
Alas yes! In hindsight not the best choice of tech so a Javascript rewrite might be on the cards.
Kotlin has a JS compilation mode, and IDEA has a java-to-kotlin converter.

Maybe that's a good place to start? Kotlin is a good language anyway.

Scala has both those things and is a better and more mature language.
It is a different language to be sure but why would you say it is better? Isn't there such a many ways to look at the strengths/weaknesses of a language that simply valuing one language over another does not make much sense? (In this context, I assume that both are good enough to be possible for this project).
More consistent design - a lot of things that are special cases in Kotlin are just the logical combination of two orthogonal features in Scala (or Ceylon). That and the huge power of higher-kinded types - there are some language features where it's arguable whether they're worth their weight, but higher-kinded types are one where it's really clear-cut (IMO) - once you're used to them, using a language without them is like using a language without generics.

For the sake of argument I'll accept that it's maybe difficult to compare two languages in general, but in terms of Kotlin/Scala they are extremely similar languages targeting extremely similar use cases.

We reviewed both and went with Kotlin. Scala is not the obvious choice here in my opinion.

Kotlin is a simpler language which is a huge benefit.

https://kotlinlang.org/docs/reference/comparison-to-scala.ht...

It's not a simpler language. It's a less powerful one but as a result it has a lot of ad-hoc special case features to cover subsets of functionality that Scala provides with a few powerful features applied consistently.

(If you want an actually simpler language, look at Ceylon)

I agree with lmm. The only thing where Kotlin wins is in marketing and hype.
Hey SideShow B, I responded in a different comment with my old page of QM simulations I made 12 yrs ago as Java applets : http://www.pha.jhu.edu/~javalab/

I'd be very interested in how you eventually decide to update your applet to be more web friendly for current browsers, as I'd like to do the same, but know very little of modern web design.

Right now only one of mine is on GitHub : Squankum, for showing operations of single-qubit operations on input qubits, both graphically and in eigenvector form : https://github.com/jeffwass/Squankum/blob/master/README.md

Please be sure to repost if you do get round to porting it.
I open sourced it, so porting might happen now.
Or how about just configure it to run using JNLP, instead of running in-browser as an applet?
And doesn't have any way to download it or anything. Java in browsers is officially a bad choice, people, as Chrome refuses to work with it.
Technically, Chrome refuses to work with NPAPI, which Java depends on. Unfortunately, Oracle did not deliver any alternative to run Java in some of the more secured browser-plugin architectures.
Well, Oracle has also deprecated java in the browser, so...
You could just as easily argue that "Chrome as a browser is a bad choice" for that reason.
or that NPAPI is really old, and that oracle is discontinuing their browser java plugin. Do you really think you can argue that Chrome is a bad choice cause it doesn't support something that is deprecated?
The thing about NPAPI is that it was at least a somewhat universally supported standard... and after dropping NPAPI, all Chrome offers is NaCL and PNaCL, which - AFAIK - nobody else supports. So you could argue that Chrome took a step backwards by dropping NPAPI before waiting to see if NaCL/PNaCL (or something else) would become the industry standard replacment for NPAPI.

I am, of course, just "playing devil's advocate" here a bit. NPAPI clearly had issues and I'm not enough of an expert to say if it would have been possible to simply improve it, or whether it was truly necessary to go to a whole new model. And you can certainly argue that the other browser vendors could adopt NaCL / PNaCL. I guess they have their reasons for not doing so.

It's sad really, because "Java on the Web" has a ton of value, but Sun screwed the pooch years ago with some of their decision making, leaving us where we are now. Oh well, at least there is JWS / JNLP. Hmm... come to think of it, I wonder if the OP could just rework their app to run as a JWS app, instead of as an applet? That might make everybody happy...

Is JWS/JNLP more secure? How so?
(comment deleted)
You have something interesting to say?
You may get more feedback if you upload the Java source to GitHub and make it easy to compile and run locally. I wasn't able to run the applet with the default settings in Safari, Chrome, nor Firefox and asking people to make their browsers less secure to test this is probably going to turn a lot of people off.
For example me. Sorry buddy but I'm not going to mess with my browser config (mostly out of laziness), I'm waiting for a downloadable version.
You can download it if you put quantum.jar at the end of the url, no? >.>
Agreed, this is SUPER disappointing. I started reading your blog post on the train this morning and was SO excited, because I've also been self-studying QM/QED lately, and your description so closely mirrored my experiences. So imagine my excitement when I saw that you'd made a game as a way of developing an intuition—a really fantastic idea, and one I had been thinking of myself! And yet I have effectively no way of even seeing it! Not even the code?!?! :((((
So its annoying enough for you to type a 300 word complaint, but not annoying enough to change your browser configuration? Only on hacker news I guess...
Well, on my end, it would involve installing another browser and changing it's config. Not doing that, thanks.
Well, the thing is, Java applets are against my religion.
Believe me, it's not as disappointing for you as it is for me. When I started this hobby project, Chrome supported Java and a sandboxed/signed applet would be trusted without needing any security warnings or change of configuration. :(
Do you intend to put the code on github? Because I'd love to help out porting it to javascript. Browser-native is the only way to go if you want any kind of engagement :)

Porting would also be a potentially helpful way for me to understand some of the concepts.

I may well do though at this stage I'm still considering it all experimental and not quite release ready. Thank you for the offer though and I'll let you know if I do. I know another interested chap so we have a little team already if I do go that way!
It worked fine for me in firefox (I had firefox 43.0.4 and java 1.8.0_60 on my machine). Just say "remind me later" to all the offers to update Java.
FWIW, the decompiled (w/ -deadcode) source from the applet, as retrieved from the server on June 2nd around 9 am CEST, does not contain any obvious mischief. Things of note are a very crude way of parsing the levels from XML (use something like JAXB, dude :D)(the xml is not part of the jar), an interesting sound synth based on the QuantumData, and the fact that self-written code calls color colour. It would be easy to migrate the applet to a standalone Swing application.
Ultimately of course I signed the applet with a cert from a trusted CA, so everyone has more proof of who I am than they do of who you are, but thanks for your efforts to convince people it's safe ;) Somehow I think I'd have gotten less flak if I made people download an executable to run it!

Yes, the whole thing is at experimental stage right now and as you may guess from the title of the post I'm more concerned with the physics than anything else. Thanks for the pointer to a better library - it's the first time I even parsed XML and was happy to stop with that class as soon as I got something that worked. Glad you spotted the generative sound.

I imagine it's disheartening to see so much distrust and I'm truly sorry for that, but you could've seen that coming when posting to HN of all places :D

As for the cert: it _could_ be stolen.

Least flak wouldv'e been a github repo. Most people wouldn't even bother check what's in it and if it matches a binary download, they'd just assume someone else would check ;)

I bet the XML parsing and the sound synth are exactly the two things you're least and most proud of? :D I honestly recommend taking a look at JAXB. You start from a schema description and generate java classes from it. Then you just stuff these classes and a conforming XML file into a JAXB Unmarshaller and get a clean instance tree of the file. Such a tree can then be poured back into a file by way of a Marshaller.

True about the cert, and also your HN account! But between them that would take two security breaches to pull off.

Alas there are a few things to not be proud of in the code, but I'm proud I got it working enough for hundreds of people to play. The synth ... meh ... I had higher hopes for that part, but it turned out to be a lot harder than I imagined, and it's honestly a bit of a hack that doesn't truly represent the wavefunction to my satisfaction. I had to prioritize making it bearable to listen to. Audio is hard (I've worked in that field as well).

I never did audio beyond simple midi beepboops in QBasic, so I wouldn't know. I always imagined it to be some kind of specialisation. Like you need a special mindset to be able to build a 3D engine, you'd need a certain set of talents to be able to manipulate sound in awesome ways and not get lost in tech minutiae.

Re: multiple account breaches: keybase.io aims to make that harder. Have you heard about that? (I know, I digress, sorry.)

Sorry, but I'm not running your Java applet.

Perhaps you could port your game to something like Processing.js? It allows for very Java-like syntax, compiles to html5/js and is good with graphics.

Unless you have a problem with running unknown compiled code, why not?

It's as easy as running '$ appletviewer URL'

Because having Java enabled for a browser is tremendously more risky than running a single application of unknown code.
As RobSis noted, you don't have to enable it in your browser, you can use appletviewer to run individual applets without the browser:

    $ appletviewer http://tropic.org.uk/~crispin/quantum/
And also, moderns browsers allow you to have the plugin installed, but disabled unless you activate it on a specific page.
Modern browsers... except Google Chrome, which has at least 40% market share.

Google Chrome does not support applets in any way since the deprecation of NPAPI.

I accidentally had appletviewer.exe it from the JDK, however the applet is served over http. I do appreciate this because I'd accidentally turned off HTTPS Everywhere and hadn't noticed (in weeks I suppose).

I think I'm not the target audience, I hope OP finds some good physicists to show this to :)

Wow, the blog post was really well-written, containing lots of interesting points for non-physicists interested in learning quantum mechanics, and the game seems fun. And on HN the author encounters a bunch of dreary know-it-alls going on about how they don't like java applets for some reason (apparently it upsets their anal notions of security in their little laptop world.) Just open it in firefox, it works fine.
Wow. I was about to write that I'm writing a simulation engine to try and understand quantum physics better. Then I saw the image on your post, and I now see that you are far ahead of me! :D
Crashes when run in IcedTea 1.6 in Firefox on Linux.

IcedTea-Web Plugin version: 1.6.2 6/1/16 7:49 AM Exception was: net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet. For more information click "more information button". at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:764) at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:686) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:933) Caused by: java.lang.ClassNotFoundException: quantum.GameWindow at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1562) at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:753) ... 2 more This is the list of exceptions that occurred launching your applet. Please note, those exceptions can originate from multiple applets. For a helpful bug report, be sure to run only one applet. 1) at 6/1/16 7:49 AM net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet. For more information click "more information button". at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:764) at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:686) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:933) Caused by: java.lang.ClassNotFoundException: quantum.GameWindow at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1562) at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:753) ... 2 more

Similar issue with Ubuntu 16.04, FF 46 & icedtea 1.6.2, I just get a gray screen, from /var/log/syslog:

  IcedTea-Web java error manual log:
  Application title was not found in manifest. Check with application vendor
  IcedTea-Web java error - for more info see itweb-settings debug options or console. See http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs for help.
Same exception with IcedTea 1.6 in Iceweasel on GNU/Linux.

Second edit: It's because I had OpenJDK 7 as the default JRE. It works fine when I switch it to OpenJDK 8.

Tip: stick 4 spaces before the stack trace to not munge newlines.

Edit: If I run it with appletviewer, I get a more helpful exception:

    $ appletviewer http://tropic.org.uk/~crispin/quantum/
    java.lang.UnsupportedClassVersionError: quantum/GameWindow : Unsupported major.minor version 52.0
            at java.lang.ClassLoader.defineClass1(Native Method)
    [snip]
This error means that you need at least JRE8 (Java 8) to run the applet. Or OP must compile the applet in a compatible bytecode format for older versions of Java (-target of javac).
Yup, I figured that out. Note that what we saw in the browser didn't indicate that; I had to use appletviewer to get a helpful error message.
For the game - I would be delighted to test it, but most likely this weekend or so. (Plus, Java sadly isn't the most user-friendly interface for browser-based things.)

For getting feedback from quantum information researchers, I recommend posting to https://www.facebook.com/groups/qinfo.scientists.unite/.

I see that you have similar taste/inspirations to mine (I am also a big fan of Test Tube Games (Velocity Raptor & Agent Higgs)). See also: https://hackpad.com/J0X4MSberlM?r=0 for more picks (and feel invited to add more).

For quantum games - in a week or so I plan to release my own - https://github.com/stared/quantum-game

Thanks. I'll check out the FB group you mention. Your game, or what we can currently see of it, reminds me of the (classical) "Reflections" laser game of a few years back which is a good thing! And I suspect the hackpad list will take me more than a weekend to play through :)
I've heard about Reflections but it was mostly inspired by Chromatron (http://silverspaceship.com/chromatron/), and a bit by The Incredible Machine.

With this list - don't try to play it all at once. Some of these are potent drugs - not only addictive, but mind-altering (e.g. Hyperrogue, when you walk on a hyperbolic plane).

Velocity Raptor's end game screen was worth the insanity and craziness of dealing with time dilation at c=3mph. If the speed of light ever slows like that IRL though, I'm refusing to get out of bed.

I'm also working on a game that at one point had a quantum mechanical theme, however it is more backstory than science. Quantum Traffic Control. Watch for it on the App Store sometime in this decade. Hopefully.

I have to confess I never completed velocity raptor - I got stuck on level thirty something! Then again only 3 of 621 people who loaded QMM today managed to finish...
Web Java is functionally dead outside of enterprises environments. Running untrusted Java in browser is a huge security risk.

If you'd upload your code to github that'd make reviewing it easier.

Yea, I'm not taking that risk.. much less the inconvenience of installing a different browser and getting Java enabled
On a completely different spin: any tips for becoming good at the game? I can't even pass level two, and I've already exhausted my (very limited) mental QM book.
Most levels are easier to solve if you don't hang about: the longer you wait, the more uncertainty bites and the position becomes indefinite.

Remember there's no friction so if you accelerate over half the screen you need to decelerate over the other half if you're going to stop before the other side.

Level 2 can be solved by accelerating/decelerating to follow three straight lines (east-south-west) to the goal. Alternatively if you're feeling cocky you can accelerate east then throw in some south as you approach the corner: you'll bounce off the walls and break the wavefunction a bit but about 50% of the time the goal will trigger.

If you haven't discovered already you can also skip levels from the menu ;)

Thanks, that helped a lot! I also felt really clever when I realised that if there's a "Collapse 5%" trigger zone I barely have to do anything other than nudge the wave in the right direction when some parts of it are near the collapse trigger. =)
To me (coffee-deprived Physics Bsc.) nothing jumps out as particularly erroneous, pretty fun. Save for some weird behaviour when you try to move the particles to fast as is noted in the game. I could also get some parts of the wave function outside of the bounds of the level (but within the applet) I'm not sure if this is supposed to happen? How do you model/simulate the fields?

I was actually thinking of making my own little Quantum game to see if it could be made fun. I was thinking of making a QGolf system, where you tweak an initial stationary wavefunction which is then collapsed after a certain time. Although these kinds of mechanics probably work better.

>Until I made this game I was pretty confused about the uncertainty principle. The way it’s usually taught, without resorting to maths, is to say something like this:

>Until I made Quantum Marble Maze (QMM) I had never heard a satisfying explanation for why frequency and momentum are the same thing. This is called Planck’s relation. Sure, you can demonstrate classically that higher frequency waves carry more energy, but does that really mean a particle changes frequency if you change its momentum – in other words if you push it?

If you know how to do Fourier Transforms, note that the momentum-wavefunction is the Fourier Transform of the postion-wavefunction. And in order to make a well defined peak using sines & cosines, you need a lot of high frequency (high momentum) waves. IIRC this is shown in Griffiths Introduction to Quantum Mechanics, quite a good introduction to QM.

Thanks. On your latter point, I do get Fourier transforms, though for that logic to apply you first need to accept frequency-as-momentum :)
Yeah, I don't think that many people are going to be able to run this. Java applets are deprecated at this point, unfortunately. I'd love to be able to compile and run it locally, though.
SideShowB - since you implemented these as Java applets and as per your link want to learn more about QM, and specifically about improving learning and visualisation of QM, check out the below link.

It's a bunch of QM applets I created about 12 years ago to aid in visualising different aspects of quantum mechanics. I was a grad student at the time, and made these as part of a fellowship. Several of these were used in corresponding homework assignments and lectures for both grad and undergrad QM classes.

http://www.pha.jhu.edu/~javalab/

I decided to apply for this fellowship after an enlightening experience seeing the time evolution of Coherent States of a quantum simple harmonic oscillator.

Nonsense, it took 10 seconds for me to run it. Just open firefox and click "remind me later" when it offers to update java.
There are some physics people here, but... wouldn't it be a much better idea to ask a physics forum?
The following (while not wrong) is hard to read. You lament that people think "a particle does have definite position and momentum" but don't go on to state that they do not have definite x and p. Why not state this unambiguously?

> This can lead to a bit of confusion, because a lot of people take that to mean that a particle does have definite position and momentum (I mean, all things do, right?!) but you’re sadly not able to find out what it is. Maybe because trying to measure one changes the other – logically that makes sense, right?

> But this is QM, so until you start turning it into computer games, it won’t make sense

I'm reading through your description and this catched my eye: "In general, the smaller the wave, the faster it spreads out: this is the uncertainty principle." This is not true, spreading out is due to dispersion. Why you don't see particle like wave packets on water surface? Also dispersion. In fact you can create particle like waves on a guitar string, which is pretty much dispersionless. Also you can describe massless particles in QM which are also dispersionless.

The uncertanity principle is about the uncertanity of non-commuting observables at any given time (eg. position and momentum), it's not about the time dependence of the wave function.

(comment deleted)
It's fairly common for people to relate this quantum phenomenon to the uncertainty principle, though. Someone asks: "Why can't I just say 'the particle is at rest in this small area' and expect it to stay there forever?" And one take on the answer is "Because you're imposing a very small uncertainty on the initial position, the initial momentum must have a very high uncertainty. That means there's a substantial probability that the particle will move away from its initial position over time, which corresponds to the wave function spreading out."

You can certainly talk about it in terms of Fourier components or that sort of thing, too. There's a degree to which the uncertainty principle as applied to the position/momentum degrees of freedom is nothing but a statement about Fourier transforms. But I don't think it's a bad conceptual shorthand, especially for students who aren't yet experts in thinking about Fourier stuff.

As a non Fourier expert, thinking about the general concept of the Fourier transform (spatial vs frequency coordinates),and how position and momentum are Fourier transforms of each other, was highly illuminating
This certainly gives me food for thought.

Are you saying then that by allowing people to directly observe the wavefunction I'm not really demonstrating uncertainty at all? As that only arises when you force observation via position/momentum?

Also if a massless quantum particle is dispersionless does that mean you can say "the particle is in this small area and will stay here forever"? Doesn't that violate uncertainty?

I would put it this way: Time dependence, therefore dispersion is in direct connection with the model Hamiltonian. The uncertainty principle is independent of time dependence and the model Hamiltonian.

I think I made a mistake about massless quantum particles, since in 3D a packet disperses in all directions. But in 1D it works. It can't stay stationary, but it moves with "c" in either direction but it stays in a localized area, still the uncertainty principle still holds.

>it's not about the time dependence of the wave function.

The uncertainty of position and momentum is fundamentally about the Fourier transform, and is definitely about the time dependence of the wave function. You don't even need a full description of quantum mechanics to get the uncertainty principle, "momentum is the Fourier transform of position" gets you there immediately.

> This is not true, spreading out is due to dispersion.

In this case, for a massive particle, the spreading out is due to the uncertainty principle. That uncertainty principle might be the cause of the dispersion, but you don't need to invoke anything else to get the spreading out.

>Why you don't see particle like wave packets on water surface? Also dispersion. In fact you can create particle like waves on a guitar string, which is pretty much dispersionless. Also you can describe massless particles in QM which are also dispersionless.

You can create particle like waves on water surface, on a guitar string (which IS dispersive, just not to first order), and in massless particles. They are called solitons, and are a pretty cool area of research.

A few thoughts, speaking as a physics professor who asks his relativity students to play both "Velocity Raptor" and "A Slower Speed of Light":

* Like many others here, I was a bit dismayed to see this implemented as a Java applet. Increasing security concerns have meant that I've been able to use fewer and fewer of those in my classes: it's just not reasonable to ask students to jump through those hoops anymore.

* When I look at the menu, it only goes up through level 7.

* I have made very little progress on level 8 (the one with the diffraction grating in the middle that's trying to get you to reach 2% transmission at about an 80 degree angle on each side). I have a general idea of what you want me to do, but I get so little visible transmission most of the time that it feels all but impossible to fine-tune my momentum or other aspects of my strategy. (Is there any way to increase the slit widths or number of slits or something to make that easier?)

* What exactly do the arrow keys do? Are you imposing a linear potential gradient across the whole screen for a short time? It's hard to judge "accuracy" when I'm not quite sure what I'm looking at. (That also means I'm not entirely sure how to teach it.)

* Along similar lines, do you have a sense of what exactly is leading to the visible interference effects during motion? (The ones that you point out can be guides as to which direction the wave is moving?) Maybe I ought to have a direct intuition for this! Is it purely an effect of reflections off of the walls, or would I see the same thing if I started with a Gaussian wave packet in a linear potential without any boundaries at all? (And if it's reflection related, why is it mostly showing the direction of primary motion rather than the direction of the reflections?) Some explanation for this might be nice in a teaching tool.

* Do you think you could allow the user to toggle the phase-rainbow mode on and off? (That's the mode that I would expect to always give an indication of the dominant momentum of the wave function.)

* The "collapse" mechanic is very helpful for game play, but might deserve some sort of explanation. In particular, I worry that it could train students to believe a critical misconception: that if the probability of a particular state becomes high enough, that state immediately becomes "true". Maybe that wouldn't turn out to be a serious concern, but I'm not certain that beginners are well-equipped to recognize which weird aspects of game play are supposed to reflect real physics and which are mere game enhancements. (The way collapse works here feels a lot like Copenhagen, but not quite, since it doesn't obey the Born probability rule.)

* It would allow for significantly richer strategy and game play if the player had a wider menu of potential functions to choose from. (For instance, what if the arrow keys continued to be linear potential functions and a mouse click provided a harmonic oscillator?)

* In your explanatory text, I'm not comfortable with your discussion of decoherence. I'm far from an expert on that subject, so I'm hesitant to try to offer specific corrections. But it feels off to me. (In particular, a single quantum particle bouncing off of strict potential energy walls should not be a manifestation of decoherence, because the particle's state isn't becoming entangled with the state of those walls in any way. I don't see any manifestation of decoherence in the game.)

In case you're interested, my current favorite intro level textbook on quantum mechanics is Tom Moore's "Six Ideas that Shaped Physics: Unit Q". It doesn't go as far as I'd like for a really thorough course (which is especially true in the recent 3rd edition, though the material that's still there is presented much more clearly), but as part of an introductory sequence it does a great job. Much like...

Another mega comment: don't know why this isn't more upvoted. Thanks for the bug report.

Level 8 is odd. You thought more diffraction would occur with slower speed right? In the simulation it doesn't; bounce off the left wall and hit the grating fast to complete. I have to admit this bothers me. I can only assume this is because sidebands which would otherwise hit the grating itself move inwards to hit the 2% targets or something. Not good at all from a learning point of view.

Yes, the arrow keys impose a linear potential gradient while they are being held. It fades in gradually as well so no sharp transients (unless you differentiate). Not sure if that detail was required but it's there now.

The interference effects during motion are not wall reflections as far as I can tell. Some levels such as the traps don't have walls but (imperfect) absorbers and they exhibit it just as much. You're right, it's easy to see why this occurs in the rainbow mode but not so much in the amplitude mode. Genuine physics or artifact of simulation - presumably somebody can do some calculus and work that one out!

Decoherence, I acknowledge should involve multiple quantum particles. What we do see here though is an evolution from a single particle with coherent phase, which interferes with itself, into one with incoherent phase, that doesn't. Conceptually that seems similar to decoherence.

I think all your pedagogical points are good ones btw.

Like I said to evanb, if you would like to be acknowledged for your review I'm more than happy to. Best wishes.

I'm very puzzled about level 8, based on what you've said. Certainly to be a good pedagogical tool, I'd want to see a system that very visibly showed a wider and wider diffraction pattern for longer wavelengths (as you've said). [The one advantage of a bounce that I was able to think of while playing was that it might wind up giving a cleaner "plane wave" input, but I'm not even sure that that's an advantage. Now that you mention it, though, perhaps there is some ideal speed for which bouncing off the back and side walls would result in propagation at an angle, so that a meaningful fraction of the probability density would hit the targets in as a central interference maximum.]

If I were you, I'd leave out the discussion of decoherence entirely. It's a subtle topic (evanb did it justice, I think), and I'm reasonably convinced that it doesn't really apply to the game. (Even if I might be wrong about that, is that tidbit of background info important enough to your discussion to be worth the effort and/or the risk?)

Thanks for a fun take on quantum stuff, regardless! (I don't know what's in the higher levels, but might be fun to see some more examples of things like tunneling through different barriers. And I wonder if there's any way of setting up resonance in a cavity in an interesting way...)

Regarding credit: I don't feel like I've contributed that much at this point, but if you wind up with a moderate list of thank you's at some point, you're welcome to include "Steuard Jensen" on the list.

[As for my comment not being more upvoted: I think I got some sort of black mark on my record here a few months ago after I tried to insist that recent reports about reactionless propulsion systems are very unlikely to pan out. Ever since then, I've gotten the sense that my comments are showing up with an initial scoring penalty.]

Re resonance in a cavity, I have some prototypes but they didn't make it into gameplay. Actually the end screen is an example. Several levels do exhibit resonance in a potential well: 7, 9, 11 and 12.

[Really? Wow, that's harsh. I haven't the foggiest how HN scores work, it's all rather secretive isn't it.]

This is one of the coolest things I've ever seen.
This reminds me of the old Quantum Minigolf game, though that was desktop C++:

http://quantumminigolf.sourceforge.net/

Instead of arrow keys, you use a putter to tap the quantum golf ball.

I'm starting to think if I had made this a downloadable C++ executable I'd have fewer complaints about security :D
[1/4] Source: I am a nuclear physicist.

Full disclosure: I didn't play. I'm not launching a Java applet. So I'm just reading your description for physics content.

> (The independence of quantum systems from absolute phase is called gauge symmetry)

Gauge symmetry isn't the independence of the global phase---it's the independence of a spacetime-dependent phase. This is a much much bigger symmetry than the independence of global absolute phase.

> Until that question is answered, then we can’t rule out the possibility that consciousness does have something to do with it.

Are you sure you only read Feynman? This is an extreme fringe position. I don't know any physicists who actually holds this position, unless they're trying to get on TV.

> Interestingly, the Schrodinger equation states that a particle can’t exist at all in a place with more potential than the particle has energy. It will simply “jump” down any available holes to satisfy the equation. The same jumping behaviour is what gives rise to tunelling, when a particle jumps as if by magic from one hole to another.

That's exactly the opposite of what the Schrodinger equation says! A particle can exist in a place where the potential energy is more than the total energy. That cannot happen classically, but is allowed quantum-mechanically. However, the wavefunction dies off exponentially fast. But it's never 0 unless the potential is infinite. That's what allows tunneling---the exponentially small tail is real.

There is no "jumping" in quantum mechanics. The Schrodinger equation implies the continuity equation [continuity].

[2/4]

> Decoherence doesn’t explain, though, why the wavefunction collapses to a singular thing we call “reality”. So quantum mysticism still has room to flourish.

No. Decoherence is the thing that lets you avoid the need to collapse at all. The point of decoherence is that many quantum particles interacting together looks like a quantum superposition of many classical systems. So if you "are" one of those particles and look around, you'll see things behaving classically---only if you are "outside" (ie. have full access to the wf) can you see anything quantum going on.

If the wavefunction doesn't collapse, why does it look like it does collapse?! Well, you're inside the wavefunction. Before the different classical possibilities decohere, you wait with anticipation. After decoherence, a version of you is in each branch of the wavefunction, each observing different outcomes, wondering how the wavefunction collapsed! But, it didn't---it's just hard to see that from where you're standing.

This is the claim of the Many Worlds interpretation --- the wavefunction never collapses. Everything just evolves according to the Schrodinger equation, forever. There is no place or regime where quantum mechanics breaks down. Every branch of the wavefunction is equally real and continues to exist forever.

So, why don't we see all sorts of zany, quantum effects in our every day life? Decoherence saves the day: even with a few dozen particles the different branches of the wavefunction have decohere enough that it'd take a massive, huge, gargantuan coincidence for two parts of the wavefunction to interfere. It's still possible! But it's extremely unlikely. Now scale up to Avogadro's number of particles, and forget it: things just look classical.

[3/4]

> You could also massively simplify particle interactions to make some reasonable gameplay; perhaps even simulate a quantum computer. Do get in touch with me if you want to do this; I’d be keen to help.

If you can find a way to simulate an arbitrarily-sized quantum computer with a reasonable amount of computing, you will get famous. A few particles should be possible but it won't scale well. You're right to worry about how to draw it. You might consider (fixed-in-space) spin systems instead, where you can draw the density matrix with (relative) simplicity. But then you lose the moving-around-in-space intuition.

> Feynman dedicates a lot of his book to two state systems, because these are ultimately responsible for the strong and weak nuclear forces. > Nuclear forces arise when you vary the size of the system, and the two possible stationary states display slightly different energy characteristics. This means the system has a lower energy at a certain size.

Oy. This is wrong.

Two state systems are interesting in-and-of-themselves because you can exactly solve them, they have many actual instatiations in nature (in fact, anything you might consider making a qubit out of!), and they provide toy models for many kinds of other physical systems.

Nuclear forces do not arise from two state systems. There is a pecularity in nuclear physics---the proton and the neutron look (almost) exactly the same. OK, they have different electric charge, but nuclear force doesn't care about electromagnetism. What's interesting is that they have almost exactly the same mass: m_Neutron = 939 MeV, m_Proton = 938 MeV. Well, that's quite surprising! Why should that be? Most particles we know have dramatically differing masses (eg. m_electron = 0.511 MeV, etc). So, what's making these masses come out the same? Moreover, people noticed empirically that the interaction between protons and neutrons seemed to look roughly the same (once you account for electromagnetism).

This led people to hypothesize a symmetry called isospin symmetry---the symmetry between protons and neutrons [isospin]. You can make a lot of progress by assuming that protons and neutrons form two-state system and that the nuclear force doesn't care which state you're in. Then, you can incorporate the slight differences on top.

In fact, you can get a lot farther once you have this idea in hand. You realize that the pions form an iso-triplet, the delta baryons form an iso-fourplet, etc [fourplet]. Then you find particles with strangeness, and you really get going. You wind up recognizing deeper underlying patterns that reveal beautiful symmetry.

Isospin symmetry is not a true symmetry of nature, but it's a very good approximation, and it's related in some ways to weak isospin [weak].

Knowledge dropped, it is now officially impossible for further comments
>[3/4]

I find that unlikely...

[4/4]

> Base states are arbitrary things, like a trap or a goal in QMM, but you can still ask what the chances are of a particle being in one of them.

You're right that basis states can be arbitrary. However, that's not their most important characteristic. We say we have a basis if we have a set of states that covers all the possibilities and they're not redundant. That is, if any state can be written as a unique sum of basis states.

> Stationary states are more like wavefunctions in QMM that have settled into a stable condition. Their phase may go on changing, but the amplitude doesn’t.

The set of stationary states is a special basis. It's the set that when evolved in time only change by a phase, as you suggest---these states don't get mixed together when time marches on. So, how can a system "settle" into such a state? In other words, if you rewind the Schrodinger equation, what state was the system in before? Simple: it was in the same stationary state!

Because stationary states form a basis, any non-stationary state is a unique sum of stationary states. In fact, if you know this basis and their corresponding energies you know all there is to know about a system's dynamics! If you take an arbitrary state and decompose it as a sum over stationary states (which is always possible, since they form a basis) then you immediately know how that state evolves in time, because you know how the individual components evolve in time.

Since the individual stationary-state components don't mix together, the only thing that changes in time is their relative phases. So, if a system doesn't start in a stationary state, it cannot possibly reach one, without there being some kind of perturbation (ie. alteration of the system).

Postscriptum

Not having played, I can't say that it's not faithful to a deep understanding of quantum mechanics. But, I am skeptical, because your write-up seems to have a lot of confusion about what QM actually is / says. That's OK---it's a tricky subject. But I would avoid trying to push your game as a pedagogical learning tool unless it's been thoroughly vetted by actual physicists, because you could easily confuse neophytes.

In some sense, the learning approach you have laid out stresses the parts of quantum mechanics that are the least interesting and least novel---they can be understood from playing with a wave equation. What's new is superposition, commutation of operators (or failure to commute), interference. That's why most modern approaches start with two-state systems (which immediately require bras and kets) and only go to systems with spatial extent later. In other words, it's better pedagogically to understand the operating system (quantum mechanics) before you start studying particular programs (particular systems).

When you study particular systems there's a lot of intricate detail that doesn't matter for you to learn the lesson. You don't really need to know about the Laguerre polynomials or whatever. The way you learn quantum mechanics is by showing a bunch of wavefunctions are orthogonal---it's not about performing integrals. You're better off understanding orthogonality, linearity, and unitarity.

> I found myself baffled trying to understand the connection between state notation, continuous wavefunctions...

Moving from bras and kets to wavefunctions is, honestly, trivial---if you have a firm understanding of what's going on. That's why I'm nervous about trying to translate your game (which again, may be faithful to QM---I haven't played) into actual education.

[continuity] https://en.wikipedia.org/wiki/Continuity_equation#Quantum_me...

[isospin] https://en.wikip...

Hi evanb, thank you for your efforts in writing a detailed assessment. That's all very enlightening indeed. I'm sure I'll have more to ask about individual parts once it's all sunk in but thought I'd acknowledge the whole response right now!
Right, guardians dispatched, onto the boss :)

There’s lots of really interesting stuff here to follow up, some of which will take me a very long time. All of it is appreciated as I haven’t yet had the opportunity to discuss the subject with somebody who truly has a handle on the subject - at least not since the optional first year physics module I took as part of my CS degree 17 years ago, and that didn’t go this far.

In no particular order…

> I would avoid trying to push your game as a pedagogical learning tool unless it's been thoroughly vetted by actual physicists

Noted, though vetting is exactly what I’m trying to make a start on here :) Your comments on the learning process are interesting and don’t square with my own experience, though perhaps they would if I were formally taught. I might scale them back.

While we’re talking about vetting, if you’d like to be credited for your efforts towards that, by real name or HN handle, please let me know as I feel it would only be fair to add an acknowledgement.

>Gauge symmetry isn't the independence of the global phase---it's the independence of a spacetime-dependent phase.

I don’t quite follow what the latter means, but is it correct to say that independence of global absolute phase arises from gauge symmetry?

>That's exactly the opposite of what the Schrodinger equation says!

Noted and understood. I should replace “can’t exist” with “has low probability” and modify accordingly.

>If you can find a way to simulate an arbitrarily-sized quantum computer with a reasonable amount of computing, you will get famous. A few particles should be possible but it won't scale well.

Yup. A few particles was what I had in mind.

>> Nuclear forces arise when … >Oy. This is wrong.

Excellent advice, thanks for the heads up: I’ll cut the entire footnote. Are nuclear forces getting beyond QM then – into QFT? I would love to go on and learn that but haven’t got there yet.

>> Until that question is answered, then we can’t rule out the possibility that consciousness does have something to do with it. >Are you sure you only read Feynman? This is an extreme fringe position. I don't know any physicists who actually holds this position, unless they're trying to get on TV. >No. Decoherence is the thing that lets you avoid the need to collapse at all. >This is the claim of the Many Worlds interpretation

With interpretations of QM I think we’re getting more into philosophy than physics, until the day comes that we get different predictions from any of them. Somehow this makes me feel qualified to argue with a nuclear physicist...

I may be discussing a fringe position, but am I right in thinking your counterargument relies on invoking many worlds, which isn’t mainstream either? To summarize the popular interpretations

- Copenhagen is mainstream but doesn’t explain collapse

- Many worlds is quite popular but possibly the least parsimonious theory in the entire history of science

- Pilot wave theory holds promise as it doesn’t need collapse, it isn’t mainstream though seems to be gaining popularity at the moment

So at the moment I’d say there is still room for a consciousness based interpretation. I’m a former AI researcher btw, I used to take the strong AI consciousness-as-emergence position but I no longer think that explanation cuts the mustard. At the present state of science I think all we can say about consciousness is “there is some very big important process going on and we don’t have the first clue what, where and how”... as such I don’t think it’s scientific to completely rule out the possibility that consciousness is involved in collapse as the latter is a process we haven’t adequately explained yet either. Presumably most physicists steer clear of this as consciousness is so far beyond where science is now that they’d rather (quite sensibly) not speculate, lest they be remembered as the Victorian engin...

Not that a quality post like this needs it, but for what it's worth, as a physics professor I'd happily endorse just about everything you've said in this detailed response to the text accompanying the game (all four parts). (My own comments focused mostly on the game itself, to the extent that I get what's going on under the hood.)
Aside: Hey you are the guy who wrote those awesome tutorials on lagrange multipliers!!! I actually used your materials multiple times at official presentations, devtimes and other occasions where the management and developers wanted to know how bidding optimization worked under the hood. Thank you so much for writing so well.
I'm glad to hear that you've appreciated that tutorial! It's especially neat to hear about it being useful to people who aren't just cramming for a class.
Well, thanks! Now if you know any tenure-track job openings looking for a lattice gauge theorist / nuclear physicist... I do side projects on string theory and BSM physics, if that helps :P
You asked for feedback, and here it goes: I couldn't run your applet on my machine.

It's not my intent to attack the choice of Java, but I can't avoid noticing that Java applets as a web technology are getting seriously obsolete these days. It's a challenge to get these applets running.

JavaScript works way better on the web (I hate to say it, but beware the silly name: JS as a programming language has nothing to do with Java).

The traceback follows.

    Exception was: 
    net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet. For more information click "more information button".
    	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:739)
    	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:668)
    	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:901)
    Caused by: net.sourceforge.jnlp.LaunchException: The applet is signed but its manifest specifies Sandbox permissions. This is not yet supported. Try running the applet again, but choose the Sandbox run option.
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkPermissionsAttribute(ManifestAttributesChecker.java:217)
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkAll(ManifestAttributesChecker.java:82)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader. (JNLPClassLoader.java:288)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader.createInstance(JNLPClassLoader.java:351)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:418)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:394)
    	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:704)
    	... 2 more
    Caused by: net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Run in Sandbox call performed too late. The classloader was notified to run the applet sandboxed, but security settings were already initialized.
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader$SecurityDelegateImpl.setRunInSandbox(JNLPClassLoader.java:2386)
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkPermissionsAttribute(ManifestAttributesChecker.java:214)
    	... 8 more
    This is the list of exceptions that occurred launching your applet. Please note, those exceptions can originate from multiple applets. For a helpful bug report, be sure to run only one applet. 
    1) at 6/1/16 7:09 PM
    net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Run in Sandbox call performed too late. The classloader was notified to run the applet sandboxed, but security settings were already initialized.
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader$SecurityDelegateImpl.setRunInSandbox(JNLPClassLoader.java:2386)
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkPermissionsAttribute(ManifestAttributesChecker.java:214)
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkAll(ManifestAttributesChecker.java:82)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader. (JNLPClassLoader.java:288)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader.createInstance(JNLPClassLoader.java:351)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:418)
    	at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:394)
    	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:704)
    	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:668)
    	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:901)
    2) at 6/1/16 7:09 PM
    net.sourceforge.jnlp.LaunchException: The applet is signed but its manifest specifies Sandbox permissions. This is not yet supported. Try running the applet again, but choose the Sandbox run option.
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkPermissionsAttribute(ManifestAttributesChecker.java:217)
    	at net.sourceforge.jnlp.runtime.ManifestAttributesChecker.checkAll(ManifestAttributesChecker.java:82)
...
Really enjoyed this game...I was very skeptical before I actually ran the applet.
Pretty cool game. Although I have been unable to map it to any of the limited knowledge/understanding I possess about quantum mechanics.
(comment deleted)
I wish I could play the game. I have the same java applet problem. Hopefully I'll be able to play later.

A few words on quantum mechanics - it is very tricky. Someone doesn't understand quantum mechanics by taking a class in it or in getting an undergraduate physics degree. I am sure even many (or all) physics professors have limitations in their knowledge. It's not that the rules are complicated, it is the implications when it is applied in the real world. You do seem to have gained a good level of understanding though.

I have a comment on the nature of a wave function, as described in the section "It's wavelike, but not watery". It states that wavefuntions can act like particles. This may be wording that I just do not understand, but I would want to clarify it.

Take the wave function for an electron - this is not a wave of "electon". It is a wave of probability (sort of) for an electron. The electron itself is always a particle. The motion of the electron is described by the wave. In this way the electron has wave properties.

To take an example, let's shoot an electron gun at a target. Suppose the resulting wavefunction of the electron has a uniform amplitude over the target when it "hits". What is the damage to the plate? Is it uniform damage? No. The damage is always at a single point of impact. We see the result of the electron hitting the target, not the wave function hitting the target.

Now, if we shoot lots of electrons, the damage will be pretty uniform, since they will be distributed all over the plate. But it will still consist of a bunch of point impacts.

I just wanted to be clear about differentiating the wave function from the object whose state (position, momentum, whatever) is described by the wave function.

Can somebody post some screenshots or a video so I can see if it's worth installing Java?