
Quantum Mechanics for Programmers - taheris
http://kim.oyhus.no/QuantumMechanicsForProgrammers.html
======
monktastic1
Hmm he seems to imply that MWI is the "right" interpretation, and that the
measurement problem is solved. Most physicists would not agree. If you follow
the link to his MWI description, there's this gem:

> But fortunately, I knew computer science, which most physicists do not know,
> with the Church-Turing thesis, which roughly states that anything physical
> can be simulated by a computer.

But that is not what the Church-Turing thesis says. A Turing machine cannot
mimic a truly random physical process, pretty much by definition.

And then:

> This means that observers can be simulated by a computer.

Except that nobody really understands what kinds of physical interactions
qualify as measurements -- or even if that is the right framework to use at
all.

~~~
doubleunplussed
I'm a quantum physicist (well, we don't say that, I'm an atomic physicist, but
for anyone not aware it is 99% quantum mechanics we do all day), and the MWI
isn't universally accepted, but it's not universally rejected either. Plenty
of important physicists interpret quantum mechanics that way, and I do too (I
am not important though). That's not to say I'm confident it's _correct_ ,
just that it's the most sensible way to understand the theory as we know it so
far.

It might not completely solve the measurement problem, in that the purported
derivations of the Born rule are hotly contested, but neither does any other
interpretation - it gets further than most. I don't see anyone else except
pilot wave theory (which violates locality) deriving the Born rule either.

"measurement is not special, and observers are just quantum systems like any
other" seems like it ought to be the default assumption to make, in the
absence of any evidence to the contrary, and honestly I think the reputation
of MWI as a bit crazy comes about for purely historical reasons. Namely, Bohr
didn't like it and he held a lot of sway.

Physicists are human, and parallel universes is pretty strange, so most people
reject the idea without thinking about it in much detail.

Most physicists' opinions shouldn't count for much anyway, because the
measurement problem simply doesn't come up in our day to day work, so most
haven't thought about it much.

Furthermore, plenty of physicists don't actually grasp the fundamentals of
their own field - they specialise a lot and can use specialised theories to
get what they need done without understanding in detail where it came from.

So I really think the decoherence people, as cranky as their website looks and
as oddly as they write, ought to be the ones whose opinions count on the
matter.

Edit: seriously, check out their website, straight outta the nineties:

[http://decoherence.de](http://decoherence.de)

~~~
Xcelerate
> Furthermore, plenty of physicists don't actually grasp the fundamentals of
> their own field

I once met a professor at a quantum chemistry conference who argued with me
that I could not converge on the exact eigenvalues of a helium atom (assuming
a simplified Hamiltonian with a few Coulombic terms). He stated the oft
repeated mantra that "the Schrödinger equation can't be solved for any element
other than hydrogen", so I wrote a program that brute force diagonalized the
Hamiltonian to demonstrate otherwise. He was confusing the notion of a closed-
form solution (an analytical expression that gives the solution in terms of
specified elementary functions) with that of a numerically exact solution (one
that converges on the exact solution but can't be expressed in terms of
specified elementary functions).

Another professor who was teaching a course on statistical mechanics once said
that the single particle wave function is more fundamental than the multi-
particle wave function. Nevermind the fact that his research involved density
functional theory, which famously fails on those cases where the molecular
wave function _can 't_ be well approximated using a product of single particle
wave functions.

~~~
codethief
> Another professor […] once said that the single particle wave function is
> more fundamental than the multi-particle wave function. Nevermind […] his
> research […] where the molecular wave function can't be well approximated
> using a product of single particle wave functions

Depends on what you mean by "multi-particle wave function". The way it is
usually understood (I think), it includes all possible tensor products of
single-particle wave functions. Then it should be possible, shouldn't it?

~~~
monktastic1
Tensor products only describe the separable (i.e., unentangled) states.

~~~
tomonl
As I understand it, that is only true when dealing with density matrices. For
example, |0>⊗|0> \+ |1>⊗|1> is entangled and has tensor products. I think that
Xcelerate is correct in saying that all combinations of the basis vectors form
the basis of the multi-particle Hilbert space, as a single-particle
wavefunction is just a vector/ket.

~~~
monktastic1
Sure, the tensor product space has a _basis_ that is formed by the tensor
products of all pairs of basis elements. But this is different from saying
that any particular vector in the space is a tensor product of elements from
the individual spaces.

But I'm possibly just misunderstanding what you're saying.

------
madhadron
This puzzles me extremely. There are very insightful statements like

> One does not deduce them like one do in math. The physicists who actually
> did this stuff apparently knew this, and considered the math more akin to
> toying with the models to see what happens, to see if they could get better
> models

Which is absolutely true. Part of the problem with quantum mechanics texts is
that they're almost all descended from Oppenheimer's lectures (via Schiff's
book) to graduate students who already _knew_ this, and just needed someone to
brain dump the latest techniques.

But then it's mixed with really basic misunderstandings, like

> Many physicists like to believe that this makes the underlying model
> irrelevant; that the matrix behaviour, its eigenvalues, is the only thing
> that matter. You will encounter lots of this in books about Quantum
> Mechanics. This however is not science, because it ignores Ockhams Razor;
> the models shall be the simplest ones. A sparse matrix is simpler than when
> it is Fourier transformed, or put into atom orbitals. (I thank Eliezer
> Yudkowski who gave a reminder that Ockhams razor belongs here too.)

Quoting Eliezer Yudkowski is a useful heuristic for not taking someone
seriously, but this quote implies that the author missed the whole point of
linear algebra. And is falling into the traps described by Theorem IV in van
Kampen's [Ten Theorems about Quantum Mechanical
Measurements]([http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=617...](http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=617AE275E5CECF5F0AFD69ACBC52141B?doi=10.1.1.205.6529&rep=rep1&type=pdf)).

