Toolkit

Smearing Function

MatterEnv.gaussianFunction
gaussian(x::Real, x₀::Real; σ::Real = 0.05)

PDF of Gaussian distribution: $g(x, x_0; \sigma)=\frac{1}{\sigma \sqrt{2 \pi}} \exp \left(-\frac{1}{2}\frac{(x-x_0)^{2}}{\sigma^{2}}\right)$.

source
MatterEnv.lorentzianFunction
lorentzian(x::Real, x₀::Real; γ::Real = 0.03)

PDF of Cauchy-Lorentz distribution: $f\left(x, x_{0}; \gamma\right) =\frac{1}{\pi \gamma} \left[\frac{\gamma^{2}}{\left(x-x_{0}\right)^{2}+\gamma^{2}}\right]$

source

Generate DOS

MatterEnv.generate_dosFunction
generate_dos(bands::Bands, kpoints::Array{KPoint, 1};
    smear::Function=gaussian, energy_number::Integer=10000)

Generate electronic density of states using bands and kpoints.

Arguments

  • bands::Bands: metadata of bands
  • kpoints::Array{KPoint, 1}: metadata of k-points
  • smear::Function=gaussian: smearing function, default: Gaussian smear
  • energy_number::Integer=10000: number of energy points, default 10000

Returns

  • dos::DOS: metadata of dos
source
generate_dos(bands::BandsWithSpin, kpoints::Array{KPoint, 1};
    smear::Function=gaussian, energy_number::Integer=10000)

Generate electronic density of states using bands and kpoints.

Arguments

  • bands::BandsWithSpin: metadata of bands
  • kpoints::Array{KPoint, 1}: metadata of k-points
  • smear::Function=gaussian: smearing function, default: Gaussian smear
  • energy_number::Integer=10000: number of energy points, default 10000

Returns

  • dos1::DOS: metadata of dos of spin up
  • dos2::DOS: metadata of dos of spin down
source
generate_dos(bands::Bands, kpoints::Array{KPoint, 1},
    projection::Projection;
    smear::Function=gaussian, energy_number::Integer=10000,
    ions::Array{Integer, 1}=nothing, orbits::Array{Integer, 1}=nothing)

Generate projected electronic density of states using bands and kpoints.

Arguments

  • bands::Bands: metadata of bands
  • kpoints::Array{KPoint, 1}: metadata of k-points
  • projection::Projection: metadata of projection
  • smear::Function=gaussian: smearing function, default: Gaussian smear
  • energy_number::Integer=10000: number of energy points, default 10000
  • ions::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing: index of ions which wavefunction is projected to
  • orbits::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing: index of orbitss which wavefunction is projected to

Returns

  • pdos::DOS: metadata of projected dos
source
generate_dos(bands::Bands, kpoints::Array{KPoint, 1},
    projection::Projection;
    smear::Function=gaussian, energy_number::Integer=10000,
    ions::Array{Integer, 1}=nothing, orbits::Array{Integer, 1}=nothing)

Generate projected electronic density of states using bands and kpoints.

Arguments

  • bands::BandsWithSpin: metadata of bands
  • kpoints::Array{KPoint, 1}: metadata of k-points
  • projection::ProjectionWithSpin: metadata of projection
  • smear::Function=gaussian: smearing function, default: Gaussian smear
  • energy_number::Integer=10000: number of energy points, default 10000
  • ions::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing: index of ions which wavefunction is projected to
  • orbits::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing: index of orbitss which wavefunction is projected to

Returns

  • pdos1::DOS: metadata of projected dos of spin up
  • pdos2::DOS: metadata of projected dos of spin down
source

Energy Shift

MatterEnv.shift_energy!Function
shift_energy!(band::Band, energy::Real)

Shift the energy value of band with given energy value.

Arguments

  • band::Band: metadata of band
  • energy::Real: shift value
source
shift_energy!(bands::Bands, energy::Real)

Shift the energy value of all bands with given energy value.

Arguments

  • bands::Bands: metadata of band
  • energy::Real: shift value
source
shift_energy!(bands::BandsWithSpin, energy::Real)

Shift the energy value of all bands with given energy value.

Arguments

  • bands::BandsWithSpin: metadata of band
  • energy::Real: shift value
source

Orbit

MatterEnv.projection_transformation!Function
projection_transformation!(projection::Projection,
    transfer_matrix::Matrix{<:Number}...;
    orbit::Symbol=:d)

Linear transformation of projection ⟨Yₗₘ|ϕₙₖ⟩.

Arguments

  • projection::Projection: projection of wavefunction
  • transfer_matrix::Matrix{<:Number}...: transformation matrix M1, M2 ...
  • orbit::Symbol=:d: orbits to be considered in transformation, default d orbits
source
projection_transformation!(projection::ProjectionWithSpin,
    transfer_matrix::Matrix{<:Number}...;
    orbit::Symbol=:d)

Linear transformation of projection ⟨Yₗₘ|ϕₙₖ⟩.

Arguments

  • projection::ProjectionWithSpin: projection of wavefunction
  • transfer_matrix::Matrix{<:Number}...: transformation matrix M1, M2 ...
  • orbit::Symbol=:d: orbits to be considered in transformation, default d orbits
source

Projection

MatterEnv.distinguish_spinFunction
distinguish_spin(projection_all::Projection,
    projection_axis::Projection,
    bands::Bands)

Distinguish projection of spin up and spin down. (Used in projection loaded from PROCAR)

Arguments

  • projection_all::Projection: total projected magnetization
  • projection_axis::Projection: projected magnetization in x, y or z axis
  • bands::Bands: metadata of bands

Returnss

  • ProjectionWithSpin: projection of spin up and spin down
  • BandsWithSpin: metadata of bands of spin up and spin down
source
MatterEnv.get_projection_signFunction
get_projection_sign(projection::Projection)

Applied sign function to squared projection

Arguments

  • projection::Projection: projection of wavefunction

Returns

  • Array{Float, 4}: sign of each squared projection
source
MatterEnv.apply_projection_signFunction
apply_projection_sign(projection::Projection, sign_matrix::Array{<:Real, 4})

Applied sign of projection to projection.

Arguments

  • projection::Projection: projection of wavefunction
  • sign_matrix::Array{Integer, 4}: sign returned from getprojectionsign function

Returns

  • Projection: new projection
source