ffsim.SupportsDiagonal

class ffsim.SupportsDiagonal(*args, **kwargs)[source]

Bases: SupportsTrace, Protocol

A linear operator whose diagonal entries can be returned.

Methods

_diag_(norb, nelec)

Return the diagonal entries of the linear operator.

_trace_(norb, nelec)

Return the trace of the linear operator.

_diag_(norb, nelec)[source]

Return the diagonal entries of the linear operator.

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

  • nelec (int | tuple[int, int]) – The number of alpha and beta electrons.

Return type:

ndarray

Returns:

The diagonal entries of the linear operator.

_trace_(norb, nelec)[source]

Return the trace of the linear operator.

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

  • nelec (int | tuple[int, int]) – The number of alpha and beta electrons.

Return type:

float

Returns:

The trace of the linear operator.