/ concept-collection / numbl-open-quantum-systems
Sign in
concept-collection / numbl-open-quantum-systems
numbl-open-quantum-systems / README.md
78 lines · 4.5 KBCodeBlameHistory
c33ae98Companion to 'Coding closed and open quantum systems in MATLAB' (arXiv:1911.04906)Jeremy Magland 1# Companion to Closed & Open Quantum Systems
3A companion to the tutorial article **"Coding closed and open quantum systems in
4MATLAB: applications in quantum optics and condensed matter"** by Ariel
5Norambuena, Diego Tancara, and Raúl Coto —
6[arXiv:1911.04906](https://arxiv.org/abs/1911.04906).
8The article presents MATLAB code for simulating many-body quantum systems:
9magnetization dynamics of the closed and open Ising model, a dynamical quantum
10phase transition in cavity-QED arrays, Markovian dynamics of interacting
11two-level systems, and the non-Markovian pure-dephasing spin-boson model. This
12project collects those programs as runnable [numbl](https://numbl.org) scripts
13so you can execute and edit them in your browser — no MATLAB, no install. Pick a
14script in the panel on the left and click **Run**. Edits stay in memory for your
15session.
17> This README is a guide to *which* program to open, not a replacement for the
18> article. Read the article for the physics, the equations, and the derivations;
19> come here to run the code. The scripts are reproduced **verbatim** from the
20> article's source (arXiv ancillary files) and run unmodified. The only
21> repackaging: the article presents Example 1 and Example 2 as a sequence of
22> code listings, which are concatenated here into single runnable
23> [`Example1.m`](Example1.m) and [`Example2.m`](Example2.m) files.
25## Closed quantum systems (article §2)
27| Script | Article | What it computes |
28| --- | --- | --- |
29| [`Example1.m`](Example1.m) | §2.1 | Magnetization dynamics of the closed two-spin Ising model via the time propagator `expm(-iHt)` |
30| [`IsingModelTransitionPhase_new.m`](IsingModelTransitionPhase_new.m) | §2.1 | Dynamical quantum phase transition of the Ising model (6 spins): rate function and magnetization |
31| [`CavityQEDTransitionPhase.m`](CavityQEDTransitionPhase.m) | §2.2 | Dynamical phase transition in a cavity-QED array — Jaynes–Cummings vs. Rabi (order parameter and rate function) |
33## Open quantum dynamics (article §3)
35| Script | Article | What it computes |
36| --- | --- | --- |
37| [`Example2.m`](Example2.m) | §3.1 | Markovian master equation for two interacting qubits (open Ising), solved by diagonalizing the Lindbladian |
38| [`TwoLevelSystemCoupledLight.m`](TwoLevelSystemCoupledLight.m) | §3.2 | A two-level atom coupled to a photon reservoir; numerical solution compared to the exact one |
39| [`NonMarkovianDynamicsPureDephasing.m`](NonMarkovianDynamicsPureDephasing.m) | §3.4 | Non-Markovian pure-dephasing spin-boson model: time-dependent rates, coherence, and a non-Markovianity measure |
41## Helper functions
43These are called by the scripts above; they are functions, not standalone
44programs, so there is nothing to "Run" directly.
46| File | Used by | Builds |
47| --- | --- | --- |
48| [`getSci.m`](getSci.m) | `IsingModelTransitionPhase_new.m` | the many-body Pauli operator on site *i* |
49| [`acav.m`](acav.m) | `CavityQEDTransitionPhase.m` | the cavity annihilation operator on site *i* |
50| [`sigmap.m`](sigmap.m) | `CavityQEDTransitionPhase.m` | the atomic raising operator on site *i* |
51| [`QuantumSimulationCavityArray.m`](QuantumSimulationCavityArray.m) | `CavityQEDTransitionPhase.m` | the Jaynes–Cummings/Rabi Hamiltonian, time evolution, and observables |
52| [`sortingEigenvalues.m`](sortingEigenvalues.m) | `Example2.m`, `TwoLevelSystemCoupledLight.m` | the sorted left/right eigenmatrices of the Lindbladian |
54## Notes
56- **Time evolution** of closed systems uses the matrix exponential
57 `U = expm(-1i*H*dt)`. **Open systems** are solved by diagonalizing the
58 Lindblad superoperator with `eig` and reconstructing the density matrix from
59 its eigenmodes (`sortingEigenvalues`).
60- `CavityQEDTransitionPhase.m` is the heaviest example — it sweeps 25 detunings
61 for two models with long time evolutions, so it takes a couple of minutes in
62 the browser. The others run in a few seconds.
63- The article uses `parfor` in the cavity-QED sweep; numbl runs it as an
64 ordinary (serial) loop, which gives the same result.
66## How it's deployed
68On every push to `main`, the workflow in
69[`.github/workflows/deploy.yml`](.github/workflows/deploy.yml) bundles these
70files with the numbl browser IDE and publishes the result to GitHub Pages — no
71server, nothing to build by hand. Edit `numbl-project.json` to change the title
72or which file opens first.
74## Reference
76Ariel Norambuena, Diego Tancara, Raúl Coto, *Coding closed and open quantum
77systems in MATLAB: applications in quantum optics and condensed matter*,
78[arXiv:1911.04906](https://arxiv.org/abs/1911.04906).
moveopenescclose