find_index_order#
- find_index_order(two_body_tensor, *, rtol=1e-05, atol=1e-08)[source]#
Return the index-order convention of the provided rank-four tensor.
The index convention is determined by checking symmetries of the tensor. If the indexing convention can be determined, then one of
IndexType.CHEMIST
,IndexType.PHYSICIST
, orIndexType.INTERMEDIATE
is returned. TheIndexType.INTERMEDIATE
indexing may be obtained by applying_chem_to_phys()
to the physicists’ convention or_phys_to_chem()
to the chemists’ convention. If the tests for each of these conventions fail, thenIndexType.UNKNOWN
is returned.Note
The first of
IndexType.CHEMIST
,IndexType.PHYSICIST
, andIndexType.INTERMEDIATE
, in that order, to pass the tests is returned. Iftwo_body_tensor
has accidental symmetries, it may in fact satisfy more than one set of symmetry tests. For example, if all elements have the same value, then the symmetries for all three index orders are satisfied.- Parameters:
two_body_tensor (np.ndarray | SparseArray | SymmetricTwoBodyIntegrals) – the rank-four tensor whose index order to determine.
rtol (float) – the relative tolerance used during the comparison.
atol (float) – the absolute tolerance used during the comparison.
- Returns:
The index order of the provided rank-four tensor.
- Return type: