OpenSpinDynamics.jl

OpenSpinDynamics.jl is a Julia package for simulating quantum spin dynamics in closed and open systems.

It provides:

  • sparse quantum spin-model construction
  • Krylov and Arnoldi time evolution
  • Lindblad master-equation dynamics
  • stochastic quantum trajectories
  • nearest-neighbor, long-range, and disordered couplings
  • common product-state initial conditions

Quick example

using OpenSpinDynamics

N = 4

coupling = NearestNeighborCoupling(0.0, N)

model = SpinModel(
    N;
    Jxy=1.0,
    Jz=1.0,
    coupling=coupling,
)

ψ0 = neel_state(N)

ops = spin_operators(N)

times = collect(
    range(0.0, 2.0; length=51)
)

result = evolve(
    model,
    ψ0,
    times,
    [ops.z[1]];
    method=:krylov,
)

size(result)
(51, 1)

This evolves a four-spin Néel state under a nearest-neighbor XXZ Hamiltonian and measures the local magnetization $\langle \sigma_1^z(t) \rangle$.

Open-system dynamics

The same SpinModel interface can be used for dissipative dynamics with Lindblad master equations or stochastic quantum trajectories.

For example, local spontaneous emission can be introduced through collapse operators

\[L_i = \sqrt{\gamma}\,\sigma_i^-.\]

See the worked examples for complete simulations and plots.

Documentation

Start with the Getting Started guide for an introduction to the package.

Examples

See the API Reference for the exported types and functions.