Dispersions.jl

This project contains

Description

Common Functions

The following functions are available for all grids.

Basic access functions

Convenience functions to access fields of k grid structs.

Dispersions.KGridType
KGrid{T <: KGridType, D}

Fields

  • Nk : Int, Number of total k-points
  • Ns : Int, Number of sampling points per dimension
  • t : Float64, hopping parameter
  • tp : Float64, hopping parameter, next nearest neighbor
  • tpp : Float64, hopping parameter, next next nearest neighbor
  • kGrid : Vector{NTuple{D,Float64}}, vector of k-points. Each element is a D-tuple
  • ϵkGrid : Vector{Float64}, Dispersion relation
  • kInd : Vector{NTuple{D,Int}}, vector of indices mapping from the full to reduced lattice.
  • kInd_conv : Vector{NTuple{D,Int}}, vector of indices mapping from the full to reduced lattice after convolution (this incorporates possible reorderings).
  • kInd_crossc : Vector{NTuple{D,Int}}, vector of indices mapping from the full to reduced lattice after crosscorrelation (this incorporates possible reorderings).
  • kMult : Vector{Int}, multiplicity per k-point in reduced lattice
  • expand_perms : Vector{NTuple{D, Int}}, mapping of each k-point in reduced lattice to full lattice points
  • expand_cache : Array{ComplexF64}, internal cache for expansion of reduced to full lattice before executing convolutions
  • conv_cache : Array{ComplexF64,D}, innternal cache for convolutions
  • fftw_plan : FFTW.cFFTWPlan, fft plan to be executed in convolutions. WARNING: This field can not be serialized right now and needs to be reconstructed after reading a KGrid from disk.
source
Dispersions.NkMethod
Nk(kG::T) where T <: KGrid

Total number of k points (length of kGrid.kGrid for full grids).

source
Dispersions.conv!Method
conv!(kG::KGrid, res::AbstractVector{ComplexF64}, arr1::AbstractVector{ComplexF64}, arr2::AbstractVector{ComplexF64})

Inplace version of conv. The results are written to res.

source
Dispersions.convMethod
conv(kG::KGrid, arr1::AbstractVector{ComplexF64}, arr2::AbstractVector{ComplexF64})

Computes the convolution with a plus sign of data over two arrays arr1 and arr2, i.e. $res[k] = \sum_{q \in \text{BZ}} arr1[k] * arr2[k+q]$.

crosscorrelation sets the sign of the 'convolution' to +, i.e. $\sum_j f_i g_{i+j}$ instead of $\sum_j f_i g_{i-j}$.

source
Dispersions.conv_fft!Method
conv_fft!(kG::KGrid, res::AbstractVector{ComplexF64}, arr1::AbstractVector{ComplexF64}, arr2::AbstractVector{ComplexF64})

Inplace version of conv_fft.

source
Dispersions.conv_fftMethod
conv_fft(kG::KGrid, res::AbstractVector{ComplexF64}, arr1::AbstractVector{ComplexF64}, arr2::AbstractVector{ComplexF64})

Version of conv for precomputed arr1 and arr2. Note, that reversing arr2 is also expected, see also conv_fft1, if crosscorrelation = true is assumed.

source
Dispersions.conv_fft1!Method
conv_fft1!(kG::KGrid, res::AbstractVector{ComplexF64}, arr1::AbstractVector{ComplexF64}, arr2::AbstractVector{ComplexF64})

Inplace version of conv_fft1.

source
Dispersions.conv_fft1Method
conv_fft1(kG::KGrid, res::AbstractVector{ComplexF64}, arr1::AbstractVector{ComplexF64}, arr2::AbstractVector{ComplexF64})

Version of conv for precomputed arr2. Note, that reversing the array is also expected, i.e. arr2 = fft(reverse(in_arr2)), if crosscorrelation = true is assumed.

source
Dispersions.conv_post!Method
conv_post!(kG::KGrid{cP,D}, res::Array{T,1}, x::Array{T,D}) where {D,T}

Inplace version of conv_post. Warning: res should not alias kG.cache2 as some implementations may use this cache without explicitly checking for pointer aliases.

source
Dispersions.conv_postMethod
conv_post(kG::KGrid, x::Array{T,D})

Post convolution steps e.g. reversing or shifting the result. Some lattice types may overload this, depending on the sample points. See cP.jl for an example. crosscorrelation sets the sign for the convolution. See also conv