------
d_burfoot
> Since you are a programmer, you do not know what science is, even though you
> may believe you do. A hint: Computer science does not contain science, just
> mathematics.

He probably wrote this half in jest, but it is actually a serious issue in
fields like Natural Language Processing and Computer Vision that are have
their intellectual roots in Computer Science.

Papers in CV and NLP are about data structures, algorithms, software
engineering methods, neural networks, statistical models, and so on. They do
not discuss anything in particular about the structure of language or the
properties of images. This is because they are descended from CS. In CS,
exemplar results are ideas like QuickSort and Dijkstra's algorithm. These
algorithms work on _any_ list or graph; you do not have to know anything
special about the particular properties of the list or graph you are operating
on.

As an illustrative anecdote, I went to an NLP talk given at MIT by a well-
known Google/Berkeley parsing researcher. He gave a talk about a system that
used neural networks to do sentence parsing. In the QA session, I mentioned
the idea of verb argument structure, and asked how the system would learn, for
example, that a verb like "persuade" or "argue" can take a that-complement,
while other verbs cannot. He didn't really have an answer, because it wasn't
the kind of thing that he worried or thought about. My guess is that he did
not consider such a question to be relevant to his field.

~~~
neshibble
I do research on Deep Learning. That seems the exact kind of question they
would deem relevant to their field.

I don't know much about NLP but if I had to guess the answer to your question
is include it in the training data. I don't know what model they use, but
presumably it parses out sentence structure in a specific format and uses that
as input to some neural network architecture.

Not really sure why he didn't answer your question, it's the exact kind of
question people do NLP to answer.

------
hota_mazi
It's puzzling to see the author call himself multiple times a scientist while
lending so much importance to Occam's razor (which is spelled differently in
the article, not sure if it's an alternative spelling in his language or a
mistake).

Occam's razor is not a law. It's not a fact. It's a simple suggestion if
you're looking for a starting hypothesis.

Not sure which way to start to investigate a phenomenon? Pick the simplest one
and verify that one. It doesn't mean it's right, it doesn't mean it's wrong,
just that it's a reasonable first guess.

But not a proof. Not a fact. Just a guess that's statically more likely to be
right.

~~~
defined
Occam is the Latinized version of Ockham, as in "William of Ockham" [1].

