예제 #1
0
def so(R, n, representation='bracket'):
    r"""
    The Lie algebra `\mathfrak{so}_n`.

    The Lie algebra `\mathfrak{so}_n` is the type `B_k` Lie algebra
    if `n = 2k - 1` or the type `D_k` Lie algebra if `n = 2k`, and in
    either case is finite dimensional. As a matrix Lie algebra, it
    is given by the set of all real anti-symmetric `n \times n` matrices.

    INPUT:

    - ``R`` -- the base ring
    - ``n`` -- the size of the matrix
    - ``representation`` -- (default: ``'bracket'``) can be one of
      the following:

      * ``'bracket'`` - use brackets and the Chevalley basis
      * ``'matrix'`` - use matrices

    EXAMPLES:

    We first construct `\mathfrak{so}_5` using the Chevalley basis::

        sage: so5 = lie_algebras.so(QQ, 5); so5
        Lie algebra of ['B', 2] in the Chevalley basis
        sage: E1,E2, F1,F2, H1,H2 = so5.gens()
        sage: so5([E1, [E1, E2]])
        0
        sage: X = so5([E2, [E2, E1]]); X
        -2*E[alpha[1] + 2*alpha[2]]
        sage: H1.bracket(X)
        0
        sage: H2.bracket(X)
        -4*E[alpha[1] + 2*alpha[2]]
        sage: so5([H1, [E1, E2]])
        -E[alpha[1] + alpha[2]]
        sage: so5([H2, [E1, E2]])
        0

    We do the same construction of `\mathfrak{so}_4` using the Chevalley
    basis::

        sage: so4 = lie_algebras.so(QQ, 4); so4
        Lie algebra of ['D', 2] in the Chevalley basis
        sage: E1,E2, F1,F2, H1,H2 = so4.gens()
        sage: H1.bracket(E1)
        2*E[alpha[1]]
        sage: H2.bracket(E1) == so4.zero()
        True
        sage: E1.bracket(E2) == so4.zero()
        True

    We now construct `\mathfrak{so}_4` as a matrix Lie algebra::

        sage: sl2 = lie_algebras.sl(QQ, 2, representation='matrix')
        sage: E1,E2, F1,F2, H1,H2 = so4.gens()
        sage: H2.bracket(E1) == so4.zero()
        True
        sage: E1.bracket(E2) == so4.zero()
        True
    """
    if representation == 'bracket':
        from sage.algebras.lie_algebras.classical_lie_algebra import LieAlgebraChevalleyBasis
        if n % 2 == 0:
            return LieAlgebraChevalleyBasis(R, ['D', n//2])
        else:
            return LieAlgebraChevalleyBasis(R, ['B', (n-1)//2])
    if representation == 'matrix':
        from sage.algebras.lie_algebras.classical_lie_algebra import so as so_matrix
        return so_matrix(R, n)
    raise ValueError("invalid representation")
예제 #2
0
def so(R, n, representation='bracket'):
    r"""
    The Lie algebra `\mathfrak{so}_n`.

    The Lie algebra `\mathfrak{so}_n` is the type `B_k` Lie algebra
    if `n = 2k - 1` or the type `D_k` Lie algebra if `n = 2k`, and in
    either case is finite dimensional. As a matrix Lie algebra, it
    is given by the set of all real anti-symmetric `n \times n` matrices.

    INPUT:

    - ``R`` -- the base ring
    - ``n`` -- the size of the matrix
    - ``representation`` -- (default: ``'bracket'``) can be one of
      the following:

      * ``'bracket'`` - use brackets and the Chevalley basis
      * ``'matrix'`` - use matrices

    EXAMPLES:

    We first construct `\mathfrak{so}_5` using the Chevalley basis::

        sage: so5 = lie_algebras.so(QQ, 5); so5
        Lie algebra of ['B', 2] in the Chevalley basis
        sage: E1,E2, F1,F2, H1,H2 = so5.gens()
        sage: so5([E1, [E1, E2]])
        0
        sage: X = so5([E2, [E2, E1]]); X
        -2*E[alpha[1] + 2*alpha[2]]
        sage: H1.bracket(X)
        0
        sage: H2.bracket(X)
        -4*E[alpha[1] + 2*alpha[2]]
        sage: so5([H1, [E1, E2]])
        -E[alpha[1] + alpha[2]]
        sage: so5([H2, [E1, E2]])
        0

    We do the same construction of `\mathfrak{so}_4` using the Chevalley
    basis::

        sage: so4 = lie_algebras.so(QQ, 4); so4
        Lie algebra of ['D', 2] in the Chevalley basis
        sage: E1,E2, F1,F2, H1,H2 = so4.gens()
        sage: H1.bracket(E1)
        2*E[alpha[1]]
        sage: H2.bracket(E1) == so4.zero()
        True
        sage: E1.bracket(E2) == so4.zero()
        True

    We now construct `\mathfrak{so}_4` as a matrix Lie algebra::

        sage: sl2 = lie_algebras.sl(QQ, 2, representation='matrix')
        sage: E1,E2, F1,F2, H1,H2 = so4.gens()
        sage: H2.bracket(E1) == so4.zero()
        True
        sage: E1.bracket(E2) == so4.zero()
        True
    """
    if representation == 'bracket':
        from sage.algebras.lie_algebras.classical_lie_algebra import LieAlgebraChevalleyBasis
        if n % 2 == 0:
            return LieAlgebraChevalleyBasis(R, ['D', n//2])
        else:
            return LieAlgebraChevalleyBasis(R, ['B', (n-1)//2])
    if representation == 'matrix':
        from sage.algebras.lie_algebras.classical_lie_algebra import so as so_matrix
        return so_matrix(R, n)
    raise ValueError("invalid representation")