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
Currently, only ranks 1 and 2 are supported.
- 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 rank of the reduced density matrix.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. The 1-RDMs are: (alpha-alpha, beta-beta). The spin-summed 1-RDM is alpha-alpha + alpha-beta. The 2-RDMs are: (alpha-alpha, alpha-beta, beta-beta). The spin-summed 2-RDM is alpha-alpha + alpha-beta + beta-alpha + beta-beta.