Quantum Spin Simulator Back
Quantum Mechanics

Quantum Spin Simulator

Visualize spin-1/2 quantum states on the Bloch sphere. Adjust magnetic field components and initial angles to observe Larmor precession and Rabi oscillations live — the physics behind MRI and quantum computing.

Magnetic Field & Initial State
B_z (longitudinal)
T
B_x (transverse)
T
Initial θ (polar)
°
Initial φ (azimuth)
°
Gyromagnetic ratio γ
Presets
Expectation Values
Results
0.00
⟨Sx⟩
0.00
⟨Sy⟩
0.71
⟨Sz⟩
1.00
ω_L (rad/s)
Spin
Rabi
Theory & Key Formulas
$$|\psi\rangle = \cos\frac{\theta}{2}|\uparrow\rangle + e^{i\phi}\sin\frac{\theta}{2}|\downarrow\rangle$$

Larmor frequency: $\omega_L = \gamma B$
Probability: $P_\uparrow = \cos^2(\theta/2)$
Expectation: $\langle S_z\rangle = \frac{\hbar}{2}\cos\theta$

What is the Bloch Sphere?

🙋
What exactly is the Bloch sphere? It looks like a globe, but for quantum stuff.
🎓
Basically, it's a brilliant way to visualize the state of a quantum bit, or qubit. For a spin-1/2 particle like an electron, its pure quantum state can be mapped to a point on this unit sphere. Try moving the "Initial θ" and "Initial φ" sliders in the simulator above. You'll see the arrow move, representing the spin's orientation.
🙋
Wait, really? So the north pole is... just spin-up? What about all the other points?
🎓
Exactly! The north pole is the pure $|\uparrow\rangle$ state. The south pole is $|\downarrow\rangle$. Any other point is a quantum superposition of those two. For instance, a point on the equator represents a state with a 50/50 chance of measuring spin-up or spin-down, but with a specific quantum phase. That's what the $e^{i\phi}$ term is for.
🙋
Okay, and the magnetic field sliders (B_z and B_x)... they make the arrow move? Is that what "precession" is?
🎓
Great question! In practice, a magnetic field makes the spin axis rotate, or precess, around the field direction. Set B_z to a positive value and hit play. You'll see Larmor precession—the spin circles around the z-axis. Now, add a bit of B_x. That's a transverse field, and it can cause the spin to flip from up to down, creating Rabi oscillations. Try it and watch the probability graph change!

Physical Model & Key Equations

The quantum state of a spin-1/2 particle is described by a two-component complex vector. On the Bloch sphere, this is parameterized by two angles, θ (polar) and φ (azimuth).

$$|\psi\rangle = \cos\frac{\theta}{2}|\uparrow\rangle + e^{i\phi}\sin\frac{\theta}{2}|\downarrow\rangle$$

Here, $|\uparrow\rangle$ and $|\downarrow\rangle$ are the basis states. $\cos^2(\theta/2)$ is the probability to measure the spin as "up", and $\sin^2(\theta/2)$ is the probability to measure it as "down". The phase $\phi$ is crucial for quantum interference.

The time evolution in a magnetic field $\vec{B}= (B_x, 0, B_z)$ is governed by the Schrödinger equation with the Hamiltonian $H = -\gamma \vec{S}\cdot \vec{B}$, where $\gamma$ is the gyromagnetic ratio. This leads to two key motions:

$$ \text{Larmor Precession: }\omega_L = \gamma |B| \quad \text{(around the total field direction)}$$ $$ \text{Rabi Oscillation Frequency: }\Omega = \gamma \sqrt{B_x^2 + B_z^2}$$

$\omega_L$ is the rate of steady rotation. When $B_x$ is non-zero, the spin's polar angle θ changes periodically, causing it to flip between up and down at frequency $\Omega$. This is the Rabi oscillation you control with the transverse field slider.

Real-World Applications

Magnetic Resonance Imaging (MRI): This is the most famous application. In an MRI scanner, a large static $B_z$ field aligns the spins of hydrogen nuclei in your body. A carefully tuned transverse $B_x$ field (a radio-frequency pulse) is then applied to flip these spins. By controlling the pulse duration (like adjusting the B_x slider over time), we can create detailed images of soft tissues.

