mcscf_calc_gradient Subroutine

private subroutine mcscf_calc_gradient(this, fragment, result)

Calculate energy gradient using CASSCF

TODO: Implementation requires: 1. Converged CASSCF (orbitals and CI) 2. Solve Z-vector (CPHF-like) equations for response 3. Compute gradient contributions: a. One-electron derivative terms b. Two-electron derivative terms (with 2-RDM) c. Orbital response contribution d. CI response contribution (for state-specific) For state-averaged: gradient of weighted energy

Type Bound

mcscf_method_t

Arguments

Type IntentOptional Attributes Name
class(mcscf_method_t), intent(in) :: this
type(physical_fragment_t), intent(in) :: fragment
type(calculation_result_t), intent(out) :: result

Calls

proc~~mcscf_calc_gradient~~CallsGraph proc~mcscf_calc_gradient mcscf_method_t%mcscf_calc_gradient proc~mcscf_calc_energy mcscf_method_t%mcscf_calc_energy proc~mcscf_calc_gradient->proc~mcscf_calc_energy proc~energy_total energy_t%energy_total proc~mcscf_calc_energy->proc~energy_total proc~mp2_total mp2_energy_t%mp2_total proc~energy_total->proc~mp2_total

Source Code

   subroutine mcscf_calc_gradient(this, fragment, result)
      !! Calculate energy gradient using CASSCF
      !!
      !! TODO: Implementation requires:
      !! 1. Converged CASSCF (orbitals and CI)
      !! 2. Solve Z-vector (CPHF-like) equations for response
      !! 3. Compute gradient contributions:
      !!    a. One-electron derivative terms
      !!    b. Two-electron derivative terms (with 2-RDM)
      !!    c. Orbital response contribution
      !!    d. CI response contribution (for state-specific)
      !! For state-averaged: gradient of weighted energy
      class(mcscf_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 *, "MCSCF: Calculating CASSCF gradient"
      end if

      ! First get energy (and converged orbitals/CI)
      call this%calc_energy(fragment, result)
      if (result%has_error) return

      ! 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 *, "MCSCF: [STUB] Gradient computed"
      end if

   end subroutine mcscf_calc_gradient