States

Lattice states in Schwinger.jl are represented by the abstract type SchwingerState, with four concrete types:

  • BasisState: a state specified by the eigenvalues of occupation operators $\chi^\dagger_{n,\alpha}\chi_{n,\alpha}$ and $L_0$
  • EDState: a linear combination of BasisStates
  • ITensorState: a matrix product state using ITensorMPS.jl
  • MPSKitState: a matrix product state using MPSKit.jl

Given a state, we can find the expectation values of the occupation operators and electric field operators:

using Schwinger
lat = Lattice(6; F = 1, a = 10) # towards the lattice strong coupling limit ga -> infty
gs = groundstate(Hamiltonian(lat; backend=:ED))

occupations(gs), electricfields(gs)
([0.9996009569748595; 0.0007976086592019167; … ; 0.9992023913407977; 0.0003990430251401046;;], [-0.0003990430251404886; 0.00039856563406142807; … ; -0.00039904302514120744; -1.1028504498522551e-15;;])

We can also evaluate the entanglement entropies of each bisection of the lattice:

using Schwinger
lat = Lattice(20; F = 1, )
gs = groundstate(Hamiltonian(lat; backend=:ITensors))
entanglements(gs)
19-element Vector{Float64}:
 0.5892661594332946
 0.39444995102389846
 0.5168663014805462
 0.4537304990970711
 0.4899161466432033
 0.4701048867712321
 0.4812980874019238
 0.47489337761178574
 0.4788497809441204
 0.47593806308555536
 0.4788497809439948
 0.47489337761172984
 0.48129808740185565
 0.47010488677116263
 0.48991614664313654
 0.45373049909698665
 0.5168663014802912
 0.39444995102368763
 0.5892661594332931

When using an infinite lattice with MPSKit, we can compute these quantities in the thermodynamic limit.

using Schwinger
lat = Lattice(Inf; F = 1, )
gs = groundstate(Hamiltonian(lat; backend=:MPSKit))
entanglements(gs)
2-element Vector{Float64}:
 0.4772745064264948
 0.4772745064225215

The two numbers here correspond to the two possible bisections of the two-site unit cell (corresponding to an odd and an site from the middle of a large finite lattice).

On an infinite lattice we can also probe the single-particle spectrum using the quasiparticle ansatz. For instance, at $m = 0$ the energy of the lightest quasiparticle will converge to the Schwinger boson mass $1/\sqrt{\pi} \approx 0.564$ as we take $a\to 0$:

using Schwinger
lat = Lattice(Inf; F = 1, a = 0.5, m = 0)
H = Hamiltonian(lat; backend = :MPSKit)
gs, qp = loweststates(H, 2)
real(energy(qp))   # quasiparticle mass, close to 1/√π
0.562055241749088

The quasiparticle ansatz is a momentum eigenstate. Passing a momentum (in units of the coupling $g$, like the rest of the code) to loweststates builds the excitation at nonzero momentum — a moving quasiparticle (only available on an infinite lattice). We can then use wavepacket to build a finite-width, spatially localized packet. Here we build a packet from a quasiparticle of momentum $p = 1.0\,g$, center it on the middle 16 sites of a 64-site window, and plot its energy density relative to the vacuum (dropping the two window-boundary sites, which carry edge artifacts):

using Plots, LaTeXStrings
qp_moving = loweststates(H, 2; momentum = 1.0)[2]
wp = wavepacket(qp_moving, 64; support = 25:40)
ed = real.(energy_densities(wp))
ed = ed .- ed[5]   # subtract the (uniform) far-field vacuum value
x = (1:64) .* lat.a   # physical position of each site
plot(x[2:63], ed[2:63]; xlabel = L"x", ylabel = "Energy density above vacuum",
     legend = false, title = "Quasiparticle wavepacket (m = 0, ag = 0.5, p = 1.0g)")
Example block output

Flavor multiplets

For $F \geq 2$ flavors of equal mass, the model has a global $SU(F)$ flavor symmetry, and its excitations organize into $SU(F)$ multiplets. Passing flavor_sym = true to Lattice gauges this symmetry into the MPS (on the MPSKit backend), which lets us label an excitation by its flavor irrep and target a chosen channel with the flavor_irrep keyword of loweststates. For two flavors, the mesons split into an $SU(2)$ singlet and a triplet (flavor_singlet and flavor_adjoint), and at $m/g = 1$ the triplet is the lighter one.

