ffsim.transition_rdms¶
- ffsim.transition_rdms(bra, ket, norb, nelec, *, rank=1, spin_summed=False, reorder=True)[source]¶
Return the transition reduced density matrices between two state vectors.
Transition RDMs use the same operators and index conventions as
rdms(), with each expectation value replaced by a matrix element betweenbraandket. For example:rdm1[p, q] = ⟨bra| p+ q |ket⟩ rdm2[p, q, r, s] = ⟨bra| p+ r+ s q |ket⟩ (reorder=True) rdm2[p, q, r, s] = ⟨bra| p+ q r+ s |ket⟩ (reorder=False)
Both inputs contain ket-state amplitudes; this function conjugates
bra. The states must have the same numbers of alpha and beta electrons. They need not be normalized or orthogonal, and the result is not divided by their overlap. Passing the same state for both arguments gives its ordinary RDMs, butrdms()computes those more efficiently.Note
Ranks 1 through 4 are supported, with the same memory requirements per real tensor family as
rdms(). Spin-resolved calculations at ranks 3 and 4 embed both states in the spinless representation.- Parameters:
bra (
ndarray) – The state vector on the left of the matrix element.ket (
ndarray) – The state vector on the right of the matrix element.norb (
int) – The number of spatial orbitals.nelec (
tuple[int,int]) – The number of alpha and beta electrons in each state.rank (
int) – The highest rank of reduced density matrix to return, from 1 to 4.spin_summed (
bool) – Whether to return the “spin-summed” RDMs.reorder (
bool) – Whether to reorder the indices of the reduced density matrix.
- Return type:
- Returns:
All transition RDMs up to and including
rank, in increasing order of rank. Forrank=1, the 1-RDM is returned directly; otherwise a tuple is returned. All tensors have complex dtype.Spin-summed rank-
ktensors have shape(norb,) * (2*k). Spin-resolved tensors have shape(k+1,) + (norb,) * (2*k), with the same spin blocks asrdms():(a, b),(aa, ab, bb),(aaa, aab, abb, bbb), and(aaaa, aaab, aabb, abbb, bbbb).