Skip to content

feat(hessian): Implement Method D/E eigenvalue fitting#83

Merged
ericchansen merged 1 commit intomasterfrom
feat/method-d-e-eigenvalue
Mar 20, 2026
Merged

feat(hessian): Implement Method D/E eigenvalue fitting#83
ericchansen merged 1 commit intomasterfrom
feat/method-d-e-eigenvalue

Conversation

@ericchansen
Copy link
Copy Markdown
Owner

Summary

Implement Method D (natural eigenvalue fitting) and building blocks for Method E (hybrid) from Lime & Norrby (J. Comput. Chem. 2015, 36, 1130, DOI:10.1002/jcc.23797).

Ref #75

Background

The current replace_neg_eigenvalue() implements Method C -- forcing the reaction coordinate eigenvalue to ~9376 kJ/mol/A^2/amu. Lime & Norrby showed Method D (keeping the natural eigenvalue) gives ~13x lower RMS error, though it may produce unstable FFs with zero/negative bending constants.

Changes

New functions in q2mm/models/hessian.py

Function Purpose
keep_natural_eigenvalue() Method D: return eigenvalues unchanged (copy for safety)
detect_problematic_params() Find bond/angle params with zero/negative force constants
lock_params() Copy reference values to lock problematic params for Method E

Modified functions

  • invert_ts_curvature() now accepts method="C" (default) or method="D"
  • Fixed circular import: Atom type hint via TYPE_CHECKING guard + from __future__ import annotations

New tests: test/test_method_d_e.py (24 tests)

  • TestMethodD (4): copy safety, negative preservation, multi-neg handling
  • TestInvertTSCurvature (5): C vs D via unified interface, default is C
  • TestDetectProblematicParams (5): zero/negative/custom threshold detection
  • TestLockParams (4): lock/preserve/empty scenarios
  • TestMethodDOnSN2 (6): real SN2 TS Hessian -- eigenvalue structure, C vs D behavior

Testing

251 passed, 20 skipped. All existing tests unaffected. Ruff clean.

Add Method D (natural eigenvalue) and building blocks for Method E
(hybrid) from Lime & Norrby (J. Comput. Chem. 2015, 36, 1130):

- keep_natural_eigenvalue(): Method D -- returns eigenvalues unchanged
- detect_problematic_params(): find zero/negative force constants
- lock_params(): copy reference values to lock problematic params
- invert_ts_curvature() now accepts method='C'|'D' parameter
- Fix circular import: Atom type hint via TYPE_CHECKING guard

24 new tests covering synthetic and real SN2 TS Hessians.
Method D preserves the negative reaction coordinate eigenvalue
while Method C replaces it with ~9376 kJ/mol/A^2/amu.

Ref #75

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen merged commit be16397 into master Mar 20, 2026
5 checks passed
@ericchansen ericchansen deleted the feat/method-d-e-eigenvalue branch March 20, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant