Yield an iterator over the states (:class:`.BasisKet` instances)
        that form the canonical basis of the Hilbert space

        Raises:
            .BasisNotSetError: if the Hilbert space has no defined basis

def basis_states(self):
        """Yield an iterator over the states (:class:`.BasisKet` instances)
        that form the canonical basis of the Hilbert space

        Raises:
            .BasisNotSetError: if the Hilbert space has no defined basis
        """
        from qnet.algebra.core.state_algebra import BasisKet  # avoid circ. import
        for label in self.basis_labels:
            yield BasisKet(label, hs=self)