Пример #1
0
    def __init__(self, R, n):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: L = lie_algebras.Heisenberg(QQ, 2, representation="matrix")
            sage: TestSuite(L).run()
        """
        HeisenbergAlgebra_fd.__init__(self, n)
        MS = MatrixSpace(R, n+2, sparse=True)
        one = R.one()
        p = tuple(MS({(0,i): one}) for i in range(1, n+1))
        q = tuple(MS({(i,n+1): one}) for i in range(1, n+1))
        z = (MS({(0,n+1): one}),)
        names = tuple('p%s'%i for i in range(1,n+1))
        names = names + tuple('q%s'%i for i in range(1,n+1)) + ('z',)
        cat = LieAlgebras(R).Nilpotent().FiniteDimensional().WithBasis()
        LieAlgebraFromAssociative.__init__(self, MS, p + q + z, names=names,
                                           index_set=names, category=cat)
Пример #2
0
    def __init__(self, R, n):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: L = lie_algebras.Heisenberg(QQ, 2, representation="matrix")
            sage: TestSuite(L).run()
        """
        HeisenbergAlgebra_fd.__init__(self, n)
        MS = MatrixSpace(R, n+2, sparse=True)
        one = R.one()
        p = tuple(MS({(0,i): one}) for i in range(1, n+1))
        q = tuple(MS({(i,n+1): one}) for i in range(1, n+1))
        z = (MS({(0,n+1): one}),)
        names = tuple('p%s'%i for i in range(1,n+1))
        names = names + tuple('q%s'%i for i in range(1,n+1)) + ('z',)
        cat = LieAlgebras(R).FiniteDimensional().WithBasis()
        LieAlgebraFromAssociative.__init__(self, MS, p + q + z, names=names,
                                           index_set=names, category=cat)
Пример #3
0
    def __init__(self, R, n):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: g = lie_algebras.gl(QQ, 4)
            sage: TestSuite(g).run()

        TESTS:

        Check that :trac:`23266` is fixed::

            sage: gl2 = lie_algebras.gl(QQ, 2)
            sage: isinstance(gl2.basis().keys(), FiniteEnumeratedSet)
            True
            sage: Ugl2 = gl2.pbw_basis()
            sage: prod(Ugl2.gens())
            PBW['E_0_0']*PBW['E_0_1']*PBW['E_1_0']*PBW['E_1_1']
        """
        MS = MatrixSpace(R, n, sparse=True)
        one = R.one()
        names = []
        gens = []
        for i in range(n):
            for j in range(n):
                names.append('E_{0}_{1}'.format(i,j))
                mat = MS({(i,j):one})
                mat.set_immutable()
                gens.append(mat)
        self._n = n
        category = LieAlgebras(R).FiniteDimensional().WithBasis()
        from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
        index_set = FiniteEnumeratedSet(names)
        LieAlgebraFromAssociative.__init__(self, MS, tuple(gens),
                                           names=tuple(names),
                                           index_set=index_set,
                                           category=category)
Пример #4
0
    def __init__(self, R, ct, e, f, h):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
            sage: TestSuite(g).run()

        TESTS:

        Check that :trac:`23266` is fixed::

            sage: sl2 = lie_algebras.sl(QQ, 2, 'matrix')
            sage: isinstance(sl2.indices(), FiniteEnumeratedSet)
            True
        """
        n = len(e)
        names = ['e%s'%i for i in range(1, n+1)]
        names += ['f%s'%i for i in range(1, n+1)]
        names += ['h%s'%i for i in range(1, n+1)]
        category = LieAlgebras(R).FiniteDimensional().WithBasis()
        from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
        index_set = FiniteEnumeratedSet(names)
        LieAlgebraFromAssociative.__init__(self, e[0].parent(),
                                           gens=tuple(e + f + h),
                                           names=tuple(names),
                                           index_set=index_set,
                                           category=category)
        self._cartan_type = ct

        gens = tuple(self.gens())
        i_set = ct.index_set()
        self._e = Family(dict( (i, gens[c]) for c,i in enumerate(i_set) ))
        self._f = Family(dict( (i, gens[n+c]) for c,i in enumerate(i_set) ))
        self._h = Family(dict( (i, gens[2*n+c]) for c,i in enumerate(i_set) ))