Closed fchapoton closed 2 years ago
Branch: u/chapoton/32811
New commits:
ed8b33d | some changes in quaternion algebras (use Parent) |
double green, so please review
Why use Parent
instead of ParentWithGens
?
I'm actually wondering why we call some low level init instead of just relying on Algebra.__init__
?
see src/sage/structure/parent_old.pyx
and src/sage/structure/parent_base.pyx
In brief, ParentWithGens
is part of the "old-coercion-framework", which is still used a lot, in particular in number fields and commutative rings. This is supposed to be deprecated, but removing that is a daunting task.
But wouldn't this be resolved by using Algebra
as well? Eventually Algebra
needs a new base, doesn't it?
I think one should prefer to use "Parent" and set the appropriate category, rather than using something else than Parent, like Algebra or Ring. But I may be wrong, as nothing is very clear.
I see. However what is confusing me is that we are still inheriting from Algebra
:
class QuaternionAlgebra_abstract(Algebra):
If this is correct, we should initialize Algebra
. If this is not correct, we should just straight inherit from Parent
.
Branch pushed to git repo; I updated commit sha1. New commits:
a0799b7 | fine tuning categories of quaternions |
Hopefully, this looks better now.
Quaternion rings subclass Algebra
, and use Algebra.__init__
Quaternion orders subclass Parent
and use Parent.__init__
and the lights are green, so please review
Note that the following still works:
sage: from sage.algebras.algebra import is_Algebra
sage: Q = QuaternionAlgebra(-1,-7).maximal_order()
sage: is_Algebra(Q)
Reviewer: Jonathan Kliem
Description changed:
---
+++
@@ -1,3 +1,3 @@
a bunch of pep8 fixes
-also trying not to use ParentWithGens, but only Parent
+also trying not to use `ParentWithGens`, but only `Parent`
Changed keywords from none to pep8, ParentWithGens, Parent
See also #32245 and #32264 about quaternion algebras, and more generally
Changed branch from u/chapoton/32811 to a0799b7
a bunch of pep8 fixes
also trying not to use
ParentWithGens
, but onlyParent
CC: @tscrim @slel @kliem
Component: algebra
Keywords: pep8, ParentWithGens, Parent
Author: Frédéric Chapoton
Branch/Commit:
a0799b7
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/32811