On Wed, Feb 20, 2008 at 1:22 PM, John Palmieri <[EMAIL PROTECTED]> wrote:
>
> By the way, is the following a bug?
>
>
> sage: singular.LIB('ncall.lib')
> sage: R=singular.ring(0,'(x1,x12,x2)','dp')
> sage: C=singular.matrix(3,3,'1,-1,-1, -1,1,-1, -1,-1,1')
> sage: C
>
>
> 1, -1,-1,
> -1,1, -1,
> -1,-1,1
> sage: R=singular.ring(0,'(x1,x12,x2)','dp')
> sage: C
> `sage1`
>
> Calling singular.ring(...) seems to redefine C.
>
> (I discovered this because when I was making a copy of the algebra S,
> I wanted to use the same matrix C for the copy, but by that point it
> had been redefined to be `sage1`, to my surprise.)
No, it is not a bug. It's a perfect example of how
Singular itself has a rather -- let's say old fashioned -- user
interface and language. That's what I was trying to convey
to you earlier today in my office: Singular best at doing
exactly one thing at a time, and no more.
That's why code that we've written that combines
Sage and Singular is vastly nicer to use than just
plain Singular. The main problem for you of course
is that nobody has written any such code that "wraps"
noncommutative functionality in Singular yet.
I would sit down and try to fix this right now, but I have too
many other things on my plate, and I've been jumping
into every basic thing that needs to get done in
Sage for 3 years; that has to stop or I won't have
enough time to do my own research.
-- William
>
>
> On Feb 20, 12:47 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
>
>
> > On Feb 20, 2008 12:30 PM, Simon King <[EMAIL PROTECTED]> wrote:
> >
> > > Dear all,
> >
> > > On Feb 20, 8:56 pm, John Palmieri <[EMAIL PROTECTED]> wrote:
> > > <snip>
> > > > I'm a little surprised that it's not easy to take a tensor product of
> > > > an algebra with itself; I can't imagine I'm the only person who wants
> > > > to use this sort of thing to study Hopf algebras (not to mention
> > > > things like A-infinity algebras...).
> >
> > > Certainly (as a former student of V. Turaev) i agree!
> >
> > > I just tested whether
> > > sage: R=singular.ring(0,'(x,y,z)','dp')
> > > has a __copy__ method. It hasn't!
> >
> > > Would it be a reasonable idea to implement such method, so that
> > > copy(R)
> > > yields a ring that is isomorphic with R but has different variable
> > > names (e.g., by adding a prime to the variable names)?
> >
> > No, that would not be reasonable. [[woah, John Palmieri just appeared
> > in my office... chat for a while...] Anyway, copy should return an exact
> > copy since that's the semantics of __copy__ in Python. However,
> > I strongly encourage you to write a method like you describe and
> > just call it something slightly different, e.g.,
> > def change_names(self, ...):
> >
> > or
> >
> > def copy_with_names_changed(...):
> >
> > or whatever. Just anything but "copy".
> >
> >
> >
> > > Then, John (and many others) could do
> > > S=R+copy(R)
> > > S.setring()
> > > which should be reasonably short.
> >
> > > I think, without creating new variable names R+R doesn't make much
> > > sense.
> >
> > > More generally, i believe it'd be a good idea to have a __copy__
> > > method for *any* Sage objects defined via the Singular interface.
> >
> > > E.g., when one defines a matrix
> > > sage: D=singular.matrix(3,3,'a,b,c, a**2,b**2,c**2, a**3,b**3,c**3')
> > > then
> > > C=copy(D)
> > > should be a copy of D (in the same ring). Up to now, one obtains
> > > sage: C=copy(D)
> > > sage: C
> > > (invalid object -- defined in terms of closed session)
> >
> > I would certainly be all for that too!
> >
> > Any chance you could write it, or do I have to?
>
> I might consider writing it, but I'm probably not the best person for
> the job, since I'm completely new to Sage and programming with it.
>
> > -- William
>
>
>
> >
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---