[1]:
[https://en.m.wikipedia.org/wiki/William_of_Ockham](https://en.m.wikipedia.org/wiki/William_of_Ockham)

~~~
TheOtherHobbes
Which must be the correct spelling, because it's shorter.

------
JadeNB
This seems just to be a model of systems evolving according to discrete
difference equations, admittedly derived from quantum mechanics; it doesn't
seem to have much to say about quantum mechanics _per se_. It reminds me of a
lower-(math-)tech version of SICM
([https://mitpress.mit.edu/sites/default/files/titles/content/...](https://mitpress.mit.edu/sites/default/files/titles/content/sicm/book.html)).

------
sideshowb
A slightly wacky article, but I do think there is lots more scope for
explaining quantum physics via programming concepts. I got what little
understanding I have of QM by creating a game that simulates it. I even made
my own wacky article as well :)
[https://linkingideasblog.wordpress.com/2016/04/25/learning-q...](https://linkingideasblog.wordpress.com/2016/04/25/learning-
quantum-mechanics-the-easy-way/)

------
eastWestMath
Why not categorical quantum mechanics?

~~~
jesuslop
Yeah I'm reading a nice book from Coecke and Kissinger [1] just issued and am
loving it, it's the story of String Diagrams for a wider audience and with all
the details fleshed out (not just hinted as in Baez TWFs). Monoidal
categories, tensor networks, directed PGMs, quantum computing and even vector
space NLP semantics are all particulars seen from this vantage point.

[1] Picturing Quantum Processes, ISBN 1108107710

~~~
credit_guy
This book looks very promising. I just bought the kindle version on amazon.
Thank you.

------
ycmbntrthrwaway
> Here is a model of waves, as in light or sound, but not as in water waves or
> electron waves

How water waves are different from sound? Water wave _are_ sound, aren't they?

~~~
btilly
The wave that he is modeling is due to having a field in space-time that will
interact with nearby values of the same field in a linear way, which results
in it moving at a constant rate.

The waves that you see in water are the surface representation of 3-d
movements under the surface of the water. So you get effects such as the depth
of the movement for a wave determines its velocity. A wave that moves a very
deep water column moves very fast. (One that is a half-mile deep can move as
fast as a jet!) A wave that moves a shallow water column moves slowly.

Another interesting fact about waves is that there is a significant nonlinear
interaction between the depth of the water and the depth of the wave. As you
come to shore this causes the wave to rise up. Surfers enjoy this effect when
it comes to normal wind driven waves. But in the case of very deep and fast
waves, the effect is very much like a tide unexpectedly coming in. The result
is known as a tsunami or tidal wave.

These complex behaviors mean that water waves can behave very differently from
light and sound.

------
andrepd
This article does not elucidate anything about Quantum Mechanics, is quite
confusing, and indeed is plain wrong in several aspects. Very disappointing.

------
nivwusquorum
I actually find those notes particularly well suited for programmers:

[http://www.cl.cam.ac.uk/teaching/1516/QuantComp/materials.ht...](http://www.cl.cam.ac.uk/teaching/1516/QuantComp/materials.html)

------
halfnibble
I feel like this is what's wrong with the world: "In science one guesses at
explanations. One does not deduce them like one do in math."

As a programmer who took quantum mechanics in college, I have to admit, I
didn't understand most of it. Someone I respect once told me that if you think
you understand quantum mechanics, then you don't understand any of it at all.

The mathematical portion, vector mathematics with imaginary numbers, was the
only part that was interesting to me. It seemed to me that mathematical
deductions were necessary because the phenomenon modeled nothing in our
"reality."

------
B1tchard0
This article could have been written by an algorithm. Everyone knows the meme
about Quantum Mechanics being incomprehensible, like, ~"if you understand
quantum mechanics, you don't understand quantum mechanics".

Quantum Mechanics requires randomness, because determinism is scary. Both
probability and fate are functions of time, and time is the most interesting
thing to look at. Generally, Time is ignored, or at best "accounted for".

As a programmer I think time is more interesting than particles or fields or
probabilities of wave-function whatever

~~~
AgentME
>Quantum Mechanics requires randomness, because determinism is scary.

Isn't the many-worlds interpretation generally regarded as deterministic?

~~~
naasking
IIRC, it's deterministic in a sense that isn't equivalent to the way de
Broglie-Bohm is deterministic. The latter is generally what people mean by
deterministic, ie. it's a classical theory with an extra term to account for
quantum influences.

~~~
n4r9
Both theories model the universe as being in a definite, non-probabilistic
state, and that the state at one time determines the state at all future
times. But yeah there is some difference in the anthropocentric aspects, i.e.
how our observation of probabilities actually arises.

------
aphextron
The more I learn about physics and math, especially with regards to quantum
theory, I start to get really freaked out. The amount of "neatness" to the
universe is staggering. How there's no "inbetween" at the smallest scales.
Everything is discrete.

The fact that simple arrangements of symbols on a screen can perfectly
describe this behavior is mind blowing. It leads me to think there's no
possible way we're not living in some type of computer simulation.

~~~
krastanov
Minor nitpick: We definitely do not know whether everything is discrete. There
are plenty of quantum mechanical phenomena that do not have discrete spectra
(you can have light of any wavelength for instance (with some caveats at the
extremes of the energy scales)). We also do not have theoretical or
experimental proof that space-time is discrete at the Plank length-scale - all
we know is that our current theories break at that scale.

See [https://physics.stackexchange.com/questions/9720/does-the-
pl...](https://physics.stackexchange.com/questions/9720/does-the-planck-scale-
imply-that-spacetime-is-discrete) (the given answer is pretty great, but
beware, the author is known for being a bit hostile in his non-physics
opinions)

~~~
aphextron
Thanks for exposing my ignorance. I had an "aha" moment realizing that
relativity makes it so that there can be no "final" level of energy.

------
Coding_Cat
Hey, something I can comment on properly for once ;). Handed in my final
Quantum-field-theory homework yesterday (or blood-sweat-and-theory as I called
it, great fun) and finishing a MSc. in Computational science 'soon'.

From what I can follow, most of it is, unfortunately either varying degrees of
wrong or just confusing as all hell. :\

Some assorted quotes:

>The electron is not in a single place, but instead spread out over all the
positions, more or less. This is called "superposition".

No, the superposition principal states that individual states (contributions)
can be summed in a linear fashion. I know this is not a very clear way of
wording it, but it is one of those things I think is quite hard to word but
very easy to understand once you see it.

(Although one could say this is a form of superposition, namely a sum of
infinite delta functions in position-space. But this would be the most
confusing example to use)

>The smart programmer would guess at a model containing more complex math that
will get the array to model several particles, but no such thing exists.

Quantum field theory.

> These examples have used cubes with a width of 1000 voxels, and of 1000 time
> instants. The Universe use a width of something like 10^70 voxels. The same
> goes for time.

I assume this is (roughly matches) size-of-observable-universe/plank-length.
But this is misinterpretation of the planck length. As far as we (I) know,
spacetime is continouis. (string theorist migth disagree, I am not familiar).

Furthermore, the many particle approach is not at all reasonable. One would
(usually) use lattice-QFT. where one simulates a field for each _type_ of
particle (the field can have several components) and particles are identified
as excitation of this field. The most well known is lattice-QCD.

>Quantum Electro Dynamics

Quantum Electrodynamics ;)

>Richard Feynman got the nobel prize for figuring out a way of doing this. His
Quantum Electro Dynamics is a sort of dynamic programming method

This part is right (I have no idea what the next few sentences are trying to
say). Feyman diagrams (those fun squilly drawings) represent the results of
some awful, awful integrals. The real analytical answer is integrated over two
infinite spaces. But one can do a taylor expansion to get a answer which can
be computed. Feynman noted that you can read off a few rules from this
approximation and assign drawings to them. The answer can then be computed by
summing all (topologically distsinct graphs) instead of the terms in the
Taylor sum. It's much easier than it sounds (and sure as hell more fun than
doing integrals), and you can copy-paste entire sections of your diagrams as
long as the in and out-puts match up. perfctly suitable for dynamic
programming.

------
yorwba
There is lots of undefined behavior in the code examples, where x-1 is used as
an index although x starts from 0. I guess he didn't want to talk about
boundary conditions?

------
partycoder
You can also read the Feynman lectures on computation, has some notes on
quantum computing.