We can see the triplet without any knowledge of the symmetry: exact diagonalization represents the two flavors explicitly, yet the lowest excitation comes out three-fold degenerate — an isotriplet — sitting just below a non-degenerate isosinglet.

using Schwinger
N, m, a = 8, 1.0, 1.0

# ED knows nothing about SU(2); the flavors are separate sites
Eed = sort!([real(energy(s)) for s in
             loweststates(Hamiltonian(Lattice(N; F = 2, m = m, a = a); backend = :ED), 6)])
round.(Eed .- Eed[1]; digits = 6)   # gaps above the ground state
6-element Vector{Float64}:
 0.0
 2.179603
 2.179603
 2.179603
 2.220792
 2.220792

The first three gaps are equal: the lightest excitation is a triplet. Turning on flavor_sym lets us confirm this labelling directly. We target the adjoint (the $SU(2)$ triplet, an irrep of dimension three) and singlet channels separately with flavor_irrep; the triplet is lighter, and its energy matches the ED value.

latf = Lattice(N; F = 2, m = m, a = a, flavor_sym = true)
Hf = Hamiltonian(latf; backend = :MPSKit)

E_triplet = real(energy(loweststates(Hf, 2; flavor_irrep = flavor_adjoint(latf),
                                     energy_tol = 1e-10, bonddim = 24)[2]))
E_singlet = real(energy(loweststates(Hf, 2; flavor_irrep = flavor_singlet(latf),
                                     energy_tol = 1e-10, bonddim = 24)[2]))

(E_triplet = round(E_triplet - Eed[1]; digits = 6),
 E_singlet = round(E_singlet - Eed[1]; digits = 6),
 triplet_matches_ED = isapprox(E_triplet, Eed[2]; atol = 1e-5),
 triplet_lighter = E_triplet < E_singlet)
(E_triplet = 2.179603, E_singlet = 2.24419, triplet_matches_ED = true, triplet_lighter = true)

Several other useful functions are detailed below.

Schwinger.EDState — Type

EDState(hamiltonian, coeffs)

A Schwinger model state represented as a linear combination of basis states.

source
Schwinger.occupation — Function

occupation(state, site)

Return the expectations of χ†χ operators of each flavor on a given site.

Arguments

  • state::ITensorState: Schwinger model state.
  • site::Int: the lattice site.
source

occupation(state, site)

Return the expectations of χ†χ operators of each flavor on a given site.

Arguments

  • state::BasisState: Schwinger model basis state.
  • site::Int: the lattice site.
source

occupation(state, site)

Return the expectations of χ†χ operators of each flavor on a given site.

Arguments

  • state::EDState: Schwinger model basis state.
  • site::Int: the lattice site.
source
Schwinger.occupations — Function

occupations(state)

Return an NxF matrix of the expectations of χ†χ operators on each site.

Arguments

  • state::ITensorState: Schwinger model state.
source

occupations(state)

Return an NxF matrix of the expectations of χ†χ operators on each site.

Arguments

  • state::MPSKitState: Schwinger model state.
source

occupations(state)

Return an NxF matrix of the expectations of χ†χ operators on each site.

Arguments

  • state::BasisState: Schwinger model basis state.
source

occupations(state)

Return an NxF matrix of the expectations of χ†χ operators on each site.

Arguments

  • state::EDState: Schwinger model basis state.
source
Schwinger.charge — Function

charge(state, site)

Return the expectation value of the charge operator on site site.

Arguments

  • state::SchwingerState: Schwinger model state.
  • site::Int: site.
source
Schwinger.charges — Function

charges(state)

Return a list of the expectations of Q operators on each site.

Arguments

  • state::SchwingerState: Schwinger model state.
source
Schwinger.electricfield — Function

electricfield(state, link)

Return the expectation of (L + θ/2π) on the link link.

Arguments

  • state::SchwingerState: Schwinger model state.
  • link::Int: link.
source
Schwinger.electricfields — Function

electricfields(state)

Return a list of the expectations of (L + θ/2π) operators on each link.

