-
Notifications
You must be signed in to change notification settings - Fork 8
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
t_as_lambda
option control
#89
Comments
Looking through more intermediate functions, I think that the two-body energy contribution does actually set
I don't know what the intended functionality is here, but I'm slightly surprised that there's no option to reproduce the results of not solving the lambda equations when they've been solved. I think this is because only the two-body energy contribution defaults to |
@maxnus would obviously be the best person to comment on this. My feeling is that |
Hi Both. We used to have both
Lastly, for MP2-fragments there are no Lambda-amplitudes, and IIRC, we then decided that the second combination is more of a development setting, where we want to reuse the same calculation to build DMs with or without T=Lambda approximation. In a "real-world" application, only the first and third combinations are useful and we got rid of
Anyway, I suggest that we actually bring back I would then suggest that we make sure we can calculate Lambda-amplitudes late - |
In some recent work on the solvers I've come across some confusing aspects of the code with respect to CC solver calculations with or without solution of the lambda equations. It seems like we need to properly decide what functionality we support and how to control it, as at the moment the interaction of various options are definitely confusing.
Much of these changes stem from 085372b, where we removed
t_as_lambda
as a CCSD solver option. IIRC there was some discussion of what behaviour we wanted with these options between automatically applying this approximation if required (with warnings) vs failing with aNotCalculatedError
.I can't remember what the conclusion of this was- we currently do the former, so I'm going to assume that in the rest of this. The CCSD solver has the form
so in the absence of solving the lambda equations the
l1
andl2
values will be set tot1
andt2
regardless of anything else.The confusion comes in when then looking at routines to calculate global wavefunction and density matrix values, where we seem to have a fair amount of code trying to implement the other approach, and allow calculation of the
t_as_lambda=True
expectation values whensolve_lambda=True
, but with inconsistent approaches to control this option.Looking for instance at
get_global_t1_rhf
inewf/amplitudes.py
we have code expecting control of this approximation to be in the fragment optiont_as_lambda
(can be inherited from emb):while in
ewf/rdm.py
various functions have a similar keyword argument for control (that doesn't default toemb.opts.t_as_lambda
in actual calls):In calculation of correlation energies this
t_as_lambda
option is the difference between the'dm-t2only'
and'dm'
energy functionals.As far as I can tell thanks to the code in the CCSD solver it's impossible for either of these values to be None and result in an error?
However, the main concern comes when looking at code (thankfully usually in the the slow implementations of various functions) which uses
These calls actually become calls to
get_global_t1_rhf
inewf/amplitudes.py
above, so depend onfragment.opts.t_as_lambda
. To obtain the actuall1
value here then requirest_as_lambda=False
,emb.opts.t_as_lambda=False
, andsolve_lambda=True
. Someone using this function could be forgiven for thinking thatt_as_lambda=False
should be sufficient without setting the other parameters (which all default to appropriate values).I'd say the first thing decide is when in a calculation we want to apply this approximation (in the solver or expectation value calculation).
The next thing would be taking into account that we're automatically applying this approximation where necessary in functions to calculate expectation values. Something like
force_t_as_lambda
orno_t_as_lambda
to make it clear that the result can sometimes already incorporate this approximation regardless of this parameter value might be a little more transparent.This obviously goes hand-in-hand with ensuring that we have a consistent approach to this between different functions.
(Sorry for the wall of text- I was getting test failures in
ewf/test_tailoring.py
which I traced back to this ambiguity after some effort and thought it best to raise while I had my head around it!)The text was updated successfully, but these errors were encountered: