Calculate energy gradient using Kohn-Sham DFT
TODO: Implementation requires: 1. Converged SCF (call calc_energy to get density) 2. Compute gradient contributions: a. One-electron integral derivatives b. Two-electron integral derivatives (or RI-J) c. XC potential derivatives (grid-based) d. Overlap derivative (Pulay force) 3. Optional: dispersion gradient
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dft_method_t), | intent(in) | :: | this | |||
| type(physical_fragment_t), | intent(in) | :: | fragment | |||
| type(calculation_result_t), | intent(out) | :: | result |
subroutine dft_calc_gradient(this, fragment, result) !! Calculate energy gradient using Kohn-Sham DFT !! !! TODO: Implementation requires: !! 1. Converged SCF (call calc_energy to get density) !! 2. Compute gradient contributions: !! a. One-electron integral derivatives !! b. Two-electron integral derivatives (or RI-J) !! c. XC potential derivatives (grid-based) !! d. Overlap derivative (Pulay force) !! 3. Optional: dispersion gradient class(dft_method_t), intent(in) :: this type(physical_fragment_t), intent(in) :: fragment type(calculation_result_t), intent(out) :: result if (this%options%verbose) then print *, "DFT: Calculating gradient using ", trim(this%options%functional) end if ! First get energy (and converged density) call this%calc_energy(fragment, result) ! Allocate and fill dummy gradient allocate (result%gradient(3, fragment%n_atoms)) result%gradient = 0.0_dp ! Placeholder result%has_gradient = .true. if (this%options%verbose) then print *, "DFT: [STUB] Gradient computed" end if end subroutine dft_calc_gradient