# Quantum Spin Simulation

In Leonard Susskind's Quantum Mechanics: The Theoretical Minimum, he describes a computer program that could fool you into thinking there is a quantum spin in a magnetic field. This spin is inside a virtual measuring apparatus that can arbitrarily oriented during the experiment. The spin is represented internally by two complex numbers au and ad, for the up and down basis states. When you press the 'measure' button, the apparatus displays +1 or -1 with probability amplitudes au and ad, respectively. Doing so sets one of these complex values to zero and the other to unity depending on the outcome. Then, the Schrodinger equation takes over again.

• Why is there a magnetic field?
• Wouldn't the act of rotating the apparatus (in addition to the Schrodinger equation simulation and measurement collapse) have to change the complex values directly in order to account for a changing reference frame? It seems odd that the apparatus should influence the spin when it's not measuring. Consider, after measuring +1, very quickly turning the apparatus to point in the opposite direction and making a second measurement. By the Zeno effect, it should read -1. Yet Susskind's description says the probabilty of reading a +1 is always au squared, which hasn't had a chance to change yet, so it will be +1 again.
• After a certain number of steps of the Schrodinger equation, do the values of au and ad reach an equilibrium?

Psuedocode/formulas for the numerical simulation of a single up/down spin would be very useful.

• This will be easier to answer if you can quote the direct passage in full, or link to it if it is too long. – Emilio Pisanty Dec 9 '14 at 0:07

• Without magnetic field, spin is conserved. That means, if at the moment you had state with arbitrary spin direction, it will remain the same, apart from phase factor (which does not affect probabilities). Introduction of magnetic fields (for example, Zeeman term $- \mu \vec \sigma \vec B$) breaks symmetry -- only spin along z-axis is conserved. For example, if you have $\vec B = B \hat x$ and your state is $(A_u \quad A_d)$ in initial time $t_0$, then time evolution yields

$$\psi(t) = \exp(-i \mathbf{H} (t - t_0) /\hbar) \, \psi(t_0)$$

For simple Zeeman form of hamiltonian shows us that by taking matrix exponent

$$\exp( i \mu B (t-t_0) \sigma_x/\hbar) = [[\cos(\omega (t-t_0)), i \sin(\omega (t-t_0))],[i \sin(\omega (t-t_0)), \cos(\omega (t-t_0))]],$$ where $\omega = \mu B/\hbar$. So you just have to multiply your initial state by this matrix to get

$$(A_u \cos(\omega t) + i A_d \sin(\omega t) \quad A_d \cos(\omega t) + i A_u \sin(\omega t)).$$

There we see explicitly that states evolution in presence of Zeeman term is nontrivial (is not simply a phase factor) and probability of finding a state with spin in z-axis direction changes on time like $P_\uparrow(t) = |A_u \cos(\omega t) + i A_d \sin(\omega t)|^2$ and $P_\downarrow(t) = |A_d \cos(\omega t) + i A_u \sin(\omega t)|^2$.

If we take magnetic field along z-axis, then time evolution yields $(A_u e^{i \omega t} \quad A_d e^{- i \omega t})$, which does not affect probabilities.

• Such procedure can be simulated on computer for different hamiltonian of interaction of spin with magnetic field. In given example you can just state $A_u, A_d$ as probability amplitudes for initial time, ask your program to calculate wavefunction for arbitrary time and then give you resultant spins with probability $P_i$, given by formulas similar to above. This step involves computer pseudorandom, which gives you 1, when pseudorandom number $x$ is less then $P_\uparrow (t_0)$, and 0 otherwise ($P_\uparrow (t_0) + P_\downarrow (t_0) = 1$ in any monent). After that, you flush your wavefunction, so that it looks like $(1 \quad 0)$ or $(0 \quad 1)$ depending on decision your computer made and continue your evolution with initial time $t_0$. I believe that was meant by Prof. Susskind by simulating quantum system on computer. Indeed, it gives results similar to what measurement will give.

• We measure the probability amplitude to measure spin always along some axis (in previous example, I've chosen z-axis, in which we just have to take square modulus of first of second component of wavevector to obtain probability). Then by rotating the apparatus we mean that instead of measuring spin in, say z-direction, we measure it in arbitrary other direction. Rotating apparatus is equivalent to changing the basis from up and down spin in z-direction to some different direction basis. If we rotate it to turn in opposite direction, $A_u$ becames prob. amp. to measure spin down in this direction, and vice versa. But physically evolution remains the same, and spin points in the same direction. Well, there can be additional influence of *process of * rotating to spin evolution, but it is not straightforward, because other parts of your apparatus should interact with spin (similarly to as magnetic field does) to change it evolution. This may be similar to way in which rotating whole body rotate it's parts. The real reason is there are interaction between parts that keeps whole body together. However, it is not straightforward is there similar interaction in your rotating apparatus which affects spin evolution. There is examples of forces that keep spins of atoms and molecules rotating with bulk macroscopic body, but it is not most general case. I think prof. Susskind didn't mean that case at all.

• I should warn that "spin is along z-axis" doesn't mean that there is no probability to find spin aligned along some "x-axis". It just means that our state is eigenstate of $S_z$ operator with positive eigenvalue. But as operators of spin does not commute, our state is not eigenstate for, say $S_x$ operator, and it is not correct to say about certain value of spin along this axis. There is finite probability to measure the spin in positive or negative direction along this axis. This shows that notion of spin as arrow is not correct at all.