Toolkit
Smearing Function
MatterEnv.gaussian
— Functiongaussian(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)$.
MatterEnv.lorentzian
— Functionlorentzian(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]$
Generate DOS
MatterEnv.generate_dos
— Functiongenerate_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 bandskpoints::Array{KPoint, 1}
: metadata of k-pointssmear::Function=gaussian
: smearing function, default: Gaussian smearenergy_number::Integer=10000
: number of energy points, default 10000
Returns
dos::DOS
: metadata of dos
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 bandskpoints::Array{KPoint, 1}
: metadata of k-pointssmear::Function=gaussian
: smearing function, default: Gaussian smearenergy_number::Integer=10000
: number of energy points, default 10000
Returns
dos1::DOS
: metadata of dos of spin updos2::DOS
: metadata of dos of spin down
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 bandskpoints::Array{KPoint, 1}
: metadata of k-pointsprojection::Projection
: metadata of projectionsmear::Function=gaussian
: smearing function, default: Gaussian smearenergy_number::Integer=10000
: number of energy points, default 10000ions::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing
: index of ions which wavefunction is projected toorbits::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing
: index of orbitss which wavefunction is projected to
Returns
pdos::DOS
: metadata of projected dos
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 bandskpoints::Array{KPoint, 1}
: metadata of k-pointsprojection::ProjectionWithSpin
: metadata of projectionsmear::Function=gaussian
: smearing function, default: Gaussian smearenergy_number::Integer=10000
: number of energy points, default 10000ions::Union{Array{<:Integer, 1}, UnitRange{<:Integer}, Nothing}=nothing
: index of ions which wavefunction is projected toorbits::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 uppdos2::DOS
: metadata of projected dos of spin down
Energy Shift
MatterEnv.shift_energy!
— Functionshift_energy!(band::Band, energy::Real)
Shift the energy value of band with given energy value.
Arguments
band::Band
: metadata of bandenergy::Real
: shift value
shift_energy!(bands::Bands, energy::Real)
Shift the energy value of all bands with given energy value.
Arguments
bands::Bands
: metadata of bandenergy::Real
: shift value
shift_energy!(bands::BandsWithSpin, energy::Real)
Shift the energy value of all bands with given energy value.
Arguments
bands::BandsWithSpin
: metadata of bandenergy::Real
: shift value
Orbit
MatterEnv.projection_transformation!
— Functionprojection_transformation!(projection::Projection,
transfer_matrix::Matrix{<:Number}...;
orbit::Symbol=:d)
Linear transformation of projection ⟨Yₗₘ|ϕₙₖ⟩.
Arguments
projection::Projection
: projection of wavefunctiontransfer_matrix::Matrix{<:Number}...
: transformation matrix M1, M2 ...orbit::Symbol=:d
: orbits to be considered in transformation, default d orbits
projection_transformation!(projection::ProjectionWithSpin,
transfer_matrix::Matrix{<:Number}...;
orbit::Symbol=:d)
Linear transformation of projection ⟨Yₗₘ|ϕₙₖ⟩.
Arguments
projection::ProjectionWithSpin
: projection of wavefunctiontransfer_matrix::Matrix{<:Number}...
: transformation matrix M1, M2 ...orbit::Symbol=:d
: orbits to be considered in transformation, default d orbits
Projection
MatterEnv.distinguish_spin
— Functiondistinguish_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 magnetizationprojection_axis::Projection
: projected magnetization in x, y or z axisbands::Bands
: metadata of bands
Returnss
ProjectionWithSpin
: projection of spin up and spin downBandsWithSpin
: metadata of bands of spin up and spin down
MatterEnv.get_projection_sign
— Functionget_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
MatterEnv.apply_projection_sign
— Functionapply_projection_sign(projection::Projection, sign_matrix::Array{<:Real, 4})
Applied sign of projection to projection.
Arguments
projection::Projection
: projection of wavefunctionsign_matrix::Array{Integer, 4}
: sign returned from getprojectionsign function
Returns
Projection
: new projection