def METHOD_NAME(self, seed: Optional[int] = None) -> None:
    rng = np.random.RandomState(seed)
    psets: List[PauliStringCollection] = []
    paulis = copy.deepcopy(self._paulis)
    rng.shuffle(paulis)  # type: ignore
    while paulis:
        pauli = paulis.pop()
        added = False
        for i, pset in enumerate(psets):
            if pset.can_add(pauli):
                pset.add(pauli)
                added = True
                break
        if not added:
            psets.append(PauliStringCollection(pauli))
    self._groups = psets
    self._ngroups = len(self._groups)