Skip to content

Commit

Permalink
single component for direct minimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
epolack committed May 2, 2023
1 parent e5c2841 commit c617130
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scf/direct_minimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ function direct_minimization(basis::PlaneWaveBasis{T}, ψ0;
model = basis.model
@assert iszero(model.temperature) # temperature is not yet supported
@assert isnothing(model.εF) # neither are computations with fixed Fermi level
@assert model.n_components == 1 # neither are multicomponents
filled_occ = filled_occupation(model)
n_spin = model.n_spin_components
n_bands = div(model.n_electrons, n_spin * filled_occ, RoundUp)
Nk = length(basis.kpoints)

if ψ0 === nothing
ψ0 = [random_orbitals(basis, kpt, n_bands) for kpt in basis.kpoints]
ψ0_rand = [random_orbitals(basis, kpt, n_bands) for kpt in basis.kpoints]
= eltype(eltype(eltype(ψ0_rand)))
ψ0 = [reinterpret(reshape, Tψ, ψ0k_rand) for ψ0k_rand in ψ0_rand]
end
occupation = [filled_occ * ones(T, n_bands) for ik = 1:Nk]

Expand Down

0 comments on commit c617130

Please sign in to comment.