ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 23 Jun 2017 02:45:44 +0200How do I find the image of an element of a differential algebra in the cohomlogy?https://ask.sagemath.org/question/38060/how-do-i-find-the-image-of-an-element-of-a-differential-algebra-in-the-cohomlogy/Following the documentation on Commutative Differential Graded Algebras, I have defined a differential graded algebra $C$. I have some element $x \in C$, in degree $4$. I can get a basis for the cohomology at degree 4 by
C.cohomology(4)
and generators for cocycles and coboundaries by
C.cocycles(4)
C.coboundaries(4)
How do I check if $x$ is a cocycle, and if it is, what it is in terms of the basis of the cohomology above?
I'm not sure I used the right tags, feel free to edit.Thu, 22 Jun 2017 22:03:06 +0200https://ask.sagemath.org/question/38060/how-do-i-find-the-image-of-an-element-of-a-differential-algebra-in-the-cohomlogy/Answer by John Palmieri for <p>Following the documentation on Commutative Differential Graded Algebras, I have defined a differential graded algebra $C$. I have some element $x \in C$, in degree $4$. I can get a basis for the cohomology at degree 4 by </p>
<pre><code>C.cohomology(4)
</code></pre>
<p>and generators for cocycles and coboundaries by </p>
<pre><code>C.cocycles(4)
C.coboundaries(4)
</code></pre>
<p>How do I check if $x$ is a cocycle, and if it is, what it is in terms of the basis of the cohomology above?</p>
<p>I'm not sure I used the right tags, feel free to edit.</p>
https://ask.sagemath.org/question/38060/how-do-i-find-the-image-of-an-element-of-a-differential-algebra-in-the-cohomlogy/?answer=38061#post-id-38061I don't think there is a one-line command to do what you want, but some combination of `basis_coefficients` and `cohomology_raw` should work.
sage: A.<a,b,c,d> = GradedCommutativeAlgebra(QQ, degrees = (1,1,1,2))
sage: C = A.cdg_algebra({a:b*c})
sage: x = C(a*c*d)
sage: x.differential() # one way to check whether x is a cocycle
0
sage: x.is_coboundary()
False
sage: x.basis_coefficients() # x as a raw basis vector
[0, 1, 0, 0]
sage: vector(x.basis_coefficients()) in C.cocycles(4) # another way to check whether x is a cocycle
True
sage: C.cohomology_raw(4)
Vector space quotient V/W of dimension 3 over Rational Field where
V: Vector space of degree 4 and dimension 4 over Rational Field
Basis matrix:
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
W: Vector space of degree 4 and dimension 1 over Rational Field
Basis matrix:
[1 0 0 0]Fri, 23 Jun 2017 02:45:44 +0200https://ask.sagemath.org/question/38060/how-do-i-find-the-image-of-an-element-of-a-differential-algebra-in-the-cohomlogy/?answer=38061#post-id-38061