Just fixing the == method is probably not good enough: On Thursday, September 21, 2017 at 4:10:10 PM UTC+2, Maarten Derickx wrote: > > > Note that there is no distinction between the FreeModule with > inner_product_matrix=matrix.identity(1)*2 and FreeQuadraticModusince the > sage object created in both ways is the same object. Not just equal, but > literally the same object in memory, so any change will automatically > affect both. > > FreeQuadraticModule(ZZ,1,matrix.identity(1)*2) is > FreeModule(ZZ,1,inner_product_matrix=matrix.identity(1)*2) > > I think it is good to open a ticket to make == also take the inner product > matrix into account, and I think no deprecation is needed since it fixes > something which is mathematically incorrect. > > One more subtle question is wether we want: > > sage: > FreeModule(ZZ,1)==FreeModule(ZZ,1,inner_product_matrix=matrix.identity(1)) > > I think so. It is mathematically the same thing. But just changing the == operator is not good enough. Then we also need to reconsider < ,<= etc.
Currently: " Modules are ordered by their ambient spaces, then by dimension, then in order by their echelon matrices. However, if other is a sub-module or is a quotient module then its comparison method is used instead of generic comparison. " Ambient spaces are ordered by rank and base ring. So I think that ambient spaces should be ordered by rank, inner_product_matrix, and then base ring. This change should take place in sage.modules.free_module.FreeModule_ambient One might need to adapt the hash function there? Objections? -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.