Skip to content

Conversation

@peter-reinholdt
Copy link
Contributor

There was a problem where the occupations in t_up did not match det_up in the 1-1 excitation elements.

Originally, the 1-0 branch had the following bit of code

            if (std::abs(val) > eps) {
                rank = wfn.rank_det(det_up);
                if (wfn.index_det_from_rank(rank) == -1) {
                    val *= sign_up;
                    fill_occs(wfn.nword, det_up, t_up);
                    compute_enpt2_thread_gather(wfn, ham.one_mo, ham.two_mo, terms[rank], val, n2,
                                                n3, t_up);
                }
            }

which would assign t_up for the 1-0 branch as needed, i.e., when |Hki*ci|>eps and when the singly-excited determinant was not contained in the variational wave function.

However, t_up needs to be correctly assigned also for the later 1-1 branch, which would not always happen.

Additionally, the threads are not guaranteed to join in order, so the compute_enpt2_thread_condense now happens only after all threads have joined.

@msricher
Copy link
Collaborator

Thanks, will check it out and merge

@msricher
Copy link
Collaborator

yes, seems you are right

@msricher msricher merged commit 95d5311 into theochem:master Nov 26, 2025
1 check passed
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.

2 participants