'Is the operator or state in this Hilbert space.
This is checked by comparing the classes of the Hilbert spaces, not
the instances. This is to allow Hilbert Spaces with symbolic
dimensions.'

def __contains__(self, other):

    if (other.hilbert_space.__class__ == self.__class__):
        return True
    else:
        return False