Quantum Computing: In quantum processors, a spin-1/2 system (like an electron or nucleus) is a physical qubit. The Bloch sphere is its state space. Applying precise magnetic field pulses (B_x and B_z) allows engineers to perform quantum logic gates, rotating the qubit state to any point on the sphere to run algorithms.

Nuclear Magnetic Resonance (NMR) Spectroscopy: Chemists use NMR to determine the structure of molecules. Different atomic nuclei in a molecule experience slightly different magnetic fields, changing their precession frequency. By analyzing these frequency shifts, scientists can map out the molecule's 3D structure.

Atomic Clocks & Precision Sensing: The incredibly regular precession of spins in a stable magnetic field can be used as a timekeeping mechanism. Furthermore, tiny changes in the local magnetic field alter the precession frequency, making spin systems ultra-sensitive detectors for geological surveys and fundamental physics experiments.

Common Misconceptions and Points to Note

First, there's a common tendency to misinterpret points on the Bloch sphere as representing the "actual direction of the spin." Strictly speaking, they are a geometric representation of the "probability amplitude" of the quantum state (wave function). For example, a point on the sphere's equator does not mean the spin is pointing sideways; it represents a "maximum superposition state" with equal parts spin-up and spin-down. If you measure the z-component of spin in this state, you'll randomly get spin-up or spin-down with a probability of 1/2. When simulating in practical work, be careful not to confuse this "expectation value of a physical quantity obtained by measurement" with the "geometric representation of the state itself."

Next, a tip on parameter settings. When applying a transverse magnetic field B_x to observe Rabi oscillations, setting B_z to zero makes the oscillation period infinite (meaning no oscillation occurs). This is because the Hamiltonian becomes $H = -\gamma B_x S_x$ only, and the energy eigenstates are no longer superpositions of $|\uparrow\rangle$ and $|\downarrow\rangle$. For practical observation, the key is to set B_x sufficiently small compared to B_z (e.g., B_z=1.0, B_x=0.1), so that a small perturbation is added to the precession motion.

Finally, note that this simulator deals only with "pure states." In real experiments, spins often interact with their environment and become "mixed states." Mixed states are represented by points inside the Bloch sphere, lacking more information than the pure states on the sphere's surface. Even if you see beautiful precession in NovaSolver, in actual quantum devices, "relaxation times" come into play, causing the oscillations to gradually decay. Keep this gap between ideal and reality in mind.

How to Use

  1. Set the magnetic field B_z component (Tesla) using the slider; typical values range from 0.1 to 10 T for NMR applications
  2. Adjust B_x component to induce transverse field effects and observe precession axis rotation on the Bloch sphere
  3. Configure initial spherical angles θ (polar, 0 to π) and φ (azimuthal, 0 to 2π) to define your spin-1/2 state
  4. Monitor real-time output: expectation values ⟨S_x⟩, ⟨S_y⟩, ⟨S_z⟩ (in units of ℏ/2) and Larmor frequency ω_L in rad/s

Worked Example

Configure B_z = 5 T, B_x = 0 T, θ₀ = π/2, φ = 0. This creates an eigenstate of S_x with ⟨S_x⟩ = +ℏ/2 ≈ +0.527 × 10⁻³⁴ J·s. The Larmor frequency ω_L = γB_z where γ ≈ 2.675 × 10⁸ rad/(s·T) for electrons yields ω_L ≈ 1.338 × 10⁹ rad/s. Watch the state precess around the z-axis with period T = 2π/ω_L ≈ 4.7 ns. Increase B_x to 2 T and observe the precession axis tilt toward the x-direction, generating Rabi oscillations between spin-up and spin-down states.

Practical Notes

  1. For ESR (Electron Spin Resonance) at 9.5 GHz microwave frequency, solve B_z = ω/(2πγ) ≈ 0.34 T to achieve resonance conditions
  2. Pulses: Apply B_x resonantly for π/2 pulses (90° rotation, duration ~5 ns) to create superposition states; use π pulses for full inversion
  3. Decoherence: Real systems exhibit T₁ (spin-lattice) and T₂ (spin-spin) relaxation times; typical metals have T₂ ~ 10-100 μs, limiting observable precession cycles
  4. Field inhomogeneity: Spatial B-field variations (ΔB/B ~ 10⁻⁶) cause dephasing; compensate via composite pulses or field-locking techniques