grogupy._core.onsite_projection

grogupy._core.onsite_projection(matrix: ndarray[Any, dtype[_ScalarType_co]] | CNDArray, idx1: ndarray[Any, dtype[_ScalarType_co]] | CNDArray, idx2: ndarray[Any, dtype[_ScalarType_co]] | CNDArray) ndarray[Any, dtype[_ScalarType_co]] | CNDArray[source]

It produces the slices of a matrix for the on site projection.

The slicing is along the last two axes as these contains the orbital indexing.

Parameters

matrix: Union[NDArray, CNDArray]

Some matrix

idx1: NDArray

The indexes of the orbitals

idx2: NDArray

The indexes of the orbitals

Returns

NDArray

Reduced matrix based on the projection