-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support periodic supercell CCSD and add bisection based Aufbau #8
base: master
Are you sure you want to change the base?
Conversation
This reverts commit d60e1b7.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 27 27
Lines 2400 2451 +51
======================================
- Misses 2400 2451 +51 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comments to address and then you can merge, lgtm, nice addition
@@ -120,6 +120,56 @@ def get_greens_function(self): | |||
return self.gf.copy(chempot=self.chempot, deep=False) | |||
|
|||
|
|||
class AufbauPrincipleBisect(AufbauPrinciple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy the doc string for aesthetics (i know it inherits __doc__
but nicer to be able to read it in the source code). Maybe add another line saying this uses bisection
def _kernel(self): | ||
energies = self.gf.energies | ||
couplings_l, couplings_r = self.gf._unpack_couplings() | ||
weights = self.gf.weights() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is a stupid question, but self.gf.weight()
is already O(nmo * naux), so is bisection only faster by virtue of vectorisation in calculating the weights? In the non-bisected algo you need O(nocc * naux) to calculate the weights but they're done one at a time so i can see how it would be less efficient in practice
lumo = homo + 1 | ||
chempot = 0.5 * (energies[homo] + energies[lumo]) | ||
except: | ||
raise ValueError("Failed to find Fermi energy.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ValueError("Failed to find Fermi energy.") | |
raise ValueError("Failed to find Fermi energy.") | |
@@ -9,7 +9,7 @@ | |||
from pyscf import gto, scf, agf2, lib | |||
from dyson import CPGF, util | |||
|
|||
ncheb = 50 # Number of Chebyshev moments | |||
ncheb = 100 # Number of Chebyshev moments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this a mistake? not that it really matters but which value is best for the example?
solver_bisect.kernel() | ||
|
||
assert np.allclose(solver.chempot, solver_bisect.chempot) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gf = mblgf.get_greens_function() | ||
nelec = 25 | ||
|
||
solver = AufbauPrinciple(gf, nelec, occupancy=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solver = AufbauPrinciple(gf, nelec, occupancy=2) | |
solver = AufbauPrinciple(gf, nelec, occupancy=2, log=NullLogger()) |
solver = AufbauPrinciple(gf, nelec, occupancy=2) | ||
solver.kernel() | ||
|
||
solver_bisect = AufbauPrincipleBisect(gf, nelec, occupancy=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solver_bisect = AufbauPrincipleBisect(gf, nelec, occupancy=2) | |
solver_bisect = AufbauPrincipleBisect(gf, nelec, occupancy=2, log=NullLogger()) |
This PR adds: