Skip to content

Commit

Permalink
slater sampler: don't use np.ix_ (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung authored Aug 1, 2024
1 parent 48c8ec2 commit a61ab51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/ffsim/states/slater.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,5 @@ def _generate_probs(rdm: np.ndarray, sample: set[int], norb: int) -> np.ndarray:
empty_orbitals = (orb for orb in range(norb) if orb not in sample)
for i, orb in enumerate(empty_orbitals):
indices = list(sample | {orb})
probs[i] = np.linalg.det(rdm[np.ix_(indices, indices)]).real
probs[i] = np.linalg.det(rdm[indices][:, indices]).real
return probs / np.sum(probs)

0 comments on commit a61ab51

Please sign in to comment.