Skip to content

[Feature] Adds a well tempered Strategy and an example#13

Merged
robashaw merged 6 commits intomainfrom
well-temp
Jun 27, 2025
Merged

[Feature] Adds a well tempered Strategy and an example#13
robashaw merged 6 commits intomainfrom
well-temp

Conversation

@JGrantHill
Copy link
Collaborator

@JGrantHill JGrantHill commented Jun 26, 2023

Cloned the even tempered Strategy and modified it to produce a well tempered Strategy. Included example file uses Psi4 as the backend to optimise the 4 parameters for a well tempered basis.

TODO:

  • Add some information to the docs. (Tutorial doc added)
  • Investigate efficiency. The gamma and delta parameters can become negative during the optimisation and while this still produces valid exponents, it is likely to slow things down. Perhaps some regularisation/preconditioning will help.
  • Consider adding a well tempered starting guess for a free optimisation (probably a separate PR). (Done)
  • Get flake8p to actually run (seems to fall over on my system). (Done)

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Attention: Patch coverage is 37.06294% with 90 lines in your changes missing coverage. Please review.

Project coverage is 50.92%. Comparing base (ec76df0) to head (49b059c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
basisopt/opt/welltemper.py 22.22% 70 Missing ⚠️
basisopt/basis/atomic.py 35.29% 11 Missing ⚠️
basisopt/data.py 40.00% 6 Missing ⚠️
basisopt/basis/guesses.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
- Coverage   52.71%   50.92%   -1.80%     
==========================================
  Files          47       49       +2     
  Lines        2963     3250     +287     
==========================================
+ Hits         1562     1655      +93     
- Misses       1401     1595     +194     

☔ 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.

@JGrantHill JGrantHill linked an issue Jun 26, 2023 that may be closed by this pull request
@JGrantHill JGrantHill changed the title Adds a well tempered Strategy and an example [Feature] Adds a well tempered Strategy and an example Jun 27, 2023
@JGrantHill
Copy link
Collaborator Author

I think this is now ready for review. The point about efficiency is one that can probably be solved in the optimisation, rather than a problem with the well-tempered expansion itself.

@JGrantHill JGrantHill requested a review from robashaw July 5, 2023 13:35
Comment on lines 146 to 148
x = max(values[1], 1.01)
g = max(values[2], 1.01)
d = max(values[3], 1.01)
Copy link
Owner

Choose a reason for hiding this comment

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

As these are all the same, better to make them a constant

Copy link
Owner

@robashaw robashaw left a comment

Choose a reason for hiding this comment

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

Only one small change needed

@robashaw robashaw merged commit a027dc9 into main Jun 27, 2025
2 checks passed
@robashaw robashaw deleted the well-temp branch June 27, 2025 00:52
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.

Implement well-tempered Strategy

2 participants