Skip to content

Fix ORCA CABS/F12 input generation and keyword duplication#872

Merged
alongd merged 3 commits intomainfrom
feat/orca-cabs-basis
Apr 23, 2026
Merged

Fix ORCA CABS/F12 input generation and keyword duplication#872
alongd merged 3 commits intomainfrom
feat/orca-cabs-basis

Conversation

@calvinp0
Copy link
Copy Markdown
Member

@calvinp0 calvinp0 commented Apr 18, 2026

This pull request improves the handling of complementary auxiliary basis sets (CABS) for F12 calculations in ORCA jobs. It introduces a dedicated cabs field for specifying the CABS basis, ensures that F12 methods require a CABS basis, and updates documentation and tests to reflect these changes. The logic for handling monoatomic species with DLPNO methods is also clarified and tested.

Improvements to ORCA F12/CABS handling:

  • Added a dedicated cabs field to the level specification for F12 calculations, ensuring that CABS is not packed into auxiliary_basis and is correctly included in the ORCA input template. [1] [2]
  • Enforced that F12 methods require a CABS basis; an informative error is raised if it is missing.
  • Updated the input file generation logic to insert the CABS token only when specified.

Test and documentation updates:

  • Added tests to verify that F12 jobs with and without a CABS basis behave as expected, and updated existing tests and documentation to use the new cabs field. [1] [2] [3] [4]

DLPNO/monoatomic handling:

  • Improved logic for monoatomic species with DLPNO methods: single-electron atoms (e.g., H) now fall back to HF, while heavier monoatomics retain DLPNO. Added tests for this behavior. [1] [2] [3]

Copilot AI review requested due to automatic review settings April 18, 2026 19:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves ORCA job handling in ARC by addressing F12/CABS input generation, avoiding duplicated ORCA keywords, and refining DLPNO handling for single-electron monoatomic species.

Changes:

  • Update ORCA input template to support a dedicated CABS basis field and add validation for F12 levels.
  • Add ORCA troubleshooting support for UHF + F12-CC by retrying with /RI.
  • Refine DLPNO monoatomic handling so only H/D/T fall back to HF (instead of all monoatomics).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
arc/scheduler.py Adjust DLPNO monoatomic fallback logic to target single-electron atoms only.
arc/job/trsh.py Detect ORCA UHF F12-CC failure mode and retry with /ri; update DLPNO monoatomic trsh guard accordingly.
arc/job/adapters/orca.py Add CABS support in ORCA input generation and reduce keyword duplication via setdefault.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread arc/job/adapters/orca.py
Comment thread arc/job/adapters/orca.py
Comment on lines 258 to +274
@@ -264,6 +271,7 @@ def write_input_file(self) -> None:
input_dict[key] = ''
input_dict['auxiliary_basis'] = _format_orca_basis(self.level.auxiliary_basis or '')
input_dict['basis'] = _format_orca_basis(self.level.basis or '')
input_dict['cabs'] = f' {_format_orca_basis(self.level.cabs)}' if self.level.cabs else ''
Comment thread arc/job/trsh.py Outdated
Comment thread arc/scheduler.py
@calvinp0 calvinp0 force-pushed the feat/orca-cabs-basis branch from 7d8da9e to 1ec22f3 Compare April 18, 2026 21:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.39%. Comparing base (70dab25) to head (c99d254).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #872      +/-   ##
==========================================
- Coverage   60.48%   60.39%   -0.10%     
==========================================
  Files         102      102              
  Lines       31102    31099       -3     
  Branches     8104     8103       -1     
==========================================
- Hits        18813    18781      -32     
- Misses       9952     9972      +20     
- Partials     2337     2346       +9     
Flag Coverage Δ
functionaltests 60.39% <ø> (-0.10%) ⬇️
unittests 60.39% <ø> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Introduces the `cabs` argument as the single source of truth for the Complementary Auxiliary Basis Set in ORCA.

Previously, users had to pack CABS into the `auxiliary_basis` string. This change adds a dedicated field and implements a validation guard: if an F12 method is specified without a CABS basis, the adapter now raises a ValueError. This prevents ORCA from silently falling back to non-F12 energies (DimCABS = 0).

Also refactors the ORCA adapter to use `setdefault` for handling keyword defaults and updates documentation to reflect the new level specification format.
@calvinp0 calvinp0 force-pushed the feat/orca-cabs-basis branch from 231f086 to c99d254 Compare April 19, 2026 09:02
Restricts the HF fallback for DLPNO methods to single-electron atoms (H, D, T) only. Heavier monoatomic species like O or N can be handled by DLPNO in ORCA and no longer have the "dlpno-" prefix stripped.

Additionally, the HF fallback now preserves Level attributes like CABS and auxiliary basis sets by using the `as_dict()` representation, ensuring consistency with recent ORCA F12 enhancements.
@calvinp0 calvinp0 requested review from Lilachn91 and alongd April 19, 2026 09:03
Restricts the DLPNO incompatibility check in ORCA to single-electron species only, as heavier monoatomic species are supported. Additionally, updates the test suite to reflect the transition of the CABS basis from the auxiliary basis string to its own dedicated attribute.
Copy link
Copy Markdown
Member

@alongd alongd left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@alongd alongd merged commit d32a2e6 into main Apr 23, 2026
7 of 8 checks passed
@alongd alongd deleted the feat/orca-cabs-basis branch April 23, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants