A sandbox for exploring QuTiP (Quantum Toolbox in Python) — installation, canonical examples, and a "hello world" exercise.
python3.13 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python -c "import qutip; qutip.about()"Requires Python ≥ 3.10 (QuTiP 5).
The pip package ships no runnable example scripts (official examples live as notebooks in qutip-tutorials), so this script adapts three canonical examples from the QuTiP 5 docs:
- Basics — states, operators, expectation values (verifies ⟨n⟩ = |α|² for a coherent state)
- Dissipative qubit dynamics — the docs' front-page
mesolveexample - Driven damped cavity — steady-state Lorentzian response via
steadystate
.venv/bin/python scripts/run_examples.pyRabi oscillations of a driven qubit. This is the natural QuTiP hello world because it is the smallest simulation that exercises the library's whole core workflow:
build a Hamiltonian → evolve a state (sesolve/mesolve) → measure observables (expect) → visualize (Bloch)
It is also self-verifying: the ideal evolution has the closed form ⟨σz⟩(t) = cos(Ωt), and the script asserts the numerical result matches to <1e-4 (observed error ~1.6e-5). It then adds T1 amplitude damping to show the oscillations decohere — the regime where you actually need a numerical toolbox.
.venv/bin/python scripts/hello_qutip.pyOutputs in output/:
hello-rabi-oscillations.png— ⟨σz⟩(t): ideal vs analytic vs dampedhello-bloch-sphere.png— the damped trajectory spiraling into the Bloch sphere
Implements the published model from Gassab, Pusuluk & Craddock, Quantum Information Flow in Microtubule Tryptophan Networks:
- extracts the eight Trp chromophores from
data/1JFF.pdb - uses the CD2/CE2 midpoint and 46.2 degree in-plane Trp 1La transition-dipole convention used by the cited microtubule construction work
- builds the coherent dipole coupling matrix
Deltaand collective decay matrixGfrom Eqs. 9-10 - diagonalizes
H_eff = H0 + Delta - iG/2 - evolves superradiant, subradiant, coherent, mixed, and localized preparations with a trace-preserving Lindblad equation in the single-excitation-plus-ground space
- computes site populations, pair
L1coherence, correlated coherence helpers, logarithmic negativity, mutual information helpers, and trace-distance backflow helpers
.venv/bin/python scripts/run_microtubule_qif.py
.venv/bin/python -m pytest -q tests/test_model_measures.pyOutputs in output/microtubule-qif/:
sites.csv,matrices.npz,modes.csv,summary.jsonspectrum.pngdynamics-{superradiant,subradiant,coherent,mixed}.pnglocalized-injections.png
Larger ordered assemblies can be built for spectral analysis:
.venv/bin/python scripts/run_microtubule_qif.py --assembly one-spiral --skip-dynamics
.venv/bin/python scripts/run_microtubule_qif.py --static-disorder-cm 200 --skip-dynamicsThe paper's exact molecular-dynamics structural-disorder ensemble and author code are not bundled with the arXiv source, so this repo implements the ordered 1JFF reconstruction plus parameterized static disorder and random positional/dipole jitter. See docs/paper-2602.02868/implementation-notes.md and docs/paper-2602.02868/reproduction-gap-report.md.
The static walkthrough UI is docs/paper-2602.02868/ui/index.html; it can be opened directly in a browser and uses the generated plots in output/microtubule-qif/.
Verified with QuTiP 5.3.0, NumPy 1.26.4, SciPy 1.17.1, matplotlib 3.11.0 on Python 3.13.2 (macOS arm64, Accelerate BLAS).