sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.47k stars 488 forks source link

Quaternion algebra over a relative number field #38654

Open Eloitor opened 2 months ago

Eloitor commented 2 months ago

Steps To Reproduce

F.<w> = NumberField(x**2 - x - 1)

PP = PolynomialRing(F, name="x")
x = PP.gen()
K.<a> = NumberField(x**2 - (-w - 5))
A.<i,j,k> = QuaternionAlgebra(K, -1, -1)

Expected Behavior

A quaternion algebra over K is created

Actual Behavior

I get a NotImplementedError: For a relative number field you must use relative_degree or absolute_degree as appropriate.

Additional Information

The issue is in src/sage/algebras/quatalg/quaternion_algebra.py:665

base_ring.degree() > 2 and base_ring.is_absolute(). I think changing this to absolute_degree() or checking for is_absolute() first should solve the problem

Environment

- **OS**: Void linux
- **Sage Version**: 10.4

Checklist

Blackphoenix-15 commented 2 months ago

i want to work on this issue, and here is my approach F. = NumberField(x^2 - x - 1)

Composite field to create an absolute field containing both w and the quadratic extension

L. = F.absolute_field(x^2 - (-w - 5))

A.<i, j, k> = QuaternionAlgebra(L, -1, -1)