The basic question here is whether it makes sense to distinguish between things like nmod vs fmpz_mod in python-flint. Currently python-flint only has nmod. It would be good to add fmpz_mod but should it even be exposed as something separate in python-flint?
Flint's nmod type is for "integers mod n (word size n)" whereas fmpz_mod is for "arithmetic modulo integers". At the C level it clearly makes sense to distinguish these because the data structures are different and many functions have different call signatures and the need to manage memory makes these things not really interchangeable. In Python though there is no "word size" and integers are just integers so unless I misunderstand something the python-flint interface for nmod and fmpz_mod would end up being identical.
Considering the notation in #53 maybe there should just be a context object called something like fFF(p) that would internally choose the best representation (nmod, fmpz_mod or anything else) without the user needing to consider which implementation to use.
For integers mod n it seems like it could be easy enough to do that but then there are cases like fq and fq_nmod which seem easy but could the same extend to fq_zech or should that always be treated as separate (see #50)?
See also #53 which discusses the idea of contexts to represent different types in python-flint and #54 which discusses the idea of having a low-level direct imitation of Flint's C API. Currently python-flint sort of sits in between a low and a high-level interface.
The question here is essentially whether python-flint's main interface should just be a nicer version of the low-level interface described in #54 or whether it should actually be more like the higher-level abstracted interface described in #53.
The basic question here is whether it makes sense to distinguish between things like
nmodvsfmpz_modin python-flint. Currently python-flint only hasnmod. It would be good to addfmpz_modbut should it even be exposed as something separate in python-flint?Flint's
nmodtype is for "integers mod n (word size n)" whereasfmpz_modis for "arithmetic modulo integers". At the C level it clearly makes sense to distinguish these because the data structures are different and many functions have different call signatures and the need to manage memory makes these things not really interchangeable. In Python though there is no "word size" and integers are just integers so unless I misunderstand something the python-flint interface fornmodandfmpz_modwould end up being identical.Considering the notation in #53 maybe there should just be a context object called something like
fFF(p)that would internally choose the best representation (nmod,fmpz_modor anything else) without the user needing to consider which implementation to use.For integers mod n it seems like it could be easy enough to do that but then there are cases like
fqandfq_nmodwhich seem easy but could the same extend tofq_zechor should that always be treated as separate (see #50)?See also #53 which discusses the idea of contexts to represent different types in python-flint and #54 which discusses the idea of having a low-level direct imitation of Flint's C API. Currently python-flint sort of sits in between a low and a high-level interface.
The question here is essentially whether python-flint's main interface should just be a nicer version of the low-level interface described in #54 or whether it should actually be more like the higher-level abstracted interface described in #53.