Arguments

  • state::SchwingerState: Schwinger model state.
source
Schwinger.chargecurrents — Function

chargecurrents(state) / energycurrents(state)

The vector current j¹ on each bond (1..N-1) and the energy current 𝒥 on each interior site (2..N-1), as a profile over the lattice — observable convenience wrappers around the ChargeCurrent/EnergyCurrent operators. For F = 1 (no defects) chargecurrents measures the current as a local 2-site operator tensor via contract_mpo_expval2 (O(1) memory per bond, no full-length MPO built): this both avoids materialising the N−1 per-bond FiniteMPO operators for a 2-site observable (O(N²) memory) and lets it run on a wavepacket window (WindowMPS/FiniteMPS cut from an infinite background, e.g. an evolving soliton), where the per-bond FiniteMPO operator cannot be applied (expectation_value(ψ, mpo) would need a FiniteMPO * WindowMPS product MPSKit does not define). It matches the MPSKitChargeCurrent operator to machine precision. For F > 1/defects it falls back to the per-bond operator (finite lattice only). energycurrents on a window is not yet supported (its 𝒥_n = -i[b_n, b_{n-1}] is a 3-site operator).

source

chargecurrents(state::EDState) / chargecurrents(state::ITensorState)

The vector current j¹ on each bond 1..N-1, by looping the per-bond ChargeCurrent operator — the ED/ITensors companion of the MPSKit chargecurrents. Finite lattice only.

source
Schwinger.energycurrents — Function

energycurrents(state; pad = false)

The energy current 𝒥 = T⁰¹ on each interior site (2..N-1), as a profile over the lattice. See chargecurrents for the companion charge current.

For F = 1 (no defects) this measures 𝒥_n = -i[b_n, b_{n-1}] as a local 3-site contraction (_contract_mpo_expval3, O(1) memory / O(D³) per site) instead of building the N−1 full-length per-site FiniteMPO operators and contracting each over the whole chain (which was O(N²)). This both speeds up the finite-lattice profile dramatically and lets it run on a wavepacket window (WindowMPS/FiniteMPS), where the per-site FiniteMPO operator cannot be applied (no FiniteMPO * WindowMPS). It matches the MPSKitEnergyCurrent operator to machine precision. Requires mprime = 0 (as does the operator). For F > 1/defects it falls back to the per-site operator (finite lattice only).

𝒥 is only defined on interior sites, so by default this returns a length-N-2 vector (sites 2..N-1). Pass pad = true to instead get a site-aligned length-N vector with NaN at the two boundary sites — convenient for sweeping/plotting a detector across the whole lattice without manual range guards.

source

energycurrents(state::EDState) / energycurrents(state::ITensorState)

The energy current 𝒥 = T⁰¹ on each interior site 2..N-1, by looping the per-site EnergyCurrent operator — the ED/ITensors companion of the MPSKit energycurrents. Finite lattice only. Pass pad = true for a site-aligned length-N vector with NaN at the two boundary sites.

source
Schwinger.entanglement — Function

entanglement(state, bisection)

Return the von Neumann entanglement entropy -tr(ρₐ log(ρₐ)), where a is the subsystem of sites 1..bisection

Arguments

  • state::EDState: Schwinger model state.
  • bisection::Int: bisection index.
source

entanglement(state, bisection)

Return the von Neumann entanglement entropy -tr(ρₐ log(ρₐ)), where a is the subsystem of sites 1..bisection

Arguments

  • state::ITensorState: Schwinger model state.
  • bisection::Int: bisection index.
source

entanglement(state, bisection)

Return the von Neumann entanglement entropy -tr(ρₐ log(ρₐ)), where a is the subsystem of sites 1..bisection

Arguments

  • state::MPSKitState: Schwinger model state.
  • bisection::Int: bisection index.
source
Schwinger.entanglements — Function

entanglements(state)

Return a list of the von Neumann entanglement entropies for each bisection of the lattice.

Arguments

  • state::SchwingerState: Schwinger model state.
source
Schwinger.energy — Function

energy(state)

Return the expectation value of the Hamiltonian.

Arguments

  • state::SchwingerState: Schwinger model state (ED, MPS, or MPSKit).
source

energy(state)

Return the expectation value of the Hamiltonian.