source
Dispersions.conv_post_add!Method
conv_post_add!(kG::KGrid{cP,D}, res::Array{T,1}, x::Array{T,D}) where {D,T}

Inplace version of conv_post, but add values instead of replacing them. Warning: res should not alias kG.cache2 as some implementations may use this cache without explicitly checking for pointer aliases.

source
Dispersions.conv_sample_postMethod
conv_sample_post(kG::KGrid{cP,D}, x)

This is needed in case the sampling is not starting at 0, i.e. [0,V) × [0,V) ... in order to shift the 0 frequency to the appropriate sampling point.

source
Dispersions.expandKArrMethod
expandKArr(kGrid::KGrid, arr)

Takes a kGrid kGrid and arbitrary data arr over a reduced BZ and returns an array with data over full BZ. This is mainly used before convolutions, since they require data over the full BZ.

source
Dispersions.findnearestMethod
findnearest(p, A::AbstractArray) = findmin(map(vi -> norm(vi .- p),A))

Finds nearest sampling point in grid A to point p.

source
Dispersions.gen_kGridMethod
gen_kGrid(kG::String, Ns::Int)

Generates a KGrid of type and hopping strength, given in kG with Ns sampling points in the first Brillouin zone. Options are:

  • '3dcP-...' : simple cubic 3D
  • '2dcP-...' : simple cubic 2D
  • '2dcP-...-...-...' : simple cubic 2D with next-next nearest neighbor hopping
  • 'cF-...' : FCC
  • 'cI-...' : BCC

Examples

julia> gen_kGrid("3dcP-1.5", 10)
cP(t=1.5) grid in 3 dimensions with 1000 k-points.
source
Dispersions.gridPointsMethod
gridPoints(kG::T)::Int where T <: KGrid

k vektors for the given grid. Elements of the irreducible part only.

source
Dispersions.grid_dimensionMethod
grid_dimension(kG::KGrid)

Maps the given grid onto its dimension.

Returns:

D : Int, dimension of the reciprocal lattice space.

source
Dispersions.grid_typeMethod
grid_type(kG::KGrid)

Maps the given grid onto its KGridType without the number of dimensions.

Returns:

type : KGridType, type of the reciprocal lattice space, e.g. cP.

source
Dispersions.map_to_indicesMethod
map_to_indices(path::AbstractVector, grid::AbstractArray, kG::KGrid)

Finds indices for points along path for reduced k-grid. Also returns residual values for points, i.e. norm of distance vector between point on path and point in grid.

source
Dispersions.map_to_indicesMethod
map_to_indices(path::AbstractVector, grid::AbstractArray)

Maps vectors in the given input array path to indices in the given k-grid grid. This is used internally, to construct indices for symmetry paths.

source
Dispersions.map_to_indices_fullMethod
map_to_indices_full(path::AbstractVector, grid::AbstractArray)

Finds indices for points along path. Also returns residual values for points, i.e. norm of distance vector between point on path and point in grid.

source
Dispersions.reduceKArrMethod
reduceKArr(kGrid::KGrid, arr)

Takes a kGrid kGrid and arbitrary data arr over a full BZ and returns an array with data over fully irreducible BZ. This is mainly used after convolutions, since they require data over the full BZ.

source
Dispersions.reverseKArrMethod
reverseKArr(kGrid::KGrid, arr)

Takes a kGrid kGrid and arbitrary data arr over a reduced OR full BZ and returns an array with reversed k-indices. I.e., $\f_q \to f_{-q}$.

source
Dispersions.sample_along_pathMethod
sample_along_path(data::AbstractArray, path::AbstractVector, kG::KGrid)

Sample data from reduced grid kG along path. Returns data and residual values (Vector of distances between points along path and sample points used).

source
Dispersions.ϵ_k_plus_qMethod
ϵ_k_plus_q(kG::KGrid, q::NTuple)

Evaluates the dispersion relation on the given reciprocal space but expanded and shifted by a constant vector `q`. The corresponding points in reciprocal space are given by `expandKArr(kG, gridPoints(kG))`.

Returns:

`\epsilon(k+\mathrm{shift}):Vector{NTuple{D,Float64}}`, where D is the diemenion of the grid. Dispersion relation evaluated on the given grid but shifted by the the vector q.

ATTENTION: So far this function is tested for the simple cubic lattice only!

Arguments:

  • kG : reciprocal lattice
  • q : vector in reciprocal space
source