def _is_ectopic(qidx):
    """
    Checks if a QRS index is an ectopic beat in a trigeminy, according to its
    index.

    Parameters
    ----------
    qidx:
        Index of the QRS complex within the QRS observations of this pattern.

    Returns
    -------
    out:
        True if the index corresponds to an ectopic beat, False otherwise.
    """
    return (qidx - 1) % 3 == 0