Sage: Ticket #26027: Implement morphisms for differential graded commutative algebras
https://trac.sagemath.org/ticket/26027
<p>
As reported on <a class="ext-link" href="https://ask.sagemath.org/question/42202/how-do-i-define-a-homomorphism-of-a-graded-commutative-algebra/"><span class="icon"></span>ask.sagemath.org</a>, homomorphisms have not been implemented for differential graded commutative algebras.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/26027
Trac 1.1.6jhpalmieriWed, 08 Aug 2018 22:01:32 GMTcc set
https://trac.sagemath.org/ticket/26027#comment:1
https://trac.sagemath.org/ticket/26027#comment:1
<ul>
<li><strong>cc</strong>
<em>tscrim</em> added
</li>
</ul>
<p>
This may involve implementing homomorphisms for <code>NCPolynomialRing_plural</code>. As it stands, I don't know a good way to check the noncommutative relations for a potential ring homomorphism. That is, if I have
</p>
<pre class="wiki">sage: A.<x,y> = GradedCommutativeAlgebra(QQ)
sage: R = A.cover_ring()
sage: R.relations()
{y*x: -x*y}
</pre><p>
how can I check whether <code>f(y*x) + f(x*y) == 0</code>? The issue is that <code>y*x</code> is an element of the free algebra on <code>x</code> and <code>y</code>, while <code>-x*y</code> is an element of <code>R</code>, but there is no way (as far as I can see) of coercing or converting elements of the free algebra to elements of its quotient <code>R</code>. For example, the construction of <code>R</code> as a <code>g_algebra</code> doesn't remember the original free algebra, and <code>R(y*x)</code> doesn't work.
</p>
TickettscrimWed, 08 Aug 2018 23:02:49 GMT
https://trac.sagemath.org/ticket/26027#comment:2
https://trac.sagemath.org/ticket/26027#comment:2
<p>
You could manually substitute in monomials variable-by-variable. It should be there automatically (e.g., in the <code>_element_constructor_</code> for g-algebras on the Sage side). I don't know off-hand how easy it would be to add that, but I imagine that would be easy enough to add.
</p>
TicketjhpalmieriTue, 04 Sep 2018 21:27:55 GMTbranch set
https://trac.sagemath.org/ticket/26027#comment:3
https://trac.sagemath.org/ticket/26027#comment:3
<ul>
<li><strong>branch</strong>
set to <em>u/jhpalmieri/dga-morphism</em>
</li>
</ul>
TicketjhpalmieriTue, 04 Sep 2018 21:29:04 GMTstatus changed; commit, author set
https://trac.sagemath.org/ticket/26027#comment:4
https://trac.sagemath.org/ticket/26027#comment:4
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>commit</strong>
set to <em>abe62ab57699966f8ab56141e19983f68238fec1</em>
</li>
<li><strong>author</strong>
set to <em>John Palmieri</em>
</li>
</ul>
<p>
Here is an implementation.
</p>
<hr />
<p>
New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit?id=abe62ab57699966f8ab56141e19983f68238fec1"><span class="icon"></span>abe62ab</a></td><td><code>trac 26027: morphisms for graded commutative algebras</code>
</td></tr></table>
TickettscrimSat, 08 Sep 2018 11:45:17 GMTreviewer set
https://trac.sagemath.org/ticket/26027#comment:5
https://trac.sagemath.org/ticket/26027#comment:5
<ul>
<li><strong>reviewer</strong>
set to <em>Travis Scrimshaw</em>
</li>
</ul>
<p>
Overall it looks good, but I have two comments:
</p>
<p>
I don't understand why you have an <code>_im_gens_</code> method for the elements. The <code>GCAlgebraMorphism._call_</code> will only used for one type of element. Since the necessary data is part of the element's API, you can just use it there. There does not need to be a need for this indirection (which means it could be a heavier maintenance burden).
</p>
<p>
Why are you using <code>self.parent()(0)</code> instead of <code>self.parent().zero()</code>?
</p>
TicketjhpalmieriSun, 09 Sep 2018 05:42:56 GMT
https://trac.sagemath.org/ticket/26027#comment:6
https://trac.sagemath.org/ticket/26027#comment:6
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/26027#comment:5" title="Comment 5">tscrim</a>:
</p>
<blockquote class="citation">
<p>
Overall it looks good, but I have two comments:
</p>
<p>
I don't understand why you have an <code>_im_gens_</code> method for the elements. The <code>GCAlgebraMorphism._call_</code> will only used for one type of element. Since the necessary data is part of the element's API, you can just use it there. There does not need to be a need for this indirection (which means it could be a heavier maintenance burden).
</p>
</blockquote>
<p>
Good idea. I've changed this.
</p>
<blockquote class="citation">
<p>
Why are you using <code>self.parent()(0)</code> instead of <code>self.parent().zero()</code>?
</p>
</blockquote>
<p>
Because that was in the code I copied from <code>free_algebra_element.py</code>. I've changed both to use <code>zero()</code> instead of <code>(0)</code>. If doctests pass, I will update the branch.
</p>
TicketgitSun, 09 Sep 2018 20:23:59 GMTcommit changed
https://trac.sagemath.org/ticket/26027#comment:7
https://trac.sagemath.org/ticket/26027#comment:7
<ul>
<li><strong>commit</strong>
changed from <em>abe62ab57699966f8ab56141e19983f68238fec1</em> to <em>9d79cdc8797764361918ffb668deb5cbdbcedc96</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=f6a8055699f658b10e5ad6dfe026263453993139"><span class="icon"></span>f6a8055</a></td><td><code>trac 26027: morphisms for graded commutative algebras</code>
</td></tr><tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=9d79cdc8797764361918ffb668deb5cbdbcedc96"><span class="icon"></span>9d79cdc</a></td><td><code>trac 26027: use self.zero() instead of self(0) in a few places.</code>
</td></tr></table>
TicketjhpalmieriSun, 09 Sep 2018 20:24:18 GMT
https://trac.sagemath.org/ticket/26027#comment:8
https://trac.sagemath.org/ticket/26027#comment:8
<p>
Here is the new branch.
</p>
TickettscrimSun, 09 Sep 2018 22:42:47 GMTstatus changed
https://trac.sagemath.org/ticket/26027#comment:9
https://trac.sagemath.org/ticket/26027#comment:9
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
</ul>
<p>
Thanks. LGTM.
</p>
TicketjhpalmieriSun, 09 Sep 2018 22:49:58 GMT
https://trac.sagemath.org/ticket/26027#comment:10
https://trac.sagemath.org/ticket/26027#comment:10
<p>
Thanks for the feedback and the review.
</p>
TicketvbraunTue, 11 Sep 2018 21:40:45 GMTstatus, branch changed; resolution set
https://trac.sagemath.org/ticket/26027#comment:11
https://trac.sagemath.org/ticket/26027#comment:11
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>branch</strong>
changed from <em>u/jhpalmieri/dga-morphism</em> to <em>9d79cdc8797764361918ffb668deb5cbdbcedc96</em>
</li>
</ul>
Ticket