The module rings.quatalg defines the following classes:
The module rings.quatalg defines the following methods:
K, a, b, [c=0]) |
Returns the quaternion algebra over the field K with generators i and j and the following relations:
i^2 = a j^2 = b i*j + j*i = c
INPUT: K -- field a -- nonzero element of K b -- nonzero element of K b -- element of K
We create quaternion algebras over several base fields.
sage: QuaternionAlgebra(RationalField(), -1, -7) Quaternion Algebra over Rational Field
sage: QuaternionAlgebra(NumberField(x**2-5), -1, -7) Quaternion Algebra over Number Field with defining polynomial x^2 - 5
sage: QuaternionAlgebra(GF(3), -1, -7) Quaternion Algebra over Finite field of size 3
Note that both a and b must be nonzero:
sage: QuaternionAlgebra(RationalField(), 1, 0) Traceback (most recent call last): ... ArithmeticError: Both i^2 (=1) and j^2 (=0) must be nonzero.
sage: QuaternionAlgebra(GF(7), -1, -7) Traceback (most recent call last): ... ArithmeticError: Both i^2 (=6) and j^2 (=0) must be nonzero.
Note that K must be a field. This is because we represent elements of the quaternion algebra as vectors in a vector space, and we support division. Use the QuaternionOrder_... commands.
sage: QuaternionAlgebra(IntegerRing(), -1, -1) Traceback (most recent call last): ... TypeError: K (=Integer Ring) must be a field
N) |
D1, D2, T) |
The quaternion algebra over Q generated by i and j, where Z[i] and
Z[j] are quadratic suborders of discriminant D_1 and D_2,
respectively, and Z[ij - ji] is a quadratic suborder of
discriminant
.
INPUT: D1 -- int D2 -- int T -- int 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). OUTPUT: A quaternion algebra.
sage: A = QuaternionAlgebraWithDiscs(-7,-47,1); A Quaternion Algebra 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^2 - x + 2 sage: j.minimal_polynomial() x^2 - x + 12
THIS IS BROKEN: (todo!!)
sage: k.minimal_polynomial() # known BUG x^2 - x + 24 sage: i*j k
D1, D2, T) |
N, [M=1]) |