Change defaults for mbpt::lst and op::vac_av/op::ref_av - #584
Open
ajay-mk wants to merge 6 commits into
Open
Conversation
The connected-product form of a commutator, (AB)_c, is only equal to AB - BA if the caller connects the operators when taking the expectation value. Making it the default meant that anyone who did not pass OpConnections got a wrong answer with no diagnostic. LSTOptions::use_commutators is replaced by use_connected_form, a plain bool defaulting to false. The flag no longer tracks the unitary flag through a std::optional, and the call sites that depart from the default now read as a positive statement of what they want. The CC class supplies connectivity on the traditional path, so its lst calls ask for the connected-product form explicitly, which keeps its equations unchanged.
Defaulting to default_op_connections() silently imposed a Hamiltonian to
cluster-operator connection on every caller. A reader who has not asked
for any connectivity does not expect one, and now that lst writes
explicit commutators the connections are redundant for its output.
Callers that build connected products must now pass
{.connect = default_op_connections()} themselves. The CC class already
passes its connectivity explicitly, so its equations are unchanged.
Adapts the tests to the two new defaults without changing what any of them checks. Expressions written as connected products now ask for that form with use_connected_form = true, and the sites that relied on the implicit default_op_connections() now pass it.
Documents all three LSTOptions fields, explains when explicit commutators and connected products each apply, and warns against mixing them. Records the new vac_av/ref_av default in the operator guide and updates its example, which builds a connected product, to pass the connections it needs.
lst is no longer part of the CC class. It transforms any expression built from mbpt::Operator, so it belongs next to vac_av/ref_av in the operator guide. The CC page keeps a pointer to it where it discusses truncating the commutator expansion.
ajay-mk
force-pushed
the
ajay/flip-lst-defaults
branch
from
July 30, 2026 20:36
f2011d2 to
902cd07
Compare
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.
Two MBPT defaults assumed the caller knew about operator connectivity:
mbpt::lstnow uses explicit commutators, [A,B] = AB - BA by default. Can be switched to the cheaper connected form with an option inLSTOptionsop::vac_av/op::ref_avno longer default todefault_op_connections(). They connect nothing unless asked.Note
This will cause some changes in Manuscript examples, I will update them accordingly.
The
CCclass is unaffected: it passes its connectivity and its lst form explicitly.The change:
Keep the old behavior by asking for it:
Or take the new default and drop the connectivity:
Both will give the same equations.
Documentation on
mbpt::lstis moved out of theCCclass file andLSTOptionsare now documented.