docs: def basis_state(self, index_or_label):
          """Return the basis state with the given index or label.
  
          Raises:
              .BasisNotSetError: if the Hilbert space has no defined basis
              IndexError: if there is no basis state with the given index
              KeyError: if there is not basis state with the given label
          """
          from qnet.algebra.core.state_algebra import BasisKet  # avoid circ. import
          try:
              return BasisKet(index_or_label, hs=self)
          except ValueError as exc_info:
              if isinstance(index_or_label, int):
                  raise IndexError(str(exc_info))
              else:
                  raise KeyError(str(exc_info))