Exemplo n.º 1
0
def torsion_free_gradings(L):
    r"""
    Return a complete list of gradings of the Lie algebra over torsion
    free abelian groups.

    The list is guaranteed to be complete in the following sense:
    If `\mathfrak{g} = \bigoplus_{a\in A} \mathfrak{g}_a` is any grading
    of the Lie algebra `\mathfrak{g}` over a torsion free abelian group
    `A`, then there exists
    - a grading `\mathfrak{g} = \bigoplus_{n\in \mathbb{Z}^m} \mathfrak{g}_n`,
    - an automorphism `\Phi\in\mathrm{Aut}(\mathfrak{g})`, and
    - a homomorphism `\varphi\colon\mathbb{Z}^m\to A`
    such that the grading `\mathfrak{g} = \bigoplus_{n\in \mathbb{Z}^m} \Phi(\mathfrak{g}_{\varphi(n)})`
    is exactly the same as the original `A`-grading.
    However, the list is not guaranteed to be reduced up to
    automorphism, so the above choices are not in general unique.

    EXAMPLES:

    We list all gradings of the Heisenberg Lie algebra over torsion free
    abelian groups::

        sage: from lie_gradings.gradings.grading import torsion_free_gradings
        sage: L = lie_algebras.Heisenberg(QQ, 1)
        sage: torsion_free_gradings(L)
        [Grading over Additive abelian group isomorphic to Z + Z of Heisenberg algebra of rank 1 over Rational Field with nonzero layers
           (1, 0) : (p1,)
           (0, 1) : (q1,)
           (1, 1) : (z,)
         ,
         Grading over Additive abelian group isomorphic to Z of Heisenberg algebra of rank 1 over Rational Field with nonzero layers
           (1) : (p1, z)
           (0) : (q1,)
         ,
         Grading over Additive abelian group isomorphic to Z of Heisenberg algebra of rank 1 over Rational Field with nonzero layers
           (1) : (q1, z)
           (0) : (p1,)
         ,
         Grading over Additive abelian group isomorphic to Z of Heisenberg algebra of rank 1 over Rational Field with nonzero layers
           (1) : (p1, q1)
           (2) : (z,)
         ,
         Grading over Trivial group of Heisenberg algebra of rank 1 over Rational Field with nonzero layers
           () : (p1, q1, z)
         ]
    """
    maxgrading = maximal_grading(L)
    V = FreeModule(ZZ, len(maxgrading.magma().gens()))
    weights = maxgrading.layers().keys()

    # The torsion-free gradings are enumerated by torsion-free quotients
    # of the grading group of the maximal grading.
    diffset = set([tuple(b - a) for a, b in combinations(weights, 2)])
    subspaces = []
    for d in range(len(diffset) + 1):
        for B in combinations(diffset, d):
            W = V.submodule(B)
            if W not in subspaces:
                subspaces.append(W)

    # for each subspace, define the quotient grading
    projected_gradings = []
    for W in subspaces:
        Q = V.quotient(W)

        # check if quotient is not torsion-free
        if any(qi > 0 for qi in Q.invariants()):
            continue

        quot_layers = {}
        for n in weights:
            pi_n = tuple(Q(V(tuple(n))))
            if pi_n not in quot_layers:
                quot_layers[pi_n] = []
            quot_layers[pi_n].extend(maxgrading.layers()[n])

        # expand away denominators to get an integer vector grading
        A = AdditiveAbelianGroup(Q.invariants())
        denoms = [
            pi_n_k.denominator() for pi_n in quot_layers for pi_n_k in pi_n
        ]
        mult = lcm(denoms)
        proj_layers = {
            tuple(mult * pi_nk for pi_nk in pi_n): l
            for pi_n, l in quot_layers.items()
        }
        proj_grading = grading(L, proj_layers, magma=A, projections=True)
        projected_gradings.append(proj_grading)
    return projected_gradings