@@ -16,6 +16,11 @@ include("operators.jl")
1616# In particular, dE/dψn = 2 fn |Hψn> (plus weighting for k-point sampling)
1717abstract type Term end
1818
19+ # Terms that are linear in the density matrix, i.e. have zero second derivative
20+ abstract type TermLinear <: Term end
21+ compute_kernel (term:: TermLinear , basis:: AbstractBasis ; kwargs... ) = nothing
22+ apply_kernel (term:: TermLinear , basis:: AbstractBasis , δρ; kwargs... ) = nothing
23+
1924# Terms that are non-linear in the density (i.e. which give rise to a Hamiltonian
2025# contribution that is density-dependent or orbital-dependent as well)
2126abstract type TermNonlinear <: Term end
@@ -33,7 +38,7 @@ DftFunctionals.needs_τ(t::Term) = false
3338"""
3439A term with a constant zero energy.
3540"""
36- struct TermNoop <: Term end
41+ struct TermNoop <: TermLinear end
3742function ene_ops (term:: TermNoop , basis:: PlaneWaveBasis{T} , ψ, occupation; kwargs... ) where {T}
3843 (; E= zero (eltype (T)), ops= [NoopOperator (basis, kpt) for kpt in basis. kpoints])
3944end
@@ -101,7 +106,6 @@ In this case the matrix has effectively 4 blocks
101106 end
102107 kernel
103108end
104- compute_kernel (:: Term , :: AbstractBasis{T} ; kwargs... ) where {T} = nothing # By default no kernel
105109
106110
107111"""
@@ -128,4 +132,3 @@ as a 4D `(i,j,k,σ)` array.
128132 end
129133 δV
130134end
131- apply_kernel (:: Term , :: AbstractBasis{T} , δρ; kwargs... ) where {T} = nothing # by default, no kernel
0 commit comments