Skip to content

Commit

Permalink
type
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Dec 17, 2023
1 parent 6695606 commit 9271568
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions python/ffsim/states/rdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _rdm2_spin_summed(
reordered: bool,
link_index: tuple[np.ndarray, np.ndarray] | None,
return_lower_ranks: bool,
) -> np.ndarray:
) -> np.ndarray | tuple[np.ndarray, np.ndarray]:
rdm1_real, rdm2_real = make_rdm12(
vec_real, norb, nelec, reorder=reordered, link_index=link_index
)
Expand Down Expand Up @@ -200,7 +200,7 @@ def _rdm2(
reordered: bool,
link_index: tuple[np.ndarray, np.ndarray] | None,
return_lower_ranks: bool,
) -> np.ndarray:
) -> np.ndarray | tuple[np.ndarray, np.ndarray]:
rdms1_real, rdms2_real = make_rdm12s(
vec_real, norb, nelec, reorder=reordered, link_index=link_index
)
Expand Down Expand Up @@ -235,10 +235,10 @@ def _assemble_rdm1_spin_summed(


def _assemble_rdm1(
rdms1_real: np.ndarray,
rdms1_imag: np.ndarray,
trans_rdms1_real_imag: np.ndarray,
trans_rdms1_imag_real: np.ndarray,
rdms1_real: tuple[np.ndarray, np.ndarray],
rdms1_imag: tuple[np.ndarray, np.ndarray],
trans_rdms1_real_imag: tuple[np.ndarray, np.ndarray],
trans_rdms1_imag_real: tuple[np.ndarray, np.ndarray],
) -> np.ndarray:
rdms1 = np.stack(rdms1_real).astype(complex)
rdms1 += np.stack(rdms1_imag)
Expand All @@ -259,10 +259,10 @@ def _assemble_rdm2_spin_summed(


def _assemble_rdm2(
rdms2_real: np.ndarray,
rdms2_imag: np.ndarray,
trans_rdms2_real_imag: np.ndarray,
trans_rdms2_imag_real: np.ndarray,
rdms2_real: tuple[np.ndarray, np.ndarray, np.ndarray],
rdms2_imag: tuple[np.ndarray, np.ndarray, np.ndarray],
trans_rdms2_real_imag: tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray],
trans_rdms2_imag_real: tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray],
) -> np.ndarray:
rdms2 = np.stack(rdms2_real).astype(complex)
rdms2 += np.stack(rdms2_imag)
Expand Down

0 comments on commit 9271568

Please sign in to comment.