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.

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⟩

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:
  • 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 rank of the reduced density matrix. 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.

Return type:

ndarray | tuple[ndarray, ...]

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. 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. In the spinful case, each RDM is represented as a stacked Numpy array of sub-RDMs. For example, the 1-RDMs are: (alpha-alpha, beta-beta), and the 2-RDMs are: (alpha-alpha, alpha-beta, beta-beta).