#16508: Add Commutative graded differential algebras.
-------------------------------------+-------------------------------------
       Reporter:  mmarco             |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  algebra            |   Resolution:
       Keywords:  sd58, sd59,        |    Merged in:
  algebras, nonconmutative, graded   |    Reviewers:
        Authors:  mmarco             |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  61487e692af1d715e7cc4281714b7fb0705c542f
  u/mmarco/ticket/16508              |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by jhpalmieri):

 Here is a new branch: u/jhpalmieri/DGA_new. (Is there some sort of markup
 I can give to make that an active link? Should we make it the official
 branch attached to this ticket?)

 This is a complete rewrite based on Miguel's version, and so built on top
 of `QuotientRing_nc`. Changes:

 - I removed all of the category stuff. That can go on a separate ticket
 (#16513).

 - I added the option to multi-grade the objects, using commands like
 {{{
 A.<x,y,z> = CDGAlgebra(QQ, degrees=((1,0), (0,1), (2,0)))
 }}}

 - Tinkered with documentation. Added the main file to the reference
 manual.

 - Various code modifications and clean up. Among other things:

 - Sped up `GCAlgebra.homogeneous_part`. The old version was
 `GCAlgebra.homogeneous_part`, the new version `GCAlgebra.basis`. In my
 current code, there is some caching going on, but when doing these
 timings, I disabled the caching.
 {{{
 sage: A.<t,x,y,z> = CDGAlgebra(QQ, degrees=(1,1,2,4))
 sage: A.homogeneous_part(10)
 [y*z^2, t*x*z^2, y^3*z, t*x*y^2*z, y^5, t*x*y^4]
 sage: A.basis(10)
 [t*x*z^2, t*x*y^2*z, t*x*y^4, y*z^2, y^3*z, y^5]
 sage: sorted(A.homogeneous_part(10)) == sorted(A.basis(10))
 True
 sage: sorted(A.homogeneous_part(40)) == sorted(A.basis(40))
 True
 sage: timeit('A.homogeneous_part(40)') # original version
 5 loops, best of 3: 440 ms per loop
 sage: timeit('A.basis(40)')            # new version
 25 loops, best of 3: 12.9 ms per loop
 }}}

 - Sped up `_call_` method for `CDGA_Differential`:
 {{{
 sage: A.<t,x,y,z> = CDGAlgebra(QQ, degrees=(1,1,2,4))
 sage: B = CDGAlgebra(A, differential={t:y, x:y})
 sage: a = t*x*y**20*z**20
 sage: timeit('B.differential()._call1_(a)')   # original version
 25 loops, best of 3: 19.6 ms per loop
 sage: timeit('B.differential()._call3_(a)')   # new version
 125 loops, best of 3: 2.38 ms per loop
 }}}

 - Rewrote `is_homogeneous` based on other such methods elsewhere in Sage.
 It's slightly faster this way.

 - Should it be "commutative graded algebra" or "graded commutative
 algebra"? I think the second is more standard – for example, the phrase
 "graded commutativity" is commonly used – and after some thought, that's
 what I used in the rewrite. ("Commutative graded algebra" sounds like a
 graded algebra that happens to be commutative, implying strict
 commutativity. In "graded commutative algebra", "graded" modifies both
 "commutative" and the algebra, so the algebra is graded and the
 commutativity has a sign coming from the grading. According to Google
 search, there are about four times as many hits for "graded commutative
 algebra" compared to "commutative graded algebra". Similarly for a search
 on http://mathoverflow.net.)

 - On the other hand, "differential graded algebra" is completely standard,
 and so is "commutative differential graded algebra". So the adjectives are
 not ordered consistently in the different types of algebras.

 - So the main classes and functions are `GCAlgebra` and `CDGAlgebra`. The
 second of these is the only thing imported at the top-level.

 Comments and questions:

 1. `GCAlgebra._element_constructor_` works unexpectedly: if B and C are
 quotients of A, then you can convert elements of B to elements of C. For
 example:
 {{{
 sage: A.<x,y,z> = CDGAlgebra(QQ, degrees=(1, 2, 1))
 sage: B = A.quotient(A.ideal(z))
 sage: C = A.quotient(A.ideal(x*y))
 sage: C.inject_variables()
 Defining x, y, z
 sage: x*y
 0
 sage: B(x*y)
 0
 sage: B(x)*B(y)
 x*y
 }}}
  However, it looks like this is just a slightly modified version of the
 same method from `rings/quotient_ring.py`, so maybe we should leave it as
 is. Maybe that method could use some documentation, though.

 2. When initializing a graded commutative algebra, what should we do if
 neither ``names`` or ``degrees`` is specified (as in `GCAlgebra(QQ)`)?
 Right now I'm raising an error.

 3. `TestSuite` fails on these algebras:
 {{{
 The following tests failed: _test_elements, _test_pickling
 }}}
  Is that important?

--
Ticket URL: <http://trac.sagemath.org/ticket/16508#comment:25>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to