Skip to content
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

Introduced phase change #109

Merged
merged 1 commit into from
Jan 8, 2023
Merged

Introduced phase change #109

merged 1 commit into from
Jan 8, 2023

Conversation

scemama
Copy link
Member

@scemama scemama commented Jan 8, 2023

Suppose you have a determinant with 3 orbitals : |1 2 3>
If you store it in a bitfield, you get the integer 7 (111 in binary).
Now, if I have a determinant |1 3 2>, it also gives 7, but there is no way we can get back to |1 3 2>. We will go to |1 2 3>, and the problem is that |1 2 3> = -|1 3 2>. It imposes that the users are aware that they might need to compute a phase factor.

The helper function was modified to automatically compute the phase factor and returns the new exit code TREXIO_PHASE_CHANGE if a change of sign is needed in the coefficient, so that the users can update the CI coefficients accordingly.

@scemama scemama requested a review from q-posev January 8, 2023 10:48
Copy link
Member

@q-posev q-posev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, merging

@q-posev q-posev merged commit f6623c1 into master Jan 8, 2023
@q-posev q-posev deleted the phases branch January 8, 2023 16:17
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