def __matmul__(self, other):
    if isinstance(other, Tensor):
        return other.__rmatmul__(self)
    if isinstance(other, Observable):
        return Tensor(self, other)
    raise ValueError('Can only perform tensor products between observables.')
def __matmul__(self, other):
    if isinstance(other, Tensor):
        return other.__rmatmul__(self)
    if isinstance(other, Observable):
        return Tensor(self, other)
    raise ValueError('Can only perform tensor products between observables.')