A Julia module for constructing and solving Bogoliubov-de Gennes (BdG) Hamiltonians on 2D tight-binding lattices. Designed for studying superconducting systems, Josephson junctions, and Yu-Shiba-Rusinov (YSR) states from magnetic impurities.
- BdG Hamiltonian construction on arbitrary
n x mlattices with configurable boundary conditions - Self-consistent order parameter calculation via iterative diagonalization
- Magnetic impurity models for YSR states (single-site, star-shaped, and square-shaped geometries)
- Josephson junction analysis with current-phase relation computation
- Complex boundary conditions support for extended Hamiltonian studies
- Julia (tested on 1.x)
LinearAlgebra(stdlib)ProgressLoggingBenchmarkTools(examples only)Makie(visualization only)
include("src/BdGTools.jl")
using .BdGTools
# Define a 20x10 lattice with a Josephson junction (weak link of half-width 2)
s = Setup(20, 10, 1.0, -1.0, 0.0, 0.1, 0.0, false, true, 2)
# n m t U0 μ0 Δ0 ϵ0 pbc_x pbc_y L
# Build the BdG Hamiltonian
H = H_BdG(s.n, s.m, s.t, s.µ, s.ϵ, s.Δ, pbc_x=s.pbc_x, pbc_y=s.pbc_y)
# Run self-consistent calculation
β = 10.0 # inverse temperature
Δ_sc = get_self_consistent(s.n, s.m, s.t, s.µ, s.µ0, s.ϵ, s.Δ, s.U, s.pbc_x, s.pbc_y, β)julia test/runtests.jl| File | Description |
|---|---|
src/BdGTools.jl |
Main module and Setup struct |
src/lattice.jl |
Adjacency matrices (Ad1D, Ad2D), block_diagonal, Kronecker product ⊗ |
src/hamiltonian.jl |
H_block, T_block, H_BdG — Hamiltonian construction |
src/selfconsistency.jl |
update_H!, calc_Δ, get_self_consistent |
src/impurity.jl |
Magnetic impurity models and YSR Hamiltonians |
src/current.jl |
fermi_dirac, bond current Jᵢⱼ, supercurrent calculation |
src/josephson.jl |
Current-phase relations, phase/step profiles |
src/boundaryconditions.jl |
Complex boundary condition extensions |
src/visualization.jl |
matshow heatmap visualization (requires Makie) |
The Hamiltonian is built in the Nambu particle-hole basis [u↑, v↓], where each lattice site i maps to matrix indices 2i-1 (particle) and 2i (hole). On-site blocks take the form:
H_block = [ 4t + ϵ - μ Δ ]
[ conj(Δ) -4t - ϵ + μ ]
The full Hamiltonian is assembled via Kronecker products of adjacency matrices with hopping blocks, plus a block-diagonal of on-site terms.
All rights reserved.