def sub_str(self, name: str) -> numpy.ndarray:
    "\n        Get subspace of tensor by a string\n        Currently is able to resolve an active space, named 'a', full space 'f', and the complement 'p' = 'f' - 'a'.\n        Full space in this context may also be smaller than actual tensor dimension.\n\n        The specification of active space in this context only allows to pick a set from a list of orbitals, and\n        is not able to resolve an active space from irreducible representations.\n\n        Example for one-body tensor:\n        hPQ.sub_lists(name='ap') = [hPQ for P in active_indices and Q in _passive_indices]\n\n        Parameters\n        ----------\n            name :\n                String specifying the desired subspace, elements need to be a (active), f (full), p (full - active)\n\n        Returns\n        -------\n            out :\n                Sliced tensor as numpy.ndarray\n        "
    if (not self._indices_set):
        self.set_index_lists()
        self._indices_set = True
    if (name is None):
        raise Exception('No name specified.')
    if (len(name) != self.order):
        raise Exception('Name does not match order of the tensor.')
    if (self.active_indices is None):
        raise Exception('Need to set an active space in order to call this function.')
    idx_lists = []
    for char in name:
        if (char.lower() == 'a'):
            idx_lists.append(self.active_indices)
        elif (char.lower() == 'p'):
            idx_lists.append(self._passive_indices)
        elif (char.lower() == 'f'):
            if (self._size_full is None):
                idx_lists.append(None)
            else:
                idx_lists.append(self._full_indices)
        else:
            raise Exception('Need to specify a valid letter (a,p,f).')
    out = self.sub_lists(idx_lists)
    return out
Get subspace of tensor by a string
Currently is able to resolve an active space, named 'a', full space 'f', and the complement 'p' = 'f' - 'a'.
Full space in this context may also be smaller than actual tensor dimension.

The specification of active space in this context only allows to pick a set from a list of orbitals, and
is not able to resolve an active space from irreducible representations.

Example for one-body tensor:
hPQ.sub_lists(name='ap') = [hPQ for P in active_indices and Q in _passive_indices]

Parameters
----------
    name :
        String specifying the desired subspace, elements need to be a (active), f (full), p (full - active)

Returns
-------
    out :
        Sliced tensor as numpy.ndarray
def sub_str(self, name: str) -> numpy.ndarray:
    "\n        Get subspace of tensor by a string\n        Currently is able to resolve an active space, named 'a', full space 'f', and the complement 'p' = 'f' - 'a'.\n        Full space in this context may also be smaller than actual tensor dimension.\n\n        The specification of active space in this context only allows to pick a set from a list of orbitals, and\n        is not able to resolve an active space from irreducible representations.\n\n        Example for one-body tensor:\n        hPQ.sub_lists(name='ap') = [hPQ for P in active_indices and Q in _passive_indices]\n\n        Parameters\n        ----------\n            name :\n                String specifying the desired subspace, elements need to be a (active), f (full), p (full - active)\n\n        Returns\n        -------\n            out :\n                Sliced tensor as numpy.ndarray\n        "
    if (not self._indices_set):
        self.set_index_lists()
        self._indices_set = True
    if (name is None):
        raise Exception('No name specified.')
    if (len(name) != self.order):
        raise Exception('Name does not match order of the tensor.')
    if (self.active_indices is None):
        raise Exception('Need to set an active space in order to call this function.')
    idx_lists = []
    for char in name:
        if (char.lower() == 'a'):
            idx_lists.append(self.active_indices)
        elif (char.lower() == 'p'):
            idx_lists.append(self._passive_indices)
        elif (char.lower() == 'f'):
            if (self._size_full is None):
                idx_lists.append(None)
            else:
                idx_lists.append(self._full_indices)
        else:
            raise Exception('Need to specify a valid letter (a,p,f).')
    out = self.sub_lists(idx_lists)
    return out