Skip to content

Commit

Permalink
AtomsCalculator interface: Empty state by default (JuliaMolSim#958)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael F. Herbst <[email protected]>
  • Loading branch information
CedricTravelletti and mfherbst authored Mar 2, 2024
1 parent 00c9c48 commit 653cfc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/external/atoms_calculators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ function compute_scf!(system::AbstractSystem, calculator::DFTKCalculator, state:
end

AtomsCalculators.@generate_interface function AtomsCalculators.potential_energy(
system::AbstractSystem, calculator::DFTKCalculator; state = calculator.state,
system::AbstractSystem, calculator::DFTKCalculator; state = DFTKState(),
kwargs...)
compute_scf!(system, calculator, state)
calculator.state.scfres.energies.total
end

AtomsCalculators.@generate_interface function AtomsCalculators.forces(
system::AbstractSystem, calculator::DFTKCalculator; state = calculator.state,
system::AbstractSystem, calculator::DFTKCalculator; state = DFTKState(),
kwargs...)
compute_scf!(system, calculator, state)
compute_forces_cart(calculator.state.scfres)
Expand Down

0 comments on commit 653cfc5

Please sign in to comment.