Skip to content

Parse the ZPE of ASE outputs, so scale factors can be fit for ASE levels - #1071

Open
kfir4444 wants to merge 1 commit into
mainfrom
ase_zpe
Open

kfir4444 wants to merge 1 commit into
mainfrom
ase_zpe

Conversation

@kfir4444

@kfir4444 kfir4444 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

What

With an ASE level (e.g., UMA) and no freq_scale_factor, ARC runs its 15-species scale-factor project. Every job finishes, but the fit then crashes:

Warning: The ESS that generated the file at .../C2H2/geometry/freq.out could not be identified.
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

ARC copies an ASE job's output.yml to geometry/freq.out. determine_ess() recognized YAML only by its .yml extension, and YAMLParser.parse_zpe_correction() returned a ZPE only if one was stored, which ASE outputs don't do. Any parse of an ASE job's freq.out failed the same way, not just the ZPE.

Changes

  • determine_ess() recognizes ARC's YAML output by its content when no ESS marker matches (is_arc_yaml_output()).
  • YAMLParser.parse_zpe_correction() computes the harmonic ZPE from the frequencies, sum(h·c·ν)/2 over the real ones (imaginary ones excluded, as an ESS does). A stored zpe still takes precedence.
  • scale.py:
    • A species whose ZPE cannot be parsed is recorded as unconverged instead of crashing the run.
    • An error message gets its missing f prefix.
  • Hessian units in ase_script.py: it wrote the Hessian in eV/Ų for UMA and finite-difference frequencies, but in Hartree/Ų for TorchANI (torchani.units works in Hartree). It now writes Hartree/Ų for every calculator. Frequencies were in cm⁻¹ either way and are unchanged. Nothing in ARC reads this Hessian today: parser_evidence takes Hessians only from Gaussian and ORCA.

Checks

  • Units: reading the stored UMA Hessians as eV/Ų reproduces the stored frequencies exactly. Read as Hartree/Ų, they would put the C–H stretch of C₂H₂ at about 18,000 cm⁻¹.
  • Agreement with experiment: the ZPEs agree with the experimental values in scale.py to 0–6% for 14 of the 15 species. F₂ is the outlier at +21%.
  • End to end: run on the 15 UMA jobs that had crashed, the Truhlar fit now gives, for UMA-S 1.2 (OMol task): λ_ZPE = 0.979, a harmonic frequency scale factor of 0.993.

Tests

  • test_determine_ess_recognizes_arc_yaml_output_by_content: an ASE output.yml copied to freq.out is read as YAML, and an unrelated YAML mapping is not.
  • test_parse_zpe_correction_from_yaml_frequencies: the ZPE is the harmonic sum, an imaginary frequency doesn't count, and a stored ZPE takes precedence.
  • test_numpy_vibrational_analysis: the returned Hessian is in Hartree/Ų, checked against an ORCA Hessian.

arc/parser, ase_test.py, scale_test.py, parser_evidence_test.py and scheduler_test.py pass: 396 tests, run serially.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.12%. Comparing base (6da9d99) to head (72e29b9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1071      +/-   ##
==========================================
+ Coverage   67.09%   67.12%   +0.02%     
==========================================
  Files         123      123              
  Lines       43675    43691      +16     
  Branches    11153    11156       +3     
==========================================
+ Hits        29303    29326      +23     
+ Misses      11223    11221       -2     
+ Partials     3149     3144       -5     
Flag Coverage Δ
functionaltests 67.12% <ø> (+0.02%) ⬆️
unittests 67.12% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The fit can still abort when frequency outputs are missing or all ZPE values are unavailable, causing FileNotFoundError or ZeroDivisionError instead of handling an unsuccessful fit.

2 open issues
What changed in this PR

This PR enables frequency scale-factor fitting for ASE levels by recognizing renamed YAML outputs and deriving zero-point energies from their frequencies.

Changes:

  • Detect ARC YAML outputs by content and compute missing harmonic ZPEs from positive frequencies.
  • Handle missing parsed ZPE values and correct the species error message.
  • Standardize ASE Hessian output to Hartree/Ų and add regression tests.
File Description
arc/​utils/​scale.py Preserve unavailable ZPEs as None and fix error-message formatting.
arc/​parser/​parser.py Recognize ARC YAML output regardless of extension.
arc/​parser/​parser_test.py Test YAML detection and frequency-derived ZPEs.
arc/​parser/​adapters/​yaml.py Compute harmonic ZPE when no stored value exists.
arc/​job/​adapters/​scripts/​ase_script.py Convert returned Hessians to Hartree/Ų.
arc/​job/​adapters/​ase_test.py Verify returned Hessian units against ORCA data.

Review effort: Balanced

Comment thread arc/utils/scale.py
Comment on lines +111 to +113
zpe = parse_zpe_correction(os.path.join(project_directory, 'output', 'Species', spc.label,
'geometry', 'freq.out'))
zpe_dict[spc.label] = zpe * 1000 if zpe is not None else None # convert to J/mol
Comment thread arc/utils/scale.py
'geometry', 'freq.out')) * 1000 # convert to J/mol
zpe = parse_zpe_correction(os.path.join(project_directory, 'output', 'Species', spc.label,
'geometry', 'freq.out'))
zpe_dict[spc.label] = zpe * 1000 if zpe is not None else None # convert to J/mol

This branch has not been deployed

No deployments
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.

2 participants