Package sage :: Package algebras :: Module quaternion_algebra
[hide private]
[frames] | no frames]

Module quaternion_algebra

source code


Quaternion algebras

AUTHOR: David Kohel, 2005-09

TESTS:
    sage: A = QuaternionAlgebra(QQ, -1,-1, names=list('ijk'))
    sage: A == loads(dumps(A))
    True
    sage: i, j, k = A.gens()
    sage: i == loads(dumps(i))
    True



Classes [hide private]
  QuaternionAlgebra_generic
  QuaternionAlgebra_faster
Functions [hide private]
 
sign(x) source code
 
fundamental_discriminant(D)
Return the discriminant of the quadratic extension $K=Q(\sqrt{D})$, i.e.
source code
 
ramified_primes(a, b)
Return a list of the finite primes ramifying in Q(a,b)
source code
 
ramified_primes_from_discs(D1, D2, T) source code
 
QuaternionAlgebra(K, a, b, names=['i', 'j', 'k'], denom=1)
Return the quaternion algebra over $K$ generated by $i$, $j$, and $k$ such that $i^2 = a$, $j^2 = b$, and $ij=-ji=k$.
source code
 
QuaternionAlgebraWithInnerProduct(K, norms, traces, names='i,j,k') source code
 
QuaternionAlgebraWithGramMatrix(K, gram, names='i,j,k')
INPUT: K -- base field gram -- the Gram matrix names -- names of the three generators.
source code
 
QuaternionAlgebraWithDiscriminants(D1, D2, T, names=['i', 'j', 'k'], M=2)
Return the quaternion algebra over the rationals generated by $i$, $j$, and $k = (ij - ji)/M$ where $\Z[i]$, $\Z[j]$, and $\Z[k]$ are quadratic suborders of discriminants $D_1$, $D_2$, and $D_3 = (D_1 D_2 - T^2)/M^2$, respectively.
source code
 
QuaternionAlgebra_fast(K, a, b, names='ijk') source code
Variables [hide private]
  _cache = {}
Function Details [hide private]

fundamental_discriminant(D)

source code 

Return the discriminant of the quadratic extension $K=Q(\sqrt{D})$, i.e.
an integer d congruent to either 0 or 1, mod 4, and such that, at most,
the only square dividing it is 4.

QuaternionAlgebra(K, a, b, names=['i', 'j', 'k'], denom=1)

source code 

Return the quaternion algebra over $K$ generated by $i$, $j$, and $k$
such that $i^2 = a$, $j^2 = b$, and $ij=-ji=k$.

INPUT:
    K -- field
    a -- element of K
    b -- element of K
    names -- list of three strings
    denom -- (optional, default 1)

EXAMPLES:
    sage: A.<i,j,k> = QuaternionAlgebra(QQ, -1,-1)
    sage: i^2
    -1
    sage: j^2
    -1
    sage: i*j
    k
    sage: j*i
    -k
    sage: (i + j + k)^2
    -3
    sage: A.ramified_primes()
    [2]

QuaternionAlgebraWithGramMatrix(K, gram, names='i,j,k')

source code 

INPUT:
    K -- base field
    gram -- the Gram matrix
    names -- names of the three generators. 
    
EXAMPLES:
    sage: A.<i,j,k> = QuaternionAlgebra(QQ, -1,-1)
    sage: g = A.gram_matrix(); g
    [2 0 0 0]
    [0 2 0 0]
    [0 0 2 0]
    [0 0 0 2]
    sage: K.<i,j,k> = QuaternionAlgebraWithGramMatrix(QQ, g); K
    Quaternion algebra with generators (i, j, k) over Rational Field
    
    sage: R.<i,j,k> = QuaternionAlgebraWithGramMatrix(QQ, diagonal_matrix([8]*4))
    sage: i^2, j^2, k^2
    (-4, -4, -4)

QuaternionAlgebraWithDiscriminants(D1, D2, T, names=['i', 'j', 'k'], M=2)

source code 

Return the quaternion algebra over the rationals generated by $i$,
$j$, and $k = (ij - ji)/M$ where $\Z[i]$, $\Z[j]$, and $\Z[k]$ are
quadratic suborders of discriminants $D_1$, $D_2$, and $D_3 = (D_1
D_2 - T^2)/M^2$, respectively.  The traces of $i$ and $j$ are
chosen in $\{0,1\}$.

The integers $D_1$, $D_2$ and $T$ must all be even or all odd, and
$D_1$, $D_2$ and $D_3$ must each be the discriminant of some
quadratic order, i.e. nonsquare integers = 0, 1 (mod 4).

INPUT:
    D1 -- Integer
    D2 -- Integer
    T  -- Integer
    M -- Integer (default: 2)
    
OUTPUT:
    A quaternion algebra.

EXAMPLES:
    sage: A = QuaternionAlgebraWithDiscriminants(-7,-47,1, names=('i','j','k'))
    sage: print A
    Quaternion algebra with generators (i, j, k) over Rational Field
    sage: i, j, k = A.gens()
    sage: i**2
    -2 + i
    sage: j**2
    -12 + j
    sage: k**2
    -24 + k
    sage: i.minimal_polynomial('x')
    x^2 - x + 2
    sage: j.minimal_polynomial('x')
    x^2 - x + 12