Internals
Lattice
CarteCoord
Cartesian coordinates. Vector{Float64}
.
FractCoord
Fractional 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 usingString
or tuple ofString
andInt
for 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π * reducedreciprocallatticevectors
orbitals ::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
carte2fract
Arguments
latticevectors ::AbstractArray{<:AbstractFloat, 2}
: square matrix whose columns are lattice vectors.cc ::CarteCoord
: cartesian coordinatestol ::Real=sqrt(eps(Float64))
: tolerance
carte2fract
Arguments
latticevectors ::Array{Float64, 2}
cc ::CarteCoord
HartreeFockBogoliubov.Lattice.dimension
— Method.dimension
Dimension of the fractional coordinates
Arguments
fc ::FractCoord
: Fractional coordinates.
HartreeFockBogoliubov.Lattice.dimension
— Method.dimension
Spatial dimension of the unit cell.
fract2carte
Arguments
latticevectors ::AbstractArray{<:AbstractFloat, 2}
: square matrix whose columns are lattice vectors.fc ::FractCoord
: fractional coordinates
fract2carte
Arguments
latticevectors ::Array{Float64, 2}
fc ::FractCoord
HartreeFockBogoliubov.Lattice.getorbital
— Method.getorbital
Arguments
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)
getorbitalcoord
Arguments
uc ::UnitCell
idx ::Integer
Return
fractcoord
getorbitalcoord
Get the fractional coordinates of the orbital with the given name.
Arguments
uc ::UnitCell{O}
name ::O
Return
fractcoord
getorbitalindex
Get index of the given orbital.
Arguments
uc ::UnitCell{O}
name ::O
getorbitalindexcoord
Arguments
uc ::UnitCell{T}
name ::T
Return
(index, fractcoord)
getorbitalname
Arguments
uc ::UnitCell
index ::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.momentumpath
Generate a list of momenta
Arguments
anchorpoints
- (Optional)
nseg
- number of points in each segment
UnitCell
Construct an n-dimensional lattice.
Arguments
latticevectors ::AbstractArray{<:AbstractFloat, 2}
: Lattice vectorsOrbitalType::DataType
Optional Arguments
tol=sqrt(eps(Float64))
: Epsilon
UnitCell
Construct a one-dimensional lattice.
Arguments
latticeconstant ::Float64
: Lattice constantOrbitalType
: List of orbitals
Optional Arguments
tol=sqrt(eps(Float64))
: Tolerance
momentumgrid
Generate an n-dimensional grid of momenta of given shape
momentumpath
The anchorpoints are given in units of the reciprocal lattice vectors.
HartreeFockBogoliubov.Lattice.numorbital
— Method.numorbital
Number of orbitals of the unit cell.
Arguments
uc ::UnitCell
whichunitcell
Return
R ::Vector{Int}
: which unit cell the specificied orbital/cartesian coordinates belongs to.
whichunitcell
Return
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.Hopping
HartreeFockBogoliubov.Spec.Interaction
— Constant.Interaction
FullHamiltonian
Members
unitcell ::UnitCell
hoppings ::Vector{Hopping}
interactions ::Vector{Interaction}
Hamiltonian
Create an empty Hamiltonian
Arguments
unitcell ::UnitCell
HoppingDiagonal{R<:Real}
Represents
Members
amplitude ::R
i ::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 ::C
i, j ::T
Ri, Rj ::Vector{Int}
InteractionDiagonal{R<:Real}
Represents
Members
amplitude ::R
i, j ::Int
Ri, 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 ::C
i, j, k, l ::Int
Ri, Rj, Rk, Rl ::Vector{Int}
HartreeFockBogoliubov.Spec.addhopping!
— Method.addhopping!
Arguments
hamiltonian ::Hamiltonian
hopping ::HoppingOffdiagonal
HartreeFockBogoliubov.Spec.addhopping!
— Method.addhopping!
Arguments
hamiltonian ::Hamiltonian
hopping ::HoppingDiagonal
addinteraction!
Arguments
hamiltonian ::Hamiltonian
interaction ::InteractionOffdiagonal
addinteraction!
Arguments
hamiltonian ::Hamiltonian
interaction ::InteractionDiagonal
hoppingbycarte{T}
Make a hopping element with cartesian coordinates.
Arguments
uc ::UnitCell{T}
amplitude ::Number
i ::T
j ::T
ri ::CarteCoord
rj ::CarteCoord
tol ::Real
: Optional. Defaults tosqrt(eps(Float64))
hoppingbycarte{T}
Make a hopping element with cartesian coordinates.
Arguments
uc ::UnitCell{T}
amplitude ::Real
i ::T
ri ::CarteCoord
tol ::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.islocal
Check if the hopping element is local (i.e. Ri is zero)
HartreeFockBogoliubov.Spec.localized
— Method.localized
Return a hopping element that is local (i.e. Ri is zero)
Generator
HartreeFockBogoliubov.Generator
— Module.Generator submodule
hopping_inplace
hopping_inplace
hopping_inplace
hopping_inplace
hopping_inplace
hopping_inplace
hopping_inplace
Topology
HartreeFockBogoliubov.Topology.squarify
— Method.squarify
Arguments
uc::Spec.FullHamiltonian{O}
HartreeFockBogoliubov.Topology.squarify
— Method.squarify
Arguments
uc::HFB.HFBHamiltonian{O}
HartreeFockBogoliubov.Topology.squarify
— Method.squarify
In 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}
chernnumber
Compute 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::AbstractMatrix
n1 ::Integer
n2 ::Integer
selectpairs::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.loop
Perform selfconsistency loop a number of times with the given precondition and given update functions.
Arguments
solver ::HFBSolver{T}
sol::HFBAmplitude
run::Integer
Optional Arguments
update::Function=simpleupdate
precondition::Function=identity
: on target fieldcallback::Function=_noop
: Function called after every update as
callback(i, run)
HartreeFockBogoliubov.HFB.loop_threaded
— Method.loop
Perform selfconsistency loop a number of times with the given precondition and given update functions.
Arguments
solver ::HFBSolver{T}
sf::HFBAmplitude
run::Integer
Optional Arguments
update::Function=simpleupdate
precondition::Function=identity
callback::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_greencollector
Returns 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 Δ = Γ⋅Δ