def _extended_root_configuration_indices(W, Q, F):
    """
    Return the extended root configuration indices of the facet `F`.

    INPUT:

    - `W` -- a Coxeter group
    - `Q` -- a word representing an element of `W`
    - `F` -- a facet of the subword complex

    OUTPUT:

    a list of root indices

    EXAMPLES::

        sage: from sage.combinat.subword_complex import _extended_root_configuration_indices
        sage: W = ReflectionGroup(['A',2])                              # optional - gap3
        sage: w = W.from_reduced_word([1,2,1])                          # optional - gap3
        sage: Q = [1,2,1,2,1]                                           # optional - gap3
        sage: SC = SubwordComplex(Q, w)                                 # optional - gap3
        sage: F = SC([1,2])                                             # optional - gap3
        sage: _extended_root_configuration_indices(W, Q, F)             # optional - gap3
        [0, 2, 3, 2, 1]

        sage: W = CoxeterGroup(['A',2])
        sage: w = W.from_reduced_word([1,2,1])
        sage: Q = [1,2,1,2,1]
        sage: SC = SubwordComplex(Q, w)
        sage: F = SC([1,2])
        sage: _extended_root_configuration_indices(W, Q, F)
        [0, 1, 3, 1, 2]
    """
    V_roots = []
    pi = W.one()
    for i, wi in enumerate(Q):
        V_roots.append(pi.action_on_root_indices(W.simple_root_index(wi),
                                                 side="left"))
        if i not in F:
            pi = pi.apply_simple_reflection_right(wi)
    return V_roots