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