Free fermions API
Public names of the FreeFermions submodule. See Non-interacting systems for how to use them.
FermionicHilbertSpaces.FreeFermionsFermionicHilbertSpaces.FreeFermions.BdGFermionicHilbertSpaces.FreeFermions.BdGEigenFermionicHilbertSpaces.FreeFermions.NambuStateFermionicHilbertSpaces.FreeFermions.SingleParticleFermionicHilbertSpaces.FreeFermions.SingleParticleStateFermionicHilbertSpaces.FreeFermions.correlation_matrixFermionicHilbertSpaces.FreeFermions.correlation_matrixFermionicHilbertSpaces.FreeFermions.gaussian_stateFermionicHilbertSpaces.FreeFermions.ground_state_parityFermionicHilbertSpaces.FreeFermions.ground_state_parityFermionicHilbertSpaces.FreeFermions.mean_fieldFermionicHilbertSpaces.FreeFermions.quasiparticleFermionicHilbertSpaces.FreeFermions.symbolic_operator
FermionicHilbertSpaces.FreeFermions — Module
FreeFermionsHilbert spaces and tools for non-interacting fermions: the single-particle space hilbert_space(f, labels, SingleParticle()), the Bogoliubov-de Gennes space hilbert_space(f, labels, BdG()), the Majorana space hilbert_space(γ, labels, SingleParticle()), their eigendecomposition and Gaussian states.
FermionicHilbertSpaces.FreeFermions.BdG — Type
BdG()Marker passed as the last argument of hilbert_space(f, labels, BdG()) to select the Bogoliubov-de Gennes (Nambu) space of non-interacting fermions with superconducting pairing.
FermionicHilbertSpaces.FreeFermions.BdGEigen — Type
BdGEigen(cutoff = nothing)Algorithm for eigen(A, BdGEigen()) on a Hermitian BdG matrix A with N modes, giving sorted eigenvalues and orthonormal eigenvectors. Columns k and 2N + 1 - k are particle-hole partners with eigenvalues e and -e, and a column [u; v] is the quasiparticle Σᵢ u[i] f[i]' + v[i] f[i]. Eigenvalues below cutoff (relative, default 2N * eps) are set to zero.
H = hilbert_space(f, 1:2, BdG())vals, vecs = eigen(representation(f[1]' * f[2] + f[1]' * f[2]' + hc, H, :dense), BdGEigen()) # vals ≈ [-1, 0, 0, 1]FermionicHilbertSpaces.FreeFermions.NambuState — Type
NambuState(i, hole::Bool)A basis state of the BdG space: the hole (hole = true) or particle component of the mode at position i.
FermionicHilbertSpaces.FreeFermions.SingleParticle — Type
SingleParticle()Marker passed as the last argument of hilbert_space(f, labels, SingleParticle()) to select the single-particle space of non-interacting fermions with number conservation.
FermionicHilbertSpaces.FreeFermions.SingleParticleState — Type
SingleParticleState(i)A basis state of the SingleParticle space: one fermion in the mode at position i.
FermionicHilbertSpaces.FreeFermions.correlation_matrix — Method
correlation_matrix(state, H, Hbdg::BdGHilbertSpace)The Nambu correlation matrix G[i, j] = ⟨Ψ_i' Ψ_j⟩ of a normalized state vector or density matrix state on H.
Here Ψ = (f; f') lists the annihilation and then the creation operators of the modes of Hbdg in its order. expectation(op, G, Hbdg) then gives ⟨op⟩. A BdG space over a subset of the modes gives the reduced correlation matrix. On a Majorana space hilbert_space(γ, labels, SingleParticle()), Ψ = γ / √2, so G[i, j] = ⟨γ_i γ_j⟩ / 2.
julia> using FermionicHilbertSpaces, FermionicHilbertSpaces.FreeFermions; @fermions f;julia> H = hilbert_space(f, 1:2);julia> ψ = [0, 1, 0, 0]; # f[1]' acting on the vacuumjulia> correlation_matrix(ψ, H, hilbert_space(f, 1:2, BdG()))4×4 Matrix{Int64}: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1FermionicHilbertSpaces.FreeFermions.correlation_matrix — Method
correlation_matrix(F::LinearAlgebra.Eigen)The Nambu correlation matrix G[i, j] = ⟨Ψ_i' Ψ_j⟩ of the BdG ground state, where F is the result of eigen(A, BdGEigen()), assuming no zero-energy modes. It equals correlation_matrix(ψ, H, Hbdg) for the many-body ground state ψ. For the matrix R of a Majorana operator, F = eigen(Hermitian(R)) gives G[i, j] = ⟨γ_i γ_j⟩ / 2.
julia> using FermionicHilbertSpaces, FermionicHilbertSpaces.FreeFermions, LinearAlgebra; @fermions f;julia> A = representation(-f[1]' * f[1], hilbert_space(f, 1:1, BdG()), :dense);julia> correlation_matrix(eigen(A, BdGEigen())) ≈ [1 0; 0 0]trueFermionicHilbertSpaces.FreeFermions.gaussian_state — Method
gaussian_state(G, H, Hbdg::BdGHilbertSpace)The density matrix on the many-body space H of the Gaussian state with Nambu correlation matrix G, so that correlation_matrix(gaussian_state(G, H, Hbdg), H, Hbdg) ≈ G. H must have exactly the modes of Hbdg.
julia> using FermionicHilbertSpaces, FermionicHilbertSpaces.FreeFermions; @fermions f;julia> G = [1 0 0 0; 0 0 0 0; 0 0 0 0; 0 0 0 1]; # f[1] occupied, f[2] emptyjulia> gaussian_state(G, hilbert_space(f, 1:2), hilbert_space(f, 1:2, BdG())) ≈ [0 0 0 0; 0 1 0 0; 0 0 0 0; 0 0 0 0]trueFermionicHilbertSpaces.FreeFermions.ground_state_parity — Method
ground_state_parity(F::LinearAlgebra.Eigen, H)The fermionic parity of the ground state of a quadratic Majorana operator with matrix R on the Majorana space H, where F = eigen(Hermitian(R)), assuming no zero-energy modes. Fermions are formed from consecutive pairs of labels.
FermionicHilbertSpaces.FreeFermions.ground_state_parity — Method
ground_state_parity(F::LinearAlgebra.Eigen)The fermionic parity, 1 or -1, of the BdG ground state, where F is the result of eigen(A, BdGEigen()), assuming no zero-energy modes. It equals the parity of the many-body ground state.
julia> using FermionicHilbertSpaces, FermionicHilbertSpaces.FreeFermions, LinearAlgebra; @fermions f;julia> A = representation(-f[1]' * f[1], hilbert_space(f, 1:1, BdG()), :dense);julia> ground_state_parity(eigen(A, BdGEigen()))-1FermionicHilbertSpaces.FreeFermions.mean_field — Method
mean_field(op, G, H; projection = false)Return the mean-field operator of op in the Gaussian state with correlation matrix G on the single-particle or BdG space H (see expectation). Every product in op is replaced by its part of order at most two in the fluctuations x - ⟨x⟩ (the Hartree, Fock and pairing terms), so the result is of degree at most two and has the same expectation value as op in the state. projection is as in expectation.
@fermions fH = hilbert_space(f, 1:2, SingleParticle())mean_field(f[1]' * f[1] * f[2]' * f[2], [0.5 0; 0 0.25], H) # 0.25 f[1]' f[1] + 0.5 f[2]' f[2] - 0.125FermionicHilbertSpaces.FreeFermions.quasiparticle — Method
quasiparticle(v, H)The quasiparticle creation operator for the single-particle vector v on H.
On a BdG space with N modes it is γ' = Σ_n (v[n] * f[n]' + v[n+N] * f[n]), on a SingleParticle space γ' = Σ_n v[n] * f[n]', and on a Majorana space Σ_n v[n] * γ[n] / √2.
@fermions fH = hilbert_space(f, 1:2, BdG())quasiparticle([1, 0, 0, 1], H) # f[2] + f†[1]FermionicHilbertSpaces.FreeFermions.symbolic_operator — Method
symbolic_operator(M, H)The symbolic operator op with representation(op, H) == M, for a BdG matrix M on a BdG space, an antisymmetric matrix on a Majorana space, or any matrix on a SingleParticle space. On a BdG or Majorana space, op is traceless.
@fermions fH = hilbert_space(f, 1:2, BdG())symbolic_operator(representation(f[1]' * f[1], H, :dense), H) # -0.5I + f†[1]*f[1]