to_chemist_ordering#
- to_chemist_ordering(two_body_tensor, *, index_order=None)[source]#
Convert a two-body tensor to chemists’ index order.
Coverts the rank-four tensor two-body tensor representing two-body integrals from physicists’, or intermediate, index order to chemists’ index order:
i,j,k,l -> i,l,j,k
- Parameters:
two_body_tensor (np.ndarray | SparseArray) – the rank-four tensor to be converted.
index_order (IndexType | None) – when supplied this will hard-code the
IndexType
value. IfNone
(the default), theindex_order
will be determined automatically based on the symmetries of thetwo_body_tensor
.
- Returns:
The same rank-four tensor, now in chemists’ index order.
- Raises:
QiskitNatureError – when an unknown index type is encountered.
- Return type:
np.ndarray | SparseArray