|
Size: 1608
Comment:
|
Size: 1631
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 2: | Line 2: |
<<TableOfContents>> |
Reimplement Basic Quaternion Algebra Arithmetic
PEOPLE:
- William Stein
- Justin Walker
Basic arithmetic in quaternion algebras in Sage is horrid since it is about 20-50 times SLOWER than Magma! For example consider the following (see below). Doctest coverage is not horrid:
quaternion_algebra.py: 37% (11 of 29) quaternion_algebra_element.py: 57% (12 of 21) quaternion_order.py: 0% (0 of 9) quaternion_order_element.py: 0% (0 of 8) quaternion_order_ideal.py: 0% (0 of 6) quaternion_order_ideal_element.py: 0% (0 of 1)
%magma
A<i,j,k> := QuaternionAlgebra(RationalField(),-5,-2);
a := i + j + k;
b := i - j - k;
t := Cputime();
for i in [1..10000] do
c := (a-i)*(b+i);
end for;
print Cputime(t);
///
0.080A.<i,j,k> = QuaternionAlgebra(QQ,-5,-2)
a = i + j + k
b = i - j - k
t = cputime()
for i in [1..10000]:
c = (a-i)*(b+i)
print cputime(t)
///
4.2912974.291297/0.08 /// 53.6412125000000
%magma
A<i,j,k> := QuaternionAlgebra(RationalField(),-5,-2);
a := i + j + k;
b := i - j - k;
t := Cputime();
for i in [1..1000] do
c := (a-i)^10*(b+i)^10;
end for;
print Cputime(t);
///
0.110A.<i,j,k> = QuaternionAlgebra(QQ,-5,-2)
a = i + j + k
b = i - j - k
t = cputime()
for i in [1..1000]:
c = (a-i)^10*(b+i)^10
print cputime(t)
///
2.8044532.804452/0.11 /// 25.4950181818182
Project goals
- Bring doctest coverage of quaternion_* to 100%
- Make basic arithmetic with quaternions as fast (or faster) than Magma.
