In our example, how does DifferentialForms() know that there are three variables?
Also, note that the syntax F.<x,y,z> = ... would normally be a shorthand for something like F = ....; x,y,z = F.gens(). I can see a compomise where if you form DifferentialForms(X) where X is something suitable with gens called (say) x,y,z, then by dfault the gens of F would be called dx,dy,dz, obtained by concatenatinf "d" with the names of X. Does that make sense? John On 18 May 2010 16:32, William Stein <[email protected]> wrote: > On Tue, May 18, 2010 at 8:27 AM, jvkersch <[email protected]> > wrote: >> Dear all, >> >> I would like to follow up on my differential forms class query (http:// >> groups.google.be/group/sage-devel/browse_thread/thread/ >> 2feef1f0be557585/75173b6c6f52450d) with a question about Sage >> programming/invoking style. >> >> If R^n has coordinates x, y, ... (or whatever), then the algebra of >> differential forms is generated by the differentials dx, dy, ... (the >> differentials of each of the coordinate functions). So there's a one- >> to-one correspondence between generators and coordinates on the >> underlying space. Is it allowable programming practice to implement >> the DifferentialForms class so that the following construction becomes >> possible: >> >> sage: F.<x, y, z> = DifferentialForms() >> sage: F.gens() >>>>>> (dx, dy, dz) >> >> but also >> sage: x in F.gens() >>>>>> False >> >> That is, should the names between <> be exactly the generators >> themselves, rather than something which can be made into a generator >> in a non-canonical way? >> >> I am not entirely comfortable with this approach, but in this way I >> avoid having to check whether the names, number, ... of generators are >> correct, since ParentWithBase.__init__ takes care of that. > > I'm definitely not comfortable with this; it seems like a recipe for > confusion. I have to admit that I don't at all understand your > argument for this. > > -- William > > -- > To post to this group, send an email to [email protected] > To unsubscribe from this group, send an email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
