Skip to content

1.2 Read energy and force together

These are unexecuted teaching inputs and starting models. Original diagrams are schematics, not calculated results. Validate version-specific syntax, licensed or authorized data, numerical convergence and the scientific model before using this workflow.

1.2.1 Model, units and provenance

Keep basis/potential files and executable versions traceable. Grid controls use Ry; common energy/force outputs use hartree and hartree/bohr. Read the unit in each output heading.

Shared inputs, conventions and evidence

Original schematic: Read energy and force together. No numerical results are claimed.
Original schematic: Read energy and force together. No numerical results are claimed.

1.2.2 Worked investigation

Intuition. Energy is a scalar attached to the entire geometry; force is the local direction in which that energy falls. A plausible energy with inconsistent forces is not a reliable foundation for optimization or dynamics. This case turns baseline A into a numerical differentiation experiment. Prerequisites are case 01, an unchanged electronic model, and a spreadsheet or short external script for differences. The analysis is outside CP2K; a shell grep is only a locator, not a validated parser.

Input delta. Keep RUN_TYPE ENERGY_FORCE. Make three inputs, with only the first hydrogen x coordinate set to 8.979, 8.980 and 8.981 angstrom. Use distinct projects. Thus δ = 0.001 angstrom, not 0.001 bohr. Tighten DFT/SCF/EPS_SCF to 1.0E-9 for the derivative check, and repeat at a tighter grid if needed. These coordinates are prescribed displacements, not measured equilibria.

Workflow. 1. Calculate the central geometry and retain the final force on H1. 2. Run the positive and negative displacements using the same charge, multiplicity, basis, grid and boundary conditions. 3. Identify the same final total-energy quantity in all three outputs, not an intermediate SCF value. 4. Compute F_x ≈ −[E(x+δ)−E(x−δ)]/(2δ). If energies are Hartree and δ is angstrom, the result is Hartree/angstrom. Convert the printed force before comparing: one Hartree/bohr equals approximately 1.889726 Hartree/angstrom. 5. Repeat δ = 0.002 and 0.0005 angstrom. Plot discrepancy against δ rather than expecting the smallest displacement always to win.

Interpretation. A sign reversal usually means the negative energy derivative was forgotten or the atom/component was mismatched. An error that grows as δ shrinks suggests electronic or grid noise divided by a small displacement; an error that grows at large δ suggests finite-difference truncation. Sum all atomic forces to test approximate translational invariance. The sum should become small relative to the individual forces as numerical precision is improved, but do not demand exactly zero machine-level values.

Convergence and limits. Repeat the derivative at two grid settings while holding EPS_SCF fixed, then two SCF thresholds while holding the grid fixed. This separates force noise sources. The exercise assumes a smooth electronic state: if the SCF switches spin or occupation branches between displaced geometries, the finite difference compares different surfaces. Hard discontinuities introduced by a constraint or an external potential also require care. Do not optimize the ±δ structures; that would calculate a different derivative.

Exercise. Repeat on H1 y, where the force direction may be less intuitive from the drawing. Submit the three raw energies, their units, analytic force, numerical force and difference for each δ; leave result cells blank until actually computed. Explain whether observed error is consistent with noise or truncation.

Diagram. Draw an original energy curve with three marked geometries and a tangent at the middle. Right panel: water with a displacement arrow and a force arrow, whose signs are explicitly distinguished. EN labels: displacement δ, negative slope, force component, fixed other atoms. Do not give an energy-axis numerical scale.

1.2.4 Sources and further reading