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

Fix bugs in optimize_orbitals related to open-shell workflows #71

Merged
merged 7 commits into from
Oct 7, 2024

Conversation

caleb-johnson
Copy link
Collaborator

Fixes #70

Fixes a bug in open-shell workflows causing the spin-up and spin-down average occupancies returned from optimize_orbitals to both reflect the occupancies of the spin-up orbitals, rather than returning both the spin-up and spin-down occupancies.

@caleb-johnson caleb-johnson added the bug Something isn't working label Oct 1, 2024
@caleb-johnson caleb-johnson requested a review from jrm874 October 1, 2024 15:08
@caleb-johnson caleb-johnson marked this pull request as ready for review October 1, 2024 15:08
@caleb-johnson caleb-johnson changed the title Fix bug in average occupancies returned from optimize_orbitals Fix bugs in optimize_orbitals related to open-shell workflows Oct 1, 2024
Copy link
Collaborator

@kevinsung kevinsung left a comment

Choose a reason for hiding this comment

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

LGTM with one suggestion on variable naming.

dm2 = np.asarray(dm2_chem.transpose(0, 2, 3, 1), order="C")
dm11, dm22 = myci.make_rdm1s(amplitudes, num_orbitals, (num_up, num_dn))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The variable names don't seem very descriptive to me. I suggest dm1a, dm1b instead.

@caleb-johnson caleb-johnson merged commit 45c89c2 into main Oct 7, 2024
9 checks passed
@caleb-johnson caleb-johnson deleted the oo-occs-bug branch October 7, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize_orbitals does not support open shell
2 participants