Arguments

  • state::BasisState: Schwinger model basis state.
source
Schwinger.L₀ — Function

L₀(state)

Return the expectation value of L₀.

Arguments

  • state::SchwingerState: Schwinger model state.
source
Schwinger.scalar — Function

scalar(state)

Return the expectation value of the scalar condensate, ⟨H_mass⟩/L.

Arguments

  • state::SchwingerState: Schwinger model state.
source
Schwinger.scalardensity — Function

scalardensity(state, site)

Return the scalar density at site site.

Arguments

  • state::SchwingerState: Schwinger model state.
  • site::Int: site.
source
Schwinger.scalardensities — Function

scalardensities(state)

Return the list of scalar densities of state on sites 1 through N.

Arguments

  • state::SchwingerState: Schwinger model state.
  • site::Int: site.
source
Schwinger.pseudoscalar — Function

pseudoscalar(state)

Return the expectation value of the pseudoscalar condensate, ⟨H_hoppingmass⟩/L.

Arguments

  • state::SchwingerState: Schwinger model state.
source
Schwinger.pseudoscalardensity — Function

pseudoscalardensity(state, n)

Return the site-symmetrized staggered pseudoscalar density P_n = (1/a)·½(p(n) + p(n-1)) at site n, where p(ℓ) is the bare hopping-mass bond bilinear. See pseudoscalardensities for the exact operator and the caveat that j¹ = κ(−1)ⁿ·P does not give the vector current.

Arguments

  • state::SchwingerState: Schwinger model state.
  • n::Int: site.
source
Schwinger.pseudoscalardensities — Function

pseudoscalardensities(state)

Return the pseudoscalar density P = ⟨ψ̄ iγ⁵ψ⟩ on sites 1 … N.

Exact operator. This is the site-symmetrized staggered pseudoscalar: with p(n) the bare hopping-mass bilinear on bond n (HoppingMass(lattice, n; bare = true), which already carries the (-1)^n staggering), the value on site s is P_s = (1/a)·½(p(s) + p(s-1)) — the average of the two bonds flanking the site. (MPSKitState computes the identical quantity via a local bond contraction; see the pseudoscalardensities(::MPSKitState) method.)

The naive `j¹ = κ(−1)ⁿ · P` shortcut does NOT give the vector current

Because P_s is symmetrized across the two neighbouring bonds, multiplying it by the staggered sign (−1)^n does not reproduce the conserved vector current j¹ — it yields a bond difference instead. For the current use chargecurrents / ChargeCurrent, which are the un-symmetrized bond bilinears built to satisfy the continuity equation.

Arguments

  • state::SchwingerState: Schwinger model state.
source

pseudoscalardensities(state::MPSKitState)

The pseudoscalar density P = ⟨ψ̄ iγ⁵ψ⟩ on each site as a profile over the lattice. For F = 1 with no defects this uses a local 2-site contraction (contract_mpo_expval2, O(1) memory per bond) of the bare hopping-mass bilinear — the memory-light analogue of chargecurrents, avoiding the O(N²) memory of materialising the N per-site MPSKitHoppingMass operators. It matches the per-site pseudoscalardensity to machine precision, and works on a wavepacket window (WindowMPS) as well as a finite lattice. Otherwise it falls back to the generic per-site path.

On a WindowMPS, the two outermost sites miss the bond into the (infinite-vacuum) wing, which would leave them at half the true density; they are replaced with the wing's uniform vacuum pseudoscalar density so the profile connects smoothly to the background — mirroring _energy_densities_window.

This is the operator that appears in the explicit-mass term of the axial Ward identity, ∂μ j₅^μ = (q/π)E + q·mlat·P (lattice; continuum reading 2m·⟨ψ̄iγ⁵ψ⟩).

source
Schwinger.flavor_singlet — Function
flavor_singlet(lattice)

The SU(F) flavor-singlet irrep (for loweststates(...; flavor_irrep = flavor_singlet(lattice))).

source
Schwinger.flavor_adjoint — Function
flavor_adjoint(lattice)

The SU(F) adjoint irrep (dimension F²−1). Mesons decompose as fund ⊗ fund̄ = singlet ⊕ adjoint, so flavor_singlet and flavor_adjoint are the two meson flavor channels.

source