Submodules need to do linear algebra to compute a basis from the generating set, as well as to pullback vectors into the subspace. The best way that I know of to do linear algebra is to write everything in terms of matrices, and so you need an ordering of your indices. Before, this feature of ordering the ambient module's support was creating this list, but it was hidden under a few layers. Once you allow the user to choose the order, you get different objects (such as different echeleonizations of the basis) I thought I had made this change to be backwards compatible (https://trac.sagemath.org/ticket/19448), but I did not take into account subclasses. Thinking about it more, there should be a mechanism to use the default ordering of the indexing objects. There is definitely some more work that can be done.
Additionally, you should be able to bypass the need for creating the list by overriding the _support_key method and then just passing None for support_order. (Note that the _support_key is important for doing any linear algebra in the submodule as it gives the ordering of the basis elements.) Best, Travis On Tuesday, November 24, 2020 at 12:20:52 AM UTC+10 hel...@potuz.net wrote: > On Nov 23, Andrew wrote: > >Sometime recently, possibly because of python3, the required argument > >`support_order` was been added to the class > > > > `sage.modules.with_basis.subquotient.SubmoduleWithBasis`. > > > >The documentation says: > > > > ``support_order`` -- an ordering of the support of ``basis`` expressed in > >``ambient`` given as a list > > > >I have a derived class of `SubmoduleWithBasis` that used to work and I am > >trying to understand what is required here. I am a little surprised that > a list > >is expected because it can be expensive to compute indexing sets for > bases, but > >perhaps this is deemed acceptable when constructing submodules? > > > >More to the point, can someone tell me what the documentation for > >`support_order` actually means? If the ambient space has indexing set > {1,2,3} > >and basis {x1,x2,x3} and my submodule is spanned by {x1+x2} then I would > think > >that the support should be {1,2}. Is `support_order` meant to tell me what > >order I should walk through the indexing set when rewriting elements of > the > >submodule in terms of its basis? I honestly don't know is required except > that > >`support_order` must have an `index` method. > > > >As far as I can see the only place that `support_order` is used is ub the > >method `_support_key`where it becomes the `key` in a `module_morphism` in > the > >`list` method of `SubmoduleWithBasis`. > > > This was implemented not long ago to be able to handle submodules of an > infinite dimensional module. I do agree that passing a list is often times > not > necessary and expensive. I experienced a similar problem when subclassing > this > and constructing infinite dimensional submodules. I bypassed the whole > construction by using enumerated sets instead of lists for the bases. You > only need > a `__getitem__` and an `__iter__` method. The code I ended up using in > #29610 is in > > > https://git.sagemath.org/sage.git/tree/src/sage/algebras/vertex_algebras/vertex_algebra_ideal.py?h=u/heluani/vertex_algebras#n563 > > Cheers, > > R. > > >Andrew > > > > > > > > > >-- > >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 [1]sage-devel+...@googlegroups.com. > >To view this discussion on the web visit [2] > https://groups.google.com/d/msgid/ > >sage-devel/83e229a6-23fe-4380-acac-6ed71afeb27cn%40googlegroups.com. > > > >References: > > > >[1] mailto:sage-devel+...@googlegroups.com > >[2] > https://groups.google.com/d/msgid/sage-devel/83e229a6-23fe-4380-acac-6ed71afeb27cn%40googlegroups.com?utm_medium=email&utm_source=footer > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/721b0002-d458-4c4b-9556-98ff81b9e457n%40googlegroups.com.