Hamiltonian
The Hamiltonian for the lattice Schwinger model is
\[\begin{split} H = &\frac{(qg)^2 a}{2}\sum_{n=1}^N \left(L_n + \frac{\theta}{2\pi}\right)^2 - \frac{i}{2a}\sum_{n=1}^N\sum_{\alpha=1}^F \left(\chi^\dagger_{n,\alpha} \chi_{n+1,\alpha} - \chi^\dagger_{n+1,\alpha} \chi_{n,\alpha}\right) \\ &+\underbrace{\left(m - \frac{(qg)^2 F a}{8}\right)}_{m_\text{lat}}\sum_{n=1}^N \sum_{\alpha=1}^F (-1)^n \chi^\dagger_{n,\alpha} \chi_{n,\alpha} + m' \sum_{n=1}^N\sum_{\alpha=1}^F (-1)^{n+1}\left(\chi^\dagger_{n-1,\alpha}\chi_{n,\alpha} + \chi^\dagger_{n+1,\alpha}\chi_{n,\alpha}\right) \end{split}\]
This is supplemented by the Gauss law
\[L_n = L_{n-1} + Q_n, \qquad Q_n \equiv q\left(\sum_{\alpha=1}^F \chi^\dagger_{n,\alpha} \chi_{n,\alpha} - \begin{cases} F & n\text{ odd} \\ 0 & n\text{ even} \end{cases}\right).\]
In Schwinger.jl, the Hamiltonian can be constructed using three computational backends:
- Exact Diagonalization (ED): Uses sparse matrices for small systems
- ITensors: Uses MPO/MPS via ITensors.jl and ITensorMPS.jl
- MPSKit: Uses MPO/MPS via MPSKit.jl
Unified API
The unified API allows you to construct operators using any backend by specifying the backend keyword argument:
# Using symbols
H = Hamiltonian(lattice; backend=:ED)
H = Hamiltonian(lattice; backend=:ITensors) # Default
H = Hamiltonian(lattice; backend=:MPSKit)
# Using backend types directly
H = Hamiltonian(lattice; backend=EDBackend())
H = Hamiltonian(lattice; backend=ITensorsBackend())
H = Hamiltonian(lattice; backend=MPSKitBackend())You can also set a default backend programmatically:
set_default_backend(:MPSKit)
H = Hamiltonian(lattice) # Now uses MPSKit by defaultExact diagonalization
When using exact diagonalization, Schwinger.jl constructs a basis of states that diagonalize the operators $\chi^\dagger_{n,\alpha} \chi_{n,\alpha}$ and $L_0$. It then builds a sparse matrix for the Hamiltonian acting on this basis.
using Schwinger
lat = Lattice(12; F = 1);
ham = Hamiltonian(lat; backend=:ED);
ham.matrix924×924 SparseArrays.SparseMatrixCSC{ComplexF64, Int64} with 6468 stored entries:
⎡⢻⣶⣄⢠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎤
⎢⠀⣙⠻⣦⡙⢦⡀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠈⠳⣌⠿⣧⡦⡀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠈⠈⠫⣻⣾⣄⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠠⣄⠀⠀⠙⠻⣦⣄⠀⠀⠙⠦⠀⠀⠀⠀⠀⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠈⠳⣄⠀⠀⠙⡻⣮⡢⡀⢀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠈⠪⢿⣷⡀⠱⢄⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠈⠃⠀⠐⢄⡈⠻⣦⣄⠓⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢤⠙⡻⣮⡢⡀⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠪⢿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣷⡢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠈⠪⡻⣮⣄⠓⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⢤⠙⠻⣦⡈⠑⠄⠀⢠⡀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠑⢆⠈⢿⣷⡢⡀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠁⠈⠪⡻⣮⣄⠀⠀⠙⢦⡀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠀⠀⠀⠀⠀⠲⣄⠀⠀⠙⠻⣦⣄⠀⠀⠙⠂⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠙⡿⣯⣢⡀⡀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠈⠺⢻⣶⡙⢦⡀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠈⠳⣌⠻⣦⣍⠀⎥
⎣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠃⠙⠿⣧⎦You can also use the backend-specific constructor EDHamiltonian for backward compatibility.
When $q > 1$, the universe (i.e., the allowed values of $L_n$ modulo $q$) can be specified; the default value is 0. When the lattice is periodic, the maximum absolute value of $L_0$ can be set using L_max; the default value is 3.
Using Arpack.jl, Schwinger.jl can find the lowest eigenstates of a Hamiltonian.
using Schwinger
lat = Lattice(10; F = 1, periodic = true);
ham = Hamiltonian(lat; backend=:ED);
map(energy, loweststates(ham, 5))5-element Vector{Float64}:
-1.9903699416046092
-1.4257050000651357
-1.1927317764793883
-1.1927317764793888
-0.903954948059417Schwinger.EDHamiltonian — Function
EDHamiltonian(lattice) Computes the Hamiltonian for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.EDGaugeKinetic — Function
EDGaugeKinetic(lattice) Computes the gauge kinetic operator ∑(Lₙ+θ/2π)² for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.EDHopping — Function
EDHopping(lattice) Computes the hopping term -i ∑(χ†ₙ χₙ₊₁ - χ†ₙ₊₁ χₙ) for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.EDMass — Function
EDMass(lattice) Computes the mass operator ∑ (-1)ⁿ χ†ₙχₙ for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.EDHoppingMass — Function
EDHoppingMass(lattice) Computes the hopping-type mass term i/2 ∑(-1)^n (χ†ₙ₊₁ χₙ + χ†ₙ₋₁ χₙ) for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Matrix product operators
For larger lattice sizes where exact diagonalization is infeasible, Schwinger.jl can construct a matrix product operator representation of the Hamiltonian using two backends:
- ITensors: Uses
ITensors.jlandITensorMPS.jl - MPSKit: Uses
MPSKit.jl
using Schwinger
lat = Lattice(10; F = 1);
# Compare energy gaps across backends
[
energygap(Hamiltonian(lat; backend=:ED)),
energygap(Hamiltonian(lat; backend=:ITensors)),
energygap(Hamiltonian(lat; backend=:MPSKit))
]3-element Vector{Float64}:
0.6204350201341655
0.6204350207929119
0.6204350201341642ITensors Backend
Schwinger.ITensorHamiltonian — Function
MPOHamiltonian(lattice)
Computes the MPO Hamiltonian for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.ITensorGaugeKinetic — Function
MPOGaugeKinetic(lattice)
Computes the MPO gauge kinetic operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.ITensorHopping — Function
MPOHopping(lattice)
Computes the MPO hopping operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.ITensorMass — Function
MPOMass(lattice)
Computes the MPO mass operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.ITensorHoppingMass — Function
MPOHoppingMass(lattice)
Computes the MPO hopping-mass operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
MPSKit Backend
Schwinger.MPSKitHamiltonian — Function
MPSKitHamiltonian(lattice)
Computes the MPSKit Hamiltonian for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.MPSKitGaugeKinetic — Function
MPSKitGaugeKinetic(lattice)
Computes the MPSKit gauge kinetic operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.MPSKitHopping — Function
MPSKitHopping(lattice)
Computes the MPSKit hopping operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.MPSKitMass — Function
MPSKitMass(lattice)
Computes the MPSKit mass operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.
Schwinger.MPSKitHoppingMass — Function
MPSKitHoppingMass(lattice)
Computes the MPSKit hopping-mass operator for the Schwinger model.
Arguments
lattice::Lattice: Schwinger model lattice.