Internals
Lattice
CarteCoordCartesian coordinates. Vector{Float64}.
FractCoordFractional coordinates.
Members
whole ::Vector{Int}: Integer part of fractional coordinatesfraction ::Vector{Float64}: [0,1) part of fractional coordinates
UnitCell{O}Parameters
O: type of "orbital". Any type can be used, but we recommend usingStringor tuple ofStringandIntfor compatibility with JSON.
Members
latticevectors ::Array{Float64, 2}: Lattice vectorsreducedreciprocallatticevectors ::Array{Float64, 2}: Reduced reciprocal lattice vectors (transpose of inverse oflatticevectors)reciprocallatticevectors ::Array{Float64, 2}: Reciprocal lattice vectors.2π * reducedreciprocallatticevectorsorbitals ::Vector{Tuple{T, FractCoord}}: List of orbitals within unit cellorbitalindices ::Dict{T, Int}: Indices of orbitals
addorbital!Add an orbital to the unit cell.
Arguments
uc ::UnitCell{T}orbitalname ::{T}orbitalcoord ::FractCoord
carte2fractArguments
latticevectors ::AbstractArray{<:AbstractFloat, 2}: square matrix whose columns are lattice vectors.cc ::CarteCoord: cartesian coordinatestol ::Real=sqrt(eps(Float64)): tolerance
carte2fractArguments
latticevectors ::Array{Float64, 2}cc ::CarteCoord
HartreeFockBogoliubov.Lattice.dimension — Method.dimensionDimension of the fractional coordinates
Arguments
fc ::FractCoord: Fractional coordinates.
HartreeFockBogoliubov.Lattice.dimension — Method.dimensionSpatial dimension of the unit cell.
fract2carteArguments
latticevectors ::AbstractArray{<:AbstractFloat, 2}: square matrix whose columns are lattice vectors.fc ::FractCoord: fractional coordinates
fract2carteArguments
latticevectors ::Array{Float64, 2}fc ::FractCoord
HartreeFockBogoliubov.Lattice.getorbital — Method.getorbitalArguments
uc ::UnitCell{T}index ::Integer
Return
(orbitalname, fractcoord)
HartreeFockBogoliubov.Lattice.getorbital — Method.getorbital
Get the orbital (its orbital name and its fractional coordinates) with the given name.Arguments
uc ::UnitCell{O}name ::O
Return
(orbitalname, fractcoord)
getorbitalcoordArguments
uc ::UnitCellidx ::Integer
Return
fractcoord
getorbitalcoord
Get the fractional coordinates of the orbital with the given name.Arguments
uc ::UnitCell{O}name ::O
Return
fractcoord
getorbitalindexGet index of the given orbital.
Arguments
uc ::UnitCell{O}name ::O
getorbitalindexcoordArguments
uc ::UnitCell{T}name ::T
Return
(index, fractcoord)
getorbitalnameArguments
uc ::UnitCellindex ::Integer
Return
orbitalname
HartreeFockBogoliubov.Lattice.hasorbital — Method.hasorbital{T}Test whether the unit cell contains the orbital of given name.
Arguments
uc ::UnitCell{O}name ::O
HartreeFockBogoliubov.Lattice.linpath — Method.momentumpathGenerate a list of momenta
Arguments
anchorpoints- (Optional)
nseg- number of points in each segment
UnitCellConstruct an n-dimensional lattice.
Arguments
latticevectors ::AbstractArray{<:AbstractFloat, 2}: Lattice vectorsOrbitalType::DataType
Optional Arguments
tol=sqrt(eps(Float64)): Epsilon
UnitCellConstruct a one-dimensional lattice.
Arguments
latticeconstant ::Float64: Lattice constantOrbitalType: List of orbitals
Optional Arguments
tol=sqrt(eps(Float64)): Tolerance
momentumgridGenerate an n-dimensional grid of momenta of given shape
momentumpathThe anchorpoints are given in units of the reciprocal lattice vectors.
HartreeFockBogoliubov.Lattice.numorbital — Method.numorbitalNumber of orbitals of the unit cell.
Arguments
uc ::UnitCell
whichunitcellReturn
R ::Vector{Int}: which unit cell the specificied orbital/cartesian coordinates belongs to.
whichunitcellReturn
R ::Vector{Int}: which unit cell the specificied orbital/cartesian coordinates belongs to.
Base.isapprox — Method.isapprox(x, y; rtol::Real=atol>0 ? 0 : √eps, atol::Real=0, nans::Bool=false, norm::Function)Spec
HartreeFockBogoliubov.Spec — Module.Submodule `Spec`HartreeFockBogoliubov.Spec.Hopping — Constant.HoppingHartreeFockBogoliubov.Spec.Interaction — Constant.InteractionFullHamiltonianMembers
unitcell ::UnitCellhoppings ::Vector{Hopping}interactions ::Vector{Interaction}
HamiltonianCreate an empty Hamiltonian
Arguments
unitcell ::UnitCell
HoppingDiagonal{R<:Real}Represents
Members
amplitude ::Ri ::Int: index of orbitalRi ::Vector{Int}: which unit cell? (indexed by a1, and a2)
HoppingOffdiagonal{C<:Number}Represents
t, i, j and the unitcell-coordinates Ri and Rj are stored. Require that (i, Ri) <= (j, Rj)
Members
amplitude ::Ci, j ::TRi, Rj ::Vector{Int}
InteractionDiagonal{R<:Real}Represents
Members
amplitude ::Ri, j ::IntRi, Rj ::Vector{Int}
InteractionOffdiagonal{C<:Number}
i < j, k < l, i < k or (i == k and j < l)Represents
Only keep the first term (and require i < j, k < l, i <= k)
Ordering of orbitals by (i, Ri)
Members
amplitude ::Ci, j, k, l ::IntRi, Rj, Rk, Rl ::Vector{Int}
HartreeFockBogoliubov.Spec.addhopping! — Method.addhopping!Arguments
hamiltonian ::Hamiltonianhopping ::HoppingOffdiagonal
HartreeFockBogoliubov.Spec.addhopping! — Method.addhopping!Arguments
hamiltonian ::Hamiltonianhopping ::HoppingDiagonal
addinteraction!Arguments
hamiltonian ::Hamiltonianinteraction ::InteractionOffdiagonal
addinteraction!Arguments
hamiltonian ::Hamiltonianinteraction ::InteractionDiagonal
hoppingbycarte{T}Make a hopping element with cartesian coordinates.
Arguments
uc ::UnitCell{T}amplitude ::Numberi ::Tj ::Tri ::CarteCoordrj ::CarteCoordtol ::Real: Optional. Defaults tosqrt(eps(Float64))
hoppingbycarte{T}Make a hopping element with cartesian coordinates.
Arguments
uc ::UnitCell{T}amplitude ::Reali ::Tri ::CarteCoordtol ::Real: Optional. Defaults tosqrt(eps(Float64))
interactionbycarte{T}Make an interaction element with cartesian coordinates.
Arguments
* `uc ::UnitCell{T}`
* `amplitude ::Number`
* `i ::T`
* `j ::T`
* `k ::T`
* `l ::T`
* `ri ::CarteCoord`
* `rj ::CarteCoord`
* `rk ::CarteCoord`
* `rl ::CarteCoord`
* `tol ::Real` : Optional. Defaults to `sqrt(eps(Float64))`interactionbycarte{T}Make an interaction element with cartesian coordinates.
Arguments
* `uc ::UnitCell{T}`
* `amplitude ::Number`
* `i ::T`
* `j ::T`
* `ri ::CarteCoord`
* `rj ::CarteCoord`
* `tol ::Real` : Optional. Defaults to `sqrt(eps(Float64))`HartreeFockBogoliubov.Spec.islocal — Method.islocalCheck if the hopping element is local (i.e. Ri is zero)
HartreeFockBogoliubov.Spec.localized — Method.localizedReturn a hopping element that is local (i.e. Ri is zero)
Generator
HartreeFockBogoliubov.Generator — Module.Generator submodule
hopping_inplacehopping_inplacehopping_inplacehopping_inplacehopping_inplacehopping_inplacehopping_inplaceTopology
HartreeFockBogoliubov.Topology.squarify — Method.squarifyArguments
uc::Spec.FullHamiltonian{O}
HartreeFockBogoliubov.Topology.squarify — Method.squarifyArguments
uc::HFB.HFBHamiltonian{O}
HartreeFockBogoliubov.Topology.squarify — Method.squarifyIn order to make the Hamiltoinian a periodic function of momentum, bring all the sites to the origin. In addition, make the unitcell into a square.
Arguments
uc::Lattice.UnitCell{O}
chernnumberCompute chern number of the band structure defined by the hoppings and the selected bands.
HartreeFockBogoliubov.Topology.z2index — Method.z2index
Compute Z₂ index of time-reversal-invariant Hamiltonian.
Arguments
uc::UnitCell{O}hops::AbstractVector{Hopping}timereversal::AbstractMatrixn1 ::Integern2 ::Integerselectpairs::AbstractVector{<:Integer}
Optional Arguments
tol ::Real = sqrt(eps(Float64))
Returns
(The Z2 index, max| Hₖ - T⁻¹HₖT | for k in TRIMs)
HFB
HFBConmputer is a type holding the ρ, t and Γ, Δ of a Hartree-Fock-Bogoliubov Hamiltonian.
HartreeFockBogoliubov.HFB.HFBComputer — Method.HartreeFockBogoliubov.HFB.HFBHamiltonian — Method.HartreeFockBogoliubov.HFB.HFBHamiltonian — Method.HartreeFockBogoliubov.HFB.HFBSolver — Method.Add offdiagonal interaction
addinteraction!Add diagonal interaction
Compute Γ and Δ from ρ and t.
HartreeFockBogoliubov.HFB.isvalid — Method.HartreeFockBogoliubov.HFB.isvalid — Method.HartreeFockBogoliubov.HFB.loop — Method.loopPerform selfconsistency loop a number of times with the given precondition and given update functions.
Arguments
solver ::HFBSolver{T}sol::HFBAmplituderun::Integer
Optional Arguments
update::Function=simpleupdateprecondition::Function=identity: on target fieldcallback::Function=_noop: Function called after every update as
callback(i, run)
HartreeFockBogoliubov.HFB.loop_threaded — Method.loopPerform selfconsistency loop a number of times with the given precondition and given update functions.
Arguments
solver ::HFBSolver{T}sf::HFBAmplituderun::Integer
Optional Arguments
update::Function=simpleupdateprecondition::Function=identitycallback::Function=_noop: Function called after every update as
callback(i, run)
Return a generator of Δ matrix (which is a function of momentum)
Return a generator of Γ matrix (which is a function of momentum)
make_greencollectorReturns a function which has the following signature
collector(k, eigenvalues, eigenvectors, ρout, tout)func : (idx, i, j, r) -> val
func : (idx, i, j, r) -> 0
Check if hint contains ρHartreeFockBogoliubov.HFB.make_hfbfield — Method.Compute Γ and Δ from ρ and t.
HartreeFockBogoliubov.HFB.make_hfbfield — Method.Compute Γ and Δ from ρ and t.
HartreeFockBogoliubov.HFB.make_hint — Method.Return a generator of hopping matrix (which is a function of momentum)
HartreeFockBogoliubov.HFB.randomize! — Method.Randomize a hfbamplitude
CollectRow is holds info on how to compute ρ or t. Its elements are:
- Is diagonal? (only for rho)
- row orbital
- col orbital
- displacement r(col) - r(row)
DeployRow is holds info on how to compute Γ or Δ. Its elements are:
- Is diagonal
- row orbital
- col orbital
- displacement r(col) - r(row)
- list of sources, each of which is a tuple of
- index of ρ or t from which to compute this Γ or Δ.
- amplitude (coefficient to multiply to ρ or t)
- boolean indicating whether (1) conjugation is needed (for ρ/Γ) or (2) minus sign is needed (for t/Δ).
HartreeFockBogoliubov.HFB.next_hfbfield — Method.LinearizedGap
linearizedpairingkernel
Compute the kernel Γ of the linearized gap equation in the pairing channel which is written as Δ = Γ⋅Δ