*****************************************************************************
*       www.FindStat.org - The Combinatorial Statistic Finder               *
*                                                                           *
*       Copyright (C) 2019 The FindStatCrew <info@findstat.org>             *
*                                                                           *
*    This information is distributed in the hope that it will be useful,    *
*    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                   *
*****************************************************************************

-----------------------------------------------------------------------------
Statistic identifier: St001849

-----------------------------------------------------------------------------
Collection: Finite Cartan types

-----------------------------------------------------------------------------
Description: The atomic length of the longest element.

The atomic length of an element $w$ of a Weyl group is the sum of the heights of the inversions of $w$.

-----------------------------------------------------------------------------
References: [1]   Chapelier-Laget, N., Gerber, T. Atomic length in Weyl groups [[arXiv:2211.12359]]

-----------------------------------------------------------------------------
Code:
def atomic_length(pi):
    """
    EXAMPLES::

        sage: l = [atomic_length(SignedPermutations(n).long_element()) for n in range(1,8)]
        sage: l
        sage: fricas.guess(l)[0].sage().factor()
        1/6*(4*n + 3)*(n + 2)*(n + 1)

    """
    W = WeylGroup(pi.parent().coxeter_type())
    w = W.from_reduced_word(pi.reduced_word())
    return sum(a.height() for a in w.inversions(inversion_type="roots"))

def statistic(ct):
    return atomic_length(WeylGroup(ct).long_element())


-----------------------------------------------------------------------------
Statistic values:

['A',1] => 1
['A',2] => 4
['B',2] => 7
['G',2] => 16
['A',3] => 10
['B',3] => 22
['C',3] => 22
['A',4] => 20
['B',4] => 50
['C',4] => 50
['D',4] => 28
['F',4] => 110
['A',5] => 35
['B',5] => 95
['C',5] => 95
['D',5] => 60
['A',6] => 56
['B',6] => 161
['C',6] => 161
['D',6] => 110
['E',6] => 156
['A',7] => 84
['B',7] => 252
['C',7] => 252
['D',7] => 182
['E',7] => 399
['A',8] => 120
['B',8] => 372
['C',8] => 372
['D',8] => 280
['E',8] => 1240

-----------------------------------------------------------------------------
Created: Nov 23, 2022 at 16:34 by Martin Rubey

-----------------------------------------------------------------------------
Last Updated: Nov 23, 2022 at 16:34 by Martin Rubey