Skip to content

Commit

Permalink
Fix bugs in orbital optimization affecting open-shell
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Oct 7, 2024
1 parent 2b3f007 commit c3200ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qiskit_addon_sqd/fermion.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ def optimize_orbitals(
# Generate the one and two-body reduced density matrices from latest wavefunction amplitudes
dm1, dm2_chem = myci.make_rdm12(amplitudes, num_orbitals, (num_up, num_dn))
dm2 = np.asarray(dm2_chem.transpose(0, 2, 3, 1), order="C")
dm11, dm22 = myci.make_rdm1s(amplitudes, num_orbitals, (num_up, num_dn))
dm1a, dm2b = myci.make_rdm1s(amplitudes, num_orbitals, (num_up, num_dn))

# TODO: Expose the momentum parameter as an input option
# Optimize the basis rotations
_optimize_orbitals_sci(
k_flat, learning_rate, 0.9, num_steps_grad, dm1, dm2, hcore, eri_phys
)

return e_qsci, k_flat, [np.diagonal(dm11), np.diagonal(dm22)]
return e_qsci, k_flat, [np.diagonal(dm1a), np.diagonal(dm2b)]


def rotate_integrals(
Expand Down

0 comments on commit c3200ec

Please sign in to comment.