Example scripts
- For a detailed tutorial on how to use the package, check out these papers:
The following Python scripts demonstrate basic and advanced functionality of QuSpin. In many cases, we have chosen to exhibit QuSpin’s functionality, and there may exist a more efficient approach to obtain the same result using QuSpin.
To run the example scripts, besides QuSpin, you have to also install matplotlib (e.g. by using pip or anaconda):
Getting started
Parallel computing in QuSpin
Basic usage
Non-interacting systems
Quantised Light-Atom Interactions in the Semi-classical Limit: Recovering the Periodically Driven Atom,
download scriptFree Particle Systems: the Fermionic SSH Chain,
download scriptOptical Bloch equations: Lindblad dynamics using the matvec function,
download scriptThe Spectrum of the Transverse Field Ising Model and the Jordan-Wigner Transformation,
download script
Interacting systems
Fermi-Hubbard model without doubly-occupied sites,
download scriptHexagonal Lattice: Fermi-Hubbard model [courtesy of A. Buyskikh],
download scriptIntegrability Breaking and Thermalising Dynamics in the 2D Transverse-Field Ising Model,
download scriptMany-Body Localization in the Fermi-Hubbard Model,
download scriptAdiabatic Control of Parameters in Many-Body Localised Phases,
download scriptThe Bose-Hubbard Model on Translationally Invariant Ladder,
download script
Advanced usage
Quantum scars Hamiltonian: spin-1/2 system with Hilbert space constraint,
download scriptSpin-1/2 system with sublattice particle consevation,
download scriptApplying symmetries to reduce user-imported bases using QuSpin,
download scriptDirect Calculation of spectral functions using symmetries,
download scriptMajorana Fermions: Spinless Fermi-Hubbard Model,
download scriptKitaev’s honeycomb Hamiltonian in vortex sectors given by the plaquette operators,
download script
Algorithms and routines
Monte Carlo Sampling Expectation Values of Obsevables,
download scriptEfficient time evolution using the omp-parallelized expm_multiply_parallel,
download scriptLanczos module: time-evolution and ground state search,
download scriptLanczos module: finite-temperature calculations,
download scriptLiouville-von Neumann Equation using the MKL-enhanced Sparse Matrix Product [courtesy of J. Verlage],
download script