pytc.ansatz.det.update_inverse_sherman_morrison¶
- pytc.ansatz.det.update_inverse_sherman_morrison(inv, new_row, old_row, row_idx, ratio)[source]¶
Update the inverse matrix via Sherman-Morrison after a rank-1 row update.
- Using S @ inv = I, we have old_row @ inv = e_k^T, so:
inv’ = inv - outer(inv[:, k], new_row @ inv - e_k^T) / ratio
- Parameters:
inv – (n_occ, n_occ) — current S^{-1}
new_row – (n_occ,)
old_row – (n_occ,) — unused, kept for API clarity
row_idx – int
ratio – scalar — det(S’)/det(S)
- Returns:
(n_occ, n_occ)
- Return type:
inv’