Allow quotient modules for PIDs

92 views
Skip to first unread message

Simon Brandhorst

unread,
Oct 12, 2017, 11:06:20 AM10/12/17
to sage-devel
sage: L.<w> = NumberField(x^2 - x + 2)
sage: OL = L.ring_of_integers()
sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
sage: FGP_Module(V,W)
This works

sage: V.quotient(W)
NotImplementedError: quotients of modules over rings other than fields or ZZ is not fully implemented


Well FGP looks pretty implemented to me.

Objections?

Simon Brandhorst

unread,
Oct 12, 2017, 11:07:17 AM10/12/17
to sage-devel
If forgot to add

sage: from sage.modules.fg_pid.fgp_module import FGP_Module

David Roe

unread,
Oct 12, 2017, 11:25:53 AM10/12/17
to sage-devel
I would try
sage: X = V.quotient(W)
sage: TestSuite(X).run()

and see if there are failures.  I know the implementation of FGP_Module was eventually intended for other PIDs as well, so I think it's a good idea as long as we have enough tests.
David

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscribe@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Simon Brandhorst

unread,
Oct 12, 2017, 11:48:18 AM10/12/17
to sage-devel
O.K. I will do that. Even if we do not have enough tests. Maybe we can allow it and print some
"This code is still experimental" warning. After all it will only get really stable is people use it a lot.

On Thursday, October 12, 2017 at 5:06:20 PM UTC+2, Simon Brandhorst wrote:

William Stein

unread,
Oct 12, 2017, 2:35:14 PM10/12/17
to sage-...@googlegroups.com
Hi,

I'm really happy to hear people are giving this code some attention!

I wrote the original FGP package.  At the time, there was no support for computing HNF or anything else except for ZZ, so I couldn't even test or try the algorithms there.  I **might** have made some assumptions about the base ring being ZZ for simplicity due to this, but I hope I didn't.  I don't remember -- it was a long time ago.  

The only reason this hasn't moved forward after more support for HNF was added for other PIDs is that I'm busy with other things these days.   I hope somebody else will take over.    If I was working on this code, I would go through the module and add a ton of doctests analogous to the existing tests over ZZ, but over some other PID's.   I definitely, definitely would NOT even consider just enabling this functionality with a warning message, and crossing my fingers like Simon seems to be suggestion below.  I strongly object to that.   I endorse:

 - enable the functionality 
 - write a bunch of new doctests showing how (and that) it works.  
 - then release it publicly.

If it does work, doing the above is maybe 1 day of work.  If it doesn't work, so the above is much harder than 1 day of work, then we shouldn't have released it in the first place.  

Again, Simon, I'm really happy you're looking into this and making this more general functionality available.  I was pretty happy with my original FGP implementation, which was a lot of work one summer years ago...

 -- William

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
--
-- William Stein

Simon Brandhorst

unread,
Oct 13, 2017, 3:07:00 AM10/13/17
to sage-devel
Yep, adding doc tests over other rings is the minimum requirement.  I can do that.
Yet I would print a warning message for some time. I would expect some bugs to be leftover in any case.
-- Simon

Simon Brandhorst

unread,
Oct 13, 2017, 3:14:36 AM10/13/17
to sage-devel
https://trac.sagemath.org/ticket/24027

In order to do good testing. Do we have a nice list of PIDs?

Simon Brandhorst

unread,
Oct 13, 2017, 3:37:25 AM10/13/17
to sage-devel
The testsuite runs now. A long list of rings would be helpful.

Some Pids i care about:
ZZ[\zeta_n] of degree <= 20, (they are in fact euclidean)
QQ(\sqrt(d)) of class number one.
F[x] for F any field. (probably these are not really working well enough)

More ideas?

John Cremona

unread,
Oct 13, 2017, 4:59:13 AM10/13/17
to SAGE devel
On 13 October 2017 at 08:37, Simon Brandhorst <sbran...@web.de> wrote:
> The testsuite runs now. A long list of rings would be helpful.
>
> Some Pids i care about:
> ZZ[\zeta_n] of degree <= 20, (they are in fact euclidean)
> QQ(\sqrt(d)) of class number one.
> F[x] for F any field. (probably these are not really working well enough)

How about a PID whcih is *not* Euclidean such as Z[a] with a^2+a+5=0
(i.e. ring if integers in Q(sqrt(-19))?

Simon Brandhorst

unread,
Oct 13, 2017, 7:49:35 AM10/13/17
to sage-devel
{{{
sage: L.<a> = CyclotomicField(5)
sage: OL= L.ring_of_integers()
sage: OL
Maximal Order in Cyclotomic Field of order 5 and degree 4
sage: M=Matrix(OL,2,[1-a,0,a,1+a])
sage: a.parent()
Cyclotomic Field of order 5 and degree 4
sage: a*M
---------------------------------------------------------------------------
....
TypeError: unsupported operand parent(s) for *: 'Cyclotomic Field of order 5 and degree 4' and 'Full MatrixSpace of 2 by 2 dense matrices over Maximal Order in Cyclotomic Field of order 5 and degree 4'
sage: M=Matrix(L,2,[1-a,0,a,1+a])
sage: a*M
[-a^2 + a        0]
[     a^2  a^2 + a]

Simon Brandhorst

unread,
Oct 22, 2017, 12:26:22 PM10/22/17
to sage-devel
Before proceeding I do need some help please.

#24031 

Coercion between Matrices over orders and over the number field

also coercion between Vectors over orders and over the quotient field/number field is not working.  I am somewhat lost in the coercion model and do not know where to start here. 


As for the FGP_Module class, or in general:


Often matrices/vectors/scalar over the order and over the quotient field are multiplied.

Should one try to push as much as possible into the quotient field from the beginning? Or is it O.K. to rely on the coercion model. It is certainly more convenient to rely on coercion.

Reply all
Reply to author
Forward
0 new messages