def __sub__(self, other):
    'The subtraction operation between Observables/Tensors/qml.Hamiltonian objects.'
    if isinstance(other, (Observable, Tensor, qml.Hamiltonian)):
        return self.__add__(other.__mul__((- 1)))
    raise ValueError(f'Cannot subtract {type(other)} from Observable')
The subtraction operation between Observables/Tensors/qml.Hamiltonian objects.
def __sub__(self, other):
    
    if isinstance(other, (Observable, Tensor, qml.Hamiltonian)):
        return self.__add__(other.__mul__((- 1)))
    raise ValueError(f'Cannot subtract {type(other)} from Observable')