ffsim.rdms¶
- ffsim.rdms(vec, norb, nelec, *, rank=1, spin_summed=False, reorder=True)[source]¶
Return the reduced density matrices of a state vector.
The rank 1 RDM is defined as follows:
rdm1[p, q] = ⟨p+ q⟩
The definition of higher-rank RDMs depends on the
reorderargument, which defaults to True.reorder = True
The reordered RDMs are defined as follows:
rdm2[p, q, r, s] = ⟨p+ r+ s q⟩ rdm3[p, q, r, s, t, u] = ⟨p+ r+ t+ u s q⟩ rdm4[p, q, r, s, t, u, v, w] = ⟨p+ r+ t+ v+ w u s q⟩
reorder = False
If reorder is set to False, the RDMs are defined as follows:
rdm2[p, q, r, s] = ⟨p+ q r+ s⟩ rdm3[p, q, r, s, t, u] = ⟨p+ q r+ s t+ u⟩ rdm4[p, q, r, s, t, u, v, w] = ⟨p+ q r+ s t+ u v+ w⟩
Note
Ranks 1 through 4 are supported. A rank-
kspin-summed tensor storesnorb ** (2*k)entries. For ranks 3 and 4, spin-resolved calculations use real intermediate tensors with(2*norb) ** (2*k)entries and a spinless state vector of dimensionbinom(2*norb, sum(nelec)). These calculations can require substantially more memory than the returned RDMs.To compute matrix elements between two different states, use
transition_rdms().- Parameters:
vec (
ndarray) – The state vector whose reduced density matrix is desired.norb (
int) – The number of spatial orbitals.nelec (
tuple[int,int]) – The number of alpha and beta electrons.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:
The reduced density matrices. All RDMs up to and including the specified rank are returned, in increasing order of rank. For example, if
rank=2then a tuple(rdm1, rdm2)is returned. Forrank=1, the 1-RDM is returned directly.Spin-summed rank-
ktensors have shape(norb,) * (2*k)and sum over all spin assignments to thekcreation-annihilation pairs. In particular, the spin-summed 1-RDM is alpha-alpha + beta-beta.Spin-resolved tensors have shape
(k+1,) + (norb,) * (2*k). The leading axis selects the spin blocks, withadenoting alpha andbbeta for each creation-annihilation pair:(a, b)for rank 1,(aa, ab, bb)for rank 2,(aaa, aab, abb, bbb)for rank 3, and(aaaa, aaab, aabb, abbb, bbbb)for rank 4.