Simon et al,
if you design a Python-ic interface how to construct all the term orderings we
are still missing in Sage from Singular (e.g. weighted term orderings), then I
might find the time to implement them. For me, it is mainly an interface
design question, the libSingular part looks relatively easy (and we have
[libsingular-devel] now, where every of my questions was answered very quickly
so far!).
As a starting point, the TermOder objects might be interesting?
sage: A = random_matrix(ZZ,3,3)
sage: TermOrder(A)
???
Cheers,
Martin
PS: Did you play with the new libsingular functions functionality in
4.1.2.alpha? It might help you out with your supercommutative rings. The
libsingular functions are not feature complete yet though.
--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de
Can you also provide example sage sessions showing how you think these
objects should be constructed?
I completely agree with Martin's previous comments on this. :)
> if you design a Python-ic interface how to construct all the term
> orderings we are still missing in Sage from Singular (e.g. weighted
> term orderings), then I might find the time to implement them. For
> me, it is mainly an interface design question, the libSingular part
> looks relatively easy (and we have [libsingular-devel] now, where
> every of my questions was answered very quickly so far!).
I was planning to send a separate message about this topic, but since
Michael brought it up here it goes...
Is there anybody else interested in a wrapper for the noncommutative
functionality provided by Singular?
Singular's capabilities are described in the manual here:
http://www.singular.uni-kl.de/Manual/latest/sing_356.htm#SEC397
If you're interested please write back with the following information
- what exactly are your needs
- ideas for a possible user interface (example Sage session)
- if you can contribute to the development (testing patches and
designing an interface is also a contribution)
BTW, I will also be working on using Singular for rational function
fields, and (as time permits) maybe also algebraic function fields. I
would appreciate any help in that area as well.
Cheers,
Burcin
On Fri, Sep 4, 2009 at 7:33 AM, Burcin Erocal<bur...@erocal.org> wrote:
> Is there anybody else interested in a wrapper for the noncommutative
> functionality provided by Singular?
>
> Singular's capabilities are described in the manual here:
>
> http://www.singular.uni-kl.de/Manual/latest/sing_356.htm#SEC397
>
> If you're interested please write back with the following information
> - what exactly are your needs
> - ideas for a possible user interface (example Sage session)
> - if you can contribute to the development (testing patches and
> designing an interface is also a contribution)
Great! In quantum physics, one needs to work with quantum operator
that are non-commuting objects. There, we often need to check whether
commutator or anti-commutator of two composite operators are zero or not.
An example session would be:
----------
sage: A,B = nc_var('A,B')
sage: a,b,c,d = var('a,b,c,d')
sage: C = a*A + b*A*A
sage: D = d*B
sage: commutator(C, D)
a*d*commutator(A,B) + b*d*A*commutator(A,B) + b*d*commutator(A,B)*A
sage: commuator.define([A,B], 1)
sage commutator(A, B)
1
sage: commutator(C,D)
a*d + 2*b*d*A
------------
Thanks,
Golam
> Of course, it seems natural to define a matrix ordering by passing a
> matrix:
> sage: M = Matrix(2,2, [1,3,1,0])
> sage: R.<x,y> = PolynomialRing(QQ,2,order=M)
>
> But it is perhaps not so nice to break compatibility with the current
> way of defining an ordering by strings.
>
> Closer to Singular syntax would be
> sage: R.<x,y> = PolynomialRing(QQ,2,order='M(1,3,1,0)')
Think this would be rather un-pythonic: converting an object into a string
instead of using it directly.
> But what about block orderings? If one allows a matrix ordering to be
> defined by a matrix, then I guess the blocks should be listed:
> sage: P.<a,b,c,d,e> = PolynomialRing(QQ,5,order=[M,'degrevlex'])
Have you seen this?
sage: TermOrder('deglex',3) + TermOrder('degrevlex',2)
deglex(3),degrevlex(2) term order
> Or, if one goes with strings:
> sage: P.<a,b,c,d,e> = PolynomialRing(QQ,5,order='M(1,3,1,0),degrevlex
> (3)'])
I would like to avoid this string business as much as possible. I find it
rather ugly (that's personal taste of course)
Cheers,
Martin
I should have mentioned earlier that long ago Michael Brickenstein and
I wrote a preliminary interface to Plural. You can find the patches
here:
http://trac.sagemath.org/sage_trac/ticket/4539
On Fri, 4 Sep 2009 04:27:25 -0700 (PDT)
Simon King <simon...@nuigalway.ie> wrote:
<snip>
> > Is there anybody else interested in a wrapper for the noncommutative
> > functionality provided by Singular?
> >
> > Singular's capabilities are described in the manual here:
> >
> > http://www.singular.uni-kl.de/Manual/latest/sing_356.htm#SEC397
> >
> > If you're interested please write back with the following
> > information
> > - what exactly are your needs
> > - ideas for a possible user interface (example Sage session)
>
> My needs are restricted to the SuperCommutative algebras. The
> implementation seems very efficient (two years ago I made some tests,
> and the basic arithmetic is as fast as in the commutative case).
>
> General non-commutative algebras are not needed to me, but would
> certainly be nice to have. The nc_algebras in Singular are given by
> two strictly upper triangular matrices, see
> http://www.singular.uni-kl.de/Manual/latest/sing_404.htm#SEC445
>
> So, one should expect that Sage should use two matrices as well.
This is not necessary. There is some code written by Michael that
converts the relations to a matrix, and passes that on to Singular
around line 396 of the patch here:
http://trac.sagemath.org/sage_trac/attachment/ticket/4539/plural_2.patch
Here is the doctest from that function:
sage: A.<x,y,z>=FreeAlgebra(QQ,3)
sage: G=A.g_algebra({y*x:-x*y})
sage: (x,y,z)=G.gens()
sage: x*y
x*y
sage: y*x
-x*y
sage: z*x
x*z
sage: (x,y,z)=A.gens()
sage: G=A.g_algebra({y*x:-x*y+1})
sage: (x,y,z)=G.gens()
sage: y*x
-x*y + 1
sage: (x,y,z)=A.gens()
sage: G=A.g_algebra({y*x:-x*y+z})
sage: (x,y,z)=G.gens()
sage: y*x
-x*y + z
IMHO, this is more user friendly compared to the Singular interface.
We shouldn't restrict ourselves to copying the Singular commands to
construct these objects.
We should also tie these to the FreeAlgebra stuff from the beginning.
Otherwise, we'll end up with a wrapper that lives independent of the
algebraic hierarchy like the PolyBoRi wrapper ended up being.
Thanks.
Cheers,
Burcin
Do you mean the Letterplace (why do they capitalize the names of
these things?!?) extension [1] ?
[1] http://www.singular.uni-kl.de/Manual/latest/sing_425.htm#SEC478
I am not sure if using this directly for arithmetic from Sage is a good
idea, since you need to give a bound on the degree of each variable
that will appear in your computation (and we also need to fix the
printing anyway). I was thinking of hooking up the GB functions only to
the appropriate places (which don't exist at the moment).
Unfortunately this requires giving more care and attention to the
FreeAlgebra stuff in Sage than I have time for, so it will have to wait
till someone else takes it up.
Cheers,
Burcin
It's independent. It was just a quick effort to use Plural from Sage. I
didn't have time afterwards to follow up and fix the remaining
problems. I don't even know if the patches still apply.
I'm hoping that things will be easier now since there is a much cleaner
interface to libSingular (many thanks Martin and Michael!). Though
sage/algebras/ is still one of the most rusty corners of sage. :)
Cheers,
Burcin
You're right, it is equivalent to the G-algebras defined in Singular.
Checking these conditions is one of the items on the list below. :)
> Since there is http://trac.sagemath.org/sage_trac/ticket/4539 and it
> says "need work": What exactly is needed to do? Is it just a decision
> about the interface? In that case, I am +1 to your suggestion!
No, unfortunately it's not that easy.
- We just subclassed MPolynomialRing_libsingular to create the ring
then, elements are instances of MPolynomial_libsingular. These
inherit from CommutativeRing and CommutativeRingElement
respectively. :)
One would have to create new classes for the elements and the parent
in the appropriate place of the hierarchy. Refactoring the
libSingular calls in the above classes helps tremendously here. :)
- Check if the commutativity relations satisfy the conditions for a
G-algebra as defined here:
http://www.singular.uni-kl.de/Manual/latest/sing_420.htm#SEC461
- sort out coercion
- wrap various functions defined by Singular:
http://www.singular.uni-kl.de/Manual/latest/sing_390.htm#SEC431
- find a way to wrap the predefined structures here:
http://www.singular.uni-kl.de/Manual/latest/sing_538.htm#SEC591
- etc.
Any volunteers?
Cheers,
Burcin
Sure, it is rather ad-hoc at the moment. As soon as we have an interface we
want to expose to the user (maybe TermOder(Matrix) suffices?) we can fix that!