Tutorials Overview

LatticeQM provides a sequence of Jupyter notebooks in extra/tutorial/ that walk through progressively more advanced workflows. Each documentation page in this section mirrors a notebook, highlighting the learning goals, main API calls, and checkpoints to verify that results look sensible.

Running the notebooks

  1. Launch Julia in the project environment:
    julia --project=.
    using Pkg; Pkg.instantiate()
  2. Start Jupyter (or VS Code) with the instantiated environment:
    using IJulia; notebook(dir="extra/tutorial")
  3. Execute cells in order. When a tutorial saves artefacts (plots, HDF5 files, logs), they appear alongside the notebook or within its output/ subfolder.

If you prefer a headless run to validate the notebooks, you can automate notebook execution with a simple Julia script and review the generated artefacts.

Tutorial roadmap

#TopicNotebookHighlightsNotes
1Structure & GeometryTutorial1_Structure.ipynbBuild lattices from scratch, explore predefined geometries, render 2D layouts.Establishes terminology used throughout the docs.
2Band StructuresTutorial2_Bands.ipynbConstruct graphene Hamiltonians, sample Brillouin-zone paths, plot band dispersions.Reuses geometries from Tutorial 1.
3Haldane Model & TopologyTutorial3_Haldane.ipynbAdd topological mass terms, compute Chern numbers, visualise edge modes.Introduces topology utilities.
4Twisted Bilayer GrapheneTutorial4_Twisted.ipynbBuild large moiré lattices, compare continuum and lattice approaches, manage memory footprint.Tutorial4_Twisted2/3 capture experimental variations—treat their outputs as provisional until revalidated.
5Hofstadter ButterflyTutorial5_Hofstadter.ipynbThread magnetic flux, generate Hofstadter spectra, analyse fractal band structures.Heavy k-point sampling; expect longer runtimes.
6Mean-field Self-ConsistencyTutorial6_Meanfield.ipynbRun Hartree–Fock loops, inspect convergence metrics, export density matrices.Shares utilities with extra/examples/graphene/hubbardmeanfield_*.
7Floquet DynamicsTutorial7_Floquet.ipynbConstruct time-periodic drives, compute quasienergy spectra, monitor resonances.Builds on modules co-authored with Tobias Kästli.
8Superconductivity (BdG)Tutorial8_Superconductivity.ipynbBuild Bogoliubov–de Gennes Hamiltonians, solve mean-field pairing self-consistently, inspect Nambu spectra.Reuses the Hartree–Fock infrastructure from Tutorial 6.

For background reading and additional implementation details, cross-reference the Concept Guides and the repository examples under extra/examples/.