Implement a DeterminantVariationalState that computes expectations/gradients exactly#2181
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2181 +/- ##
==========================================
- Coverage 82.79% 82.65% -0.14%
==========================================
Files 371 375 +4
Lines 22271 22538 +267
Branches 2834 2868 +34
==========================================
+ Hits 18439 18629 +190
- Misses 2910 2970 +60
- Partials 922 939 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gcarleo
reviewed
Nov 21, 2025
Member
gcarleo
left a comment
There was a problem hiding this comment.
nice, this is very helpful for debugging I guess!
47cb4d8 to
9569bb3
Compare
This commit adds a new variational state for fermionic systems that uses Slater determinants and computes expectation values exactly via Wick's theorem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I needed something I understand to optimise determinant states easily, so I wrote it...
Uses the Wick theorem.
Super-inefficient implmentation. Can be improved by using the PNC operators that already store data as we want, but already handles 1000s of orbitals efficiently on a cpu (and probably better on a gpu) by batching the determinants so no need to push it.
Would be nice to derive the expression for the QGT so we can optimise with higher order optimisers as well...