Exemple #1
0
def vectorconf_to_hyperplane_arrangement(vector_conf, backend=None):
    r"""
    Return the hyperplane arrangement associated to the vector configuration
    ``vector_conf``.

    INPUT:

    - ``vector_conf`` -- a vector configuration

    - ``backend`` -- string (default = ``None``). The backend to use.

    OUTPUT:

    A hyperplane arrangement

    EXAMPLES:

    The arrangement `A(10,60)_3` with 10 hyperplanes is the smallest rank-three 
    simplicial arrangement that is not congruence normal::

        sage: from cn_hyperarr.main import *
        sage: tau = AA((1+sqrt(5))/2)
        sage: ncn = [[2*tau + 1, 2*tau, tau], [2*tau + 2, 2*tau + 1, tau + 1], 
        ....:        [1, 1, 1], [tau + 1, tau + 1, tau], [2*tau, 2*tau, tau], 
        ....:        [tau + 1, tau + 1, 1], [1, 1, 0], [0, 1, 0], [1, 0, 0], 
        ....:        [tau + 1, tau, tau]]
        sage: ncn_conf = VectorConfiguration(ncn);
        sage: ncn_arr = vectorconf_to_hyperplane_arrangement(ncn_conf); ncn_arr
        Arrangement of 10 hyperplanes of dimension 3 and rank 3

    Using normaliz as backend::

        sage: ncn_conf_norm = VectorConfiguration(ncn, 'normaliz')   # optional - pynormaliz
        sage: ncn_conf_norm.backend()                                # optional - pynormaliz
        'normaliz'
    """
    if not isinstance(vector_conf, VectorConfiguration):
        vector_conf = VectorConfiguration(vector_conf, backend=backend)
    if vector_conf.base_ring() == ZZ:
        H = HyperplaneArrangements(QQ, names='xyz')
    else:
        H = HyperplaneArrangements(vector_conf.base_ring(), names='xyz')
    x, y, z = H.gens()
    A = H(backend=vector_conf.backend())
    for v in vector_conf:
        a, b, c = v
        A = A.add_hyperplane(a * x + b * y + c * z)
    return A
Exemple #2
0
        def inversion_arrangement(self, side='right'):
            r"""
            Return the inversion hyperplane arrangement of ``self``.

            INPUT:

            - ``side`` -- ``'right'`` (default) or ``'left'``

            OUTPUT:

            A (central) hyperplane arrangement whose hyperplanes correspond
            to the inversions of ``self`` given as roots.

            The ``side`` parameter determines on which side
            to compute the inversions.

            EXAMPLES::

                sage: W = WeylGroup(['A',3])
                sage: w = W.from_reduced_word([1, 2, 3, 1, 2])
                sage: A = w.inversion_arrangement(); A
                Arrangement of 5 hyperplanes of dimension 3 and rank 3
                sage: A.hyperplanes()
                (Hyperplane 0*a1 + 0*a2 + a3 + 0,
                 Hyperplane 0*a1 + a2 + 0*a3 + 0,
                 Hyperplane 0*a1 + a2 + a3 + 0,
                 Hyperplane a1 + a2 + 0*a3 + 0,
                 Hyperplane a1 + a2 + a3 + 0)

            The identity element gives the empty arrangement::

                sage: W = WeylGroup(['A',3])
                sage: W.one().inversion_arrangement()
                Empty hyperplane arrangement of dimension 3
            """
            inv = self.inversions(side=side, inversion_type='roots')
            from sage.geometry.hyperplane_arrangement.arrangement import HyperplaneArrangements
            I = self.parent().cartan_type().index_set()
            from sage.rings.rational_field import QQ
            H = HyperplaneArrangements(QQ, tuple(['a{}'.format(i) for i in I]))
            gens = H.gens()
            if not inv:
                return H()
            return H([sum(c * gens[I.index(i)] for (i, c) in root)
                      for root in inv])
Exemple #3
0
        def inversion_arrangement(self, side='right'):
            r"""
            Return the inversion hyperplane arrangement of ``self``.

            INPUT:

            - ``side`` -- ``'right'`` (default) or ``'left'``

            OUTPUT:

            A (central) hyperplane arrangement whose hyperplanes correspond
            to the inversions of ``self`` given as roots.

            The ``side`` parameter determines on which side
            to compute the inversions.

            EXAMPLES::

                sage: W = WeylGroup(['A',3])
                sage: w = W.from_reduced_word([1, 2, 3, 1, 2])
                sage: A = w.inversion_arrangement(); A
                Arrangement of 5 hyperplanes of dimension 3 and rank 3
                sage: A.hyperplanes()
                (Hyperplane 0*a1 + 0*a2 + a3 + 0,
                 Hyperplane 0*a1 + a2 + 0*a3 + 0,
                 Hyperplane 0*a1 + a2 + a3 + 0,
                 Hyperplane a1 + a2 + 0*a3 + 0,
                 Hyperplane a1 + a2 + a3 + 0)

            The identity element gives the empty arrangement::

                sage: W = WeylGroup(['A',3])
                sage: W.one().inversion_arrangement()
                Empty hyperplane arrangement of dimension 3
            """
            inv = self.inversions(side=side, inversion_type='roots')
            from sage.geometry.hyperplane_arrangement.arrangement import HyperplaneArrangements
            I = self.parent().cartan_type().index_set()
            H = HyperplaneArrangements(QQ, tuple(['a{}'.format(i) for i in I]))
            gens = H.gens()
            if not inv:
                return H()
            return H([sum(c * gens[I.index(i)] for (i, c) in root)
                      for root in inv])