This repository contains a Python-based simulation of Schrödinger’s cat, a famous quantum mechanics thought experiment, using the QuTiP library.
The simulation visualizes the quantum superposition of a cat being alive and dead in phase space via the Wigner function, showcasing:
- Coherent evolution
- Decoherence
- Wave function collapse
Erwin Schrödinger’s 1935 thought experiment illustrates the paradoxical nature of quantum superposition when applied to macroscopic objects:
- A cat is sealed in a box with a radioactive atom, a Geiger counter, and a vial of poison.
- If the atom decays (50% probability), the poison is released → the cat dies.
- Until observed, quantum mechanics suggests the cat exists in a superposition of alive and dead.
This simulation models a quantum analog of the cat state using a coherent state superposition in a harmonic oscillator, visualized through the Wigner function in phase space.
It demonstrates:
- Coherent evolution under a Kerr Hamiltonian → twisting interference patterns
- Decoherence due to environmental interactions → fading quantum interference
- Interactive collapse via key press → mimicking measurement
The simulation is based on a quantum harmonic oscillator with Hilbert space dimension:
The Schrödinger cat state is a superposition of two coherent states:
where
The corresponding density matrix is:
The Wigner function
- Two Gaussian peaks → “Alive” (
$x \approx 2$ ) and “Dead” ($x \approx -2$ ) - Interference fringes → signature of quantum superposition
Decomposition of the Wigner function:
where:
-
$W_\alpha(x,p)$ = Wigner function of$|\alpha\rangle$ -
$W_{-\alpha}(x,p)$ = Wigner function of$|-\alpha\rangle$ -
$W_\text{interf}(x,p)$ = interference term $\mathcal{N}^2 = 2(1 + e^{-2|\alpha|^2})$
The state evolves under a Kerr Hamiltonian:
- Non-linear shearing causes interference fringes to twist into spirals
- Gaussian blobs distort in phase space
After resetting to
- No Hamiltonian applied (
$H = 0$ ) - Interference fringes fade away, leaving stationary blobs
- System resembles a classical mixture:
Pressing “o” collapses the wave function to:
The plot updates with a single labeled blob: Alive or Dead.
-
t = 0 → 2 (Static Display): Two blobs (“Alive” at
$x \approx 2$ , “Dead” at$x \approx -2$ ) with straight interference fringes. -
t = 2 → 10 (Coherent Evolution): Kerr Hamiltonian twists fringes into spirals, blobs distort.
-
t = 10 → 20 (Decoherence): Fringes fade, blobs remain stationary → classical mixture.
-
Collapse (press “o”): Single blob remains, labeled Alive or Dead.
- Copenhagen: Collapse occurs on measurement (“o” key)
- Decoherence: Environmental interaction destroys interference (phase 2)
- Other views: Many-Worlds, Bohmian Mechanics, QBism also consistent but not explicitly modeled
The following timeline summarizes key milestones in quantum mechanics, highlighting contributions directly relevant to Schrödinger’s Cat (🐱) and tools used in modern simulations like the one described above (🛠️).
| Relevance | Year | Figure | Contribution |
|---|---|---|---|
| 1900 | Planck | Quantum Hypothesis ("Revolutionary against his will") | |
| 1905 | Einstein | Photoelectric Effect (light as quanta) | |
| 1913 | Bohr | Atomic Model (quantized orbits) | |
| 1925 | Heisenberg | Matrix Mechanics (observables, not orbits) | |
| 🐱🛠️ | 1926 | Schrödinger | Wave Mechanics (wavefunction dynamics) |
| 🐱 | 1926 | Born | Probabilistic Interpretation (wavefunction → probability) |
| 🐱 | 1927 | Bohr/Heisenberg | Copenhagen Interpretation (measurement & observer) |
| 1928 | Dirac | Uniting QM with special relativity (prediction of antimatter) | |
| 🐱 | 1932 | von Neumann | Mathematical Foundations (axioms, measurement theory) |
| 🐱🛠️ | 1932 | Wigner | Phase-space interpretation (Wigner function, quasi-probabilities) |
| 🐱 | 1935 | Einstein-Podolsky-Rosen | EPR Paradox (QM works, but is it complete? — still debated) |
| 🐱 | 1935 | Schrödinger | Schrödinger’s Cat (paradox of superposition) |
| 🐱🛠️ | 1970 | Zeh | Decoherence Theory (quantum-classical transition) |
| 🐱🛠️ | 1980s–2003 | Zurek | Decoherence and Quantum-Classical Transition (pointer states) |
Legend:
- 🐱: Directly relevant to Schrödinger’s Cat (superposition, measurement, entanglement).
- 🛠️: Relevant as a tool for modern simulations (e.g., wave mechanics, Wigner function, or decoherence used in QuTiP visualizations).
-
N. Lambert et al., QuTiP 5: The Quantum Toolbox in Python, arXiv:2412.04705 (December 6, 2024). https://arxiv.org/abs/2412.04705
-
QuTiP: https://qutip.org
-
Schrödinger, E. (1980). The present situation in quantum mechanics. (J. D. Trimmer, Trans.).
Proceedings of the American Philosophical Society, 124(5), 323–338. (Original work published 1935) -
Wigner, E. P. (1932). On the quantum correction for thermodynamic equilibrium. Phys. Rev., 40, 749–759.
-
Zeh, H. D. (1970). On the Interpretation of Measurement in Quantum Theory. Foundations of Physics 1, 69–76.
-
Zurek, W. H. (2003). Decoherence and the Transition from Quantum to Classical. arXiv:quant-ph/0306072v1. https://doi.org/10.48550/arXiv.quant-ph/0306072
-
Becker R. (2025). Seeing Quantum Weirdness. Medium.
https://medium.com/@ratwolf/seeing-quantum-weirdness-e977d97a3214
A: This is a visualization effect to highlight the transition, not a physical change. The darker red results from the color scaling (vmin and vmax based on the maximum absolute Wigner value), which emphasizes the remaining amplitude after interference fades.
A: In the simulation, amplitude damping with gamma = 0.05 may cause a slight contraction or shift of the initial coherent states toward the origin due to energy loss, a physical decoherence effect. In reality, this effect might be much smaller, depending on the physical system's decoherence rate.
A: Yes, the sparse fringes reflect the Wigner function’s quantum interference for alpha = 2.0. Adjust alpha or grid size (x, p) in the parameters to explore.
A: With 200 timesteps over 20 units, dt (~0.1) is sufficient. Increase timesteps for higher precision
A: In this simulation, amplitude damping is the default decoherence model, implemented with a collapse operator (c_ops_decoherence) and a damping rate of gamma = 0.05. However, you can modify c_ops_decoherence in the code to include other decoherence models, such as dephasing, to explore different dynamics.
A: Yes, QuTiP’s wigner ensures normalization. The vmin and vmax in contourf capture the full range—see the plotting section.
A: Pressing 'o' randomly selects a pure state (psi1 or psi2), simulating measurement per the Copenhagen interpretation.
A: Yes, increase N (currently 30) or x, p grid (currently 130) in the parameters, though it may slow performance.