ffsim.slater_determinant_rdms

ffsim.slater_determinant_rdms(norb, occupied_orbitals, orbital_rotation=None, *, rank=1, reorder=True)[source]

Return the reduced density matrices of a Slater determinant.

Overloads:

The rank 1 RDM is defined as follows:

rdm1[p, q] = ⟨p+ q⟩

The definition of higher-rank RDMs depends on the reorder argument, 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⟩

and so on.

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⟩

and so on.

Note

The higher-rank RDMs are computed from the 1-RDM using Wick’s theorem, so any rank is supported. A rank-k tensor stores norb ** (2*k) entries, and computing it takes about k tensor products of that size.

Parameters:
  • norb (int) – The number of spatial orbitals.

  • occupied_orbitals (Sequence[int] | tuple[Sequence[int], Sequence[int]]) – The occupied orbitals in the electronic configuration. This is either a list of integers specifying spinless orbitals, or a pair of lists, where the first list specifies the spin alpha orbitals and the second list specifies the spin beta orbitals.

  • orbital_rotation (ndarray | tuple[ndarray | None, ndarray | None] | None) – The optional orbital rotation. You can pass either a single Numpy array specifying the orbital rotation to apply to both spin sectors, or you can pass a pair of Numpy arrays specifying independent orbital rotations for spin alpha and spin beta. If passing a pair, you can use None for one of the values in the pair to indicate that no operation should be applied to that spin sector.

  • rank (int) – The highest rank of reduced density matrix to return. I.e., rank 1 corresponds to the one-particle RDM, rank 2 corresponds to the 2-particle RDM, etc.

  • reorder (bool) – Whether to reorder the indices of the reduced density matrix.

Returns:

The reduced density matrices of the Slater determinant. All RDMs up to and including the specified rank are returned, in increasing order of rank. For example, if rank=2 then a tuple (rdm1, rdm2) is returned. For rank=1, the 1-RDM is returned directly. The representation of an RDM depends on whether occupied_orbitals is a sequence of integers (spinless case), or a pair of such sequences (spinful case). In the spinless case, the full RDM is returned, with shape (norb,) * (2*k) for rank k. In the spinful case, each rank-k RDM is represented as a stacked Numpy array of sub-RDMs with shape (k+1,) + (norb,) * (2*k). The leading axis selects the spin blocks, with a denoting alpha and b beta for each creation-annihilation pair: (a, b) for rank 1, (aa, ab, bb) for rank 2, (aaa, aab, abb, bbb) for rank 3, and so on.