@classmethod
def from_guess_with_pipe(cls, npc_matvec, v0_guess, labels_split=None,
    dtype=None):
    """Create a `FlatLinearOperator`` from a `matvec` function acting on multiple legs.

        This function creates a wrapper `matvec` function to allow acting on a "vector" with
        multiple legs. The wrapper combines the legs into a :class:`~tenpy.linalg.charges.LegPipe`
        before calling the actual `matvec` function, and splits them again in the end.

        Parameters
        ----------
        npc_matvec : function
            Function to calculate the action of the linear operator on an npc vector
            with the given split labels `labels_split`.
            Has to return an npc vector with the same legs.
        v0_guess : :class:`~tenpy.linalg.np_conserved.Array`
            Initial guess/starting vector which can be applied to `npc_matvec`.
        labels_split : None | list of str
            Labels of v0_guess in the order in which they are to be combined into a
            :class:`~tenpy.linalg.charges.LegPipe`. ``None`` defaults to
            ``v0_guess.get_leg_labels()``.
        dtype : np.dtype | None
            The data type of the arrays. ``None`` defaults to dtype of `v0_guess` (!).

        Returns
        -------
        lin_op : cls
            Instance of the class to be used as linear operator
        guess_flat : np.ndarray
            Numpy vector representing the guess `v0_guess`.
        """
    if dtype is None:
        dtype = v0_guess.dtype
    if labels_split is None:
        labels_split = v0_guess.get_leg_labels()
    v0_combined = v0_guess.combine_legs(labels_split, qconj=+1)
    if v0_combined.rank != 1:
        raise ValueError(
            '`labels_split` must contain all the legs of `v0_guess`')
    pipe = v0_combined.legs[0]
    pipe_label = v0_combined.get_leg_labels()[0]
    res = cls(npc_matvec, pipe, dtype, v0_combined.qtotal, pipe_label)
    res._labels_split = labels_split
    res._npc_matvec_multileg = npc_matvec
    res.npc_matvec = res._npc_matvec_wrapper
    guess_flat = res.npc_to_flat(v0_combined)
    return res, guess_flat
