btensor.basis.compatible_basis

btensor.basis.compatible_basis(basis1, basis2)[source]

Check if two bases are compatible with each other.

Compatible means that the two Tensors with this basis can be added, subtracted, contracted, etc.

Parameters
  • basis1 (Union[Basis, btensor.basis._NoBasis]) – The two bases to be checked.

  • basis2 (Union[Basis, btensor.basis._NoBasis]) – The two bases to be checked.

Returns

True if both bases are compatible, False otherwise.