-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rings of quadratic integers #73
Comments
Currently have most of the functionality for this finished - just need to implement the unique factorization bit. |
A prototype can be found in #82. |
Additionally, quadratic integers have periodic continued fractions so it would be nice to have this too - and then Pell equation solutions can be added. I have prototype code for continued fractions so I'm happy to help with that when appropriate. |
There are packages quadratic-irrational and pell already. However, the first one seems abandoned and I'd prefer to parametrise quadratic irrationals on type level, to avoid partial functions and allow |
Fair enough! |
Just for reference, I pushed some commits, reflecting my vision of quadratic rings, to https://github.com/ion1/quadratic-irrational/blob/c58c0fba08272c7e9fdff9fe8e338cff4d766ced/src/Numeric/QuadraticIrrational/Ring.hs |
@Bodigrim I understand why you opened the issues you did over the past few months, things have been nicely progressing towards this issue. Point 2 seems the hardest, I agree. Plus for some values of |
Updated description to confirm with recent directions of development. |
@Multramate this is the issue I mentioned today. |
Thank you. It seems from reading the description above that this issue is meant to implement imaginary quadratic rings, as the real case would probably be harder to do e.g. there are probably infinitely many with unique factorisation. Would you reckon I should contribute by continuing from one of the prototypes, or think it over? I foresee unique factorisation to be done on a case-by-case basis, since there are only finitely many cases to consider:
Moreover, could you clarify the difficulty in doing (2)? |
Right - the discriminant as mentioned above refers to the
Was worried for a bit since the quadratic ring is not unique given a fixed discriminant. |
I'd prefer to support both imaginary and real rings, under the same umbrella type, stratified by Writing
I would like to make it at least vaguely compatible with Not only feel free, but I encourage you to think over other aspects :)
You are right, sorry for confusion. I meant
Yep, that is exactly the reason to stratify not by discriminant, but by its square-free part. |
It would be nice to implement a basic support for quadratic integers in
arithmoi
. There is a proof of concept inMath.NumberTheory.Quadratic.GaussianIntegers
andMath.NumberTheory.Quadratic.EisensteinIntegers
modules.Integer
fields and discriminant of the field D on the type level. One can copy the kind of discriminants from Numeric.QuadraticIrrational.SquareFree intoarithmoi
tree.Define
Num (QuadraticInteger d)
instance. This will require definitions of conjugation and norm as well.For principal rings (D = −1, −2, −3, −7, −11, −19, −43, −67, −163) define a function
primes
, generating an infinite sequence of prime elements, ordered by norm. UsesolveQuadratic
to solvenorm x = p
andnorm x = p^2
as described in this comment.Define
UniqueFactorisation
instance for principal rings.Define
Euclidean
instance for Euclidean rings.The text was updated successfully, but these errors were encountered: