Closed lonerapier closed 3 months ago
@Autoparallel Thanks for the review.
algebra
module with separate submodules for group, field, ring (in future).Group
, Field
trait separately, but we need function overriding in derived traits because operation
in Group
and FiniteGroup
can be done in different ways.
Group
trait's operation and FiniteGroup
trait's operation separately?@lonerapier let me take a look.
One thing we could also consider is making the ring/field +
op be a AbelianGroup
. Food for thought.
Give me a sec to go look through this.
One thing we could also consider is making the ring/field
+
op be aAbelianGroup
. Food for thought.
Regarding this suggestion, I can't find a way to add this without complicating the traits and structs more
Like it wouldn't be easy for a beginner to implement 5 traits just to have a PrimeField implementation
Like it wouldn't be easy for a beginner to implement 5 traits just to have a PrimeField implementation
That's true... it would introduce having some wrapper types and what not. The only benefit it would give is that if you did something like:
let element: impl FiniteField = ...;
let (element as impl AbelianGroup) + ...
but that's probably not worth it.
Another option is something like
trait FiniteField {
type Monoid: ...
type AbelianGroup: ...
...
}
but then I think we are hitting abstraction for the sake of abstraction.
You're right, let's not make the implementation needs abusive to beginners.
That's true... it would introduce having some wrapper types and what not.
Maybe we can implement this as an example demonstration with Ring implementation. Like showing a ring with inverse and commutativity forms a field, and then comparing it with the actual Field implementation.
It changes the following:
FiniteGroup
traitMultiplicativePrimeGroup
structCurveGroup
trait