Skip to content

Commit

Permalink
XC fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed May 17, 2023
1 parent 8a39dcb commit 1269840
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/terms/xc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ function apply_kernel(term::TermXc, basis::PlaneWaveBasis{T}, δρ; ρ, kwargs..
terms = kernel_terms(term.functionals, density)
δV = zero(ρ) # [ix, iy, iz, iσ]

Vρρ = to_device.(basis.architecture, reshape(terms.Vρρ, n_spin, n_spin, basis.fft_size...))
Vρρ = to_device(basis.architecture, reshape(terms.Vρρ, n_spin, n_spin, basis.fft_size...))
@views for s in 1:n_spin, t in 1:n_spin # LDA term
δV[:, :, :, s] .+= Vρρ[s, t, :, :, :] .* δρ[t, :, :, :]
end
Expand Down Expand Up @@ -422,9 +422,9 @@ function add_kernel_gradient_correction!(δV, terms, density, perturbation, cros
δρ = perturbation.ρ_real
∇δρ = perturbation.∇ρ_real
δσ = cross_derivatives[:δσ]
Vρσ = to_device.(basis.architecture, reshape(terms.Vρσ, n_spin, spin_σ, basis.fft_size...))
Vσσ = to_device.(basis.architecture, reshape(terms.Vσσ, spin_σ, spin_σ, basis.fft_size...))
= to_device.(basis.architecture, reshape(terms.Vσ, spin_σ, basis.fft_size...))
Vρσ = to_device(basis.architecture, reshape(terms.Vρσ, n_spin, spin_σ, basis.fft_size...))
Vσσ = to_device(basis.architecture, reshape(terms.Vσσ, spin_σ, spin_σ, basis.fft_size...))
= to_device(basis.architecture, reshape(terms.Vσ, spin_σ, basis.fft_size...))

T = eltype(ρ)
= DftFunctionals.spinindex_σ
Expand Down

0 comments on commit 1269840

Please sign in to comment.