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, 21 Aug 2020 14:41:36 +0200Cohomology ring of a Lie algebrahttps://ask.sagemath.org/question/53129/cohomology-ring-of-a-lie-algebra/I would like to compute the cup products in cohomology for certain families of nilpotent Lie algebras over R.
So far I could access to the cochain complex and compute the Betti numbers using the method chevalley_eilenberg_complex(). On the other hand, I see that the cup product of the cohomology ring of a cell complex can be computed.
So, is there a way to compute the cup products starting from the Lie algebra?
(Note that the Lie algebras that I consider are not always defined over the rational field, so that the cohomologies that I am interested in is not always that of a space of which I could describe the homotopy type by giving a cell complex.)
EDIT (2020-10-26): Problem not solved, but I found a seemingly related issue: https://trac.sagemath.org/ticket/6100 .
Namely, chain_complex().homology(generators=true) uses a basis in which the simplices are listed in an order that seems intractable (especially, not the lexicographic order).
If one could guess in which order the simplices are listed, then I would be able to compute the cup products.Gabriel PallierFri, 21 Aug 2020 14:41:36 +0200https://ask.sagemath.org/question/53129/Hochschild cohomology of a matrix subalgebrahttps://ask.sagemath.org/question/51290/hochschild-cohomology-of-a-matrix-subalgebra/ Let $M_n(R)$ be the $n\times n$ matrix algebra over the polynomial ring $R=K[t]$. It is spanned by $\{e_{ij}; i,j\in[n]\}$.
> Let $A$ be a subalgebra of $M_n(R)$,
> spanned by $\{p_{ij}e_{ij}\}$, where
> $(i,j)$ ranges over some subset of
> $[n]\times[n]$ and $p_{ij}\in R$ are
> some polynomials. How can I compute
> with SageMath the hochschild
> (co)homology $HH^\ast(A;A)$?
So far, I know how to do some basics:
R.<t>=GF(3)[];
A.<x,y> = ExteriorAlgebra(QQ);
C = A.hochschild_complex(A); print(type(A),'\n',type(C))
show(C.homology(0),', ',C.homology(1),', ',C.homology(2))
show(C.cohomology(0),', ',C.cohomology(1),', ',C.cohomology(2))
However, I don't know how to create my matrix subalgebra $A$ over $R$. Also, I don't think this really computes hochschild cohomology. Is it dualised over $\mathbb{Q}$ or over $A=\Lambda_\mathbb{Q}[x,y]$?LeonWed, 06 May 2020 01:15:20 +0200https://ask.sagemath.org/question/51290/finite simplicial complexes, projective spaces, facets, giving strange outputhttps://ask.sagemath.org/question/49540/finite-simplicial-complexes-projective-spaces-facets-giving-strange-output/The [code](http://doc.sagemath.org/html/en/reference/homology/sage/homology/examples.html#sage.homology.examples.RealProjectiveSpace)
n=2; x=simplicial_complexes.RealProjectiveSpace(n);
fcts=x.facets(); out=file('P'+str(n)+'.txt','w');
for a in fcts: out.write(str(a)+'\n')
out.close();
writes a nice result in the file `P2.txt`:
(0, 2, 3)
(0, 3, 4)
(0, 1, 5)
(0, 4, 5)
(2, 3, 5)
(1, 2, 4)
(0, 1, 2)
(1, 3, 4)
(1, 3, 5)
(2, 4, 5)
This works for $n=1,\ldots,4$. However, for $n=5$, the file contains
((1, 5, 6), (1, 6), (1, 3, 5, 6), (6,), (2,), (2, 4))
((1, 2, 4, 6), (5,), (1, 4), (3, 5), (4,), (1, 4, 6))
((3, 4, 6), (1, 3, 4, 5, 6), (4, 6), (1, 3, 4, 6), (6,), (2,))
((1, 5, 6), (1, 2, 3, 4, 5, 6), (1, 3, 5, 6), (1,), (1, 5), (1, 3, 4, 5, 6))
((1, 6), (1, 3, 5, 6), (1,), (1, 2, 3, 5, 6), (1, 3, 6), (4,))
((1, 2), (3,), (3, 5, 6), (1, 2, 4), (3, 5), (2,))
((1, 2), (1,), (3,), (3, 6), (1, 2, 4), (1, 2, 4, 5))
((1, 2), (1,), (1, 2, 3, 6), (4, 5), (1, 2, 6), (4,))
((2, 3, 4), (2, 3, 4, 5), (1, 2, 3, 4, 5), (2, 3), (6,), (2,))
((1, 3, 4, 5), (1, 3, 4, 5, 6), (5,), (3, 5), (2,), (3, 4, 5))
...
What am I doing wrong here? Why don't I get a list of 5-dimensional simplices?
I would like to obtain only the facets of the first 10 projective spaces.LeonTue, 14 Jan 2020 08:34:00 +0100https://ask.sagemath.org/question/49540/What does cohomology_generators actually do?https://ask.sagemath.org/question/46609/what-does-cohomology_generators-actually-do/ I don't understand the output of the function "cohomology_generators" of commutative differential graded algebras. Look at this simple exmaple:
A.<x,y,z,t> = GradedCommutativeAlgebra(QQ, degrees = (2,2,1,2))
B = A.cdg_algebra({z:x-y})
B.cohomology_generators(5)
{2: [t, y, x]}
It's apparently telling me that t, x and y are all generators of the cohomology algebra in degree 2. But in cohomology, x = y, since dz = x - y!wutututTue, 21 May 2019 16:46:44 +0200https://ask.sagemath.org/question/46609/ChainComplex() runs 24 times slower than homology()https://ask.sagemath.org/question/44101/chaincomplex-runs-24-times-slower-than-homology/I load a list of matrices `bdrs` representing a chain complex, their dimensions are
{1, 21, 210, 1330, 5985, 20349, 54264, 116280, 203490, 293930, 352716, 352716, 293930, 203490, 116280, 54264, 20349, 5985, 1330, 210, 21, 1}, and the largest has density 3.91*10^-6. In total they take up 50MB of disk space. This finishes in 63sec.
When I run `chcx=ChainComplex(bdrs,base_ring=GF(2))`, it takes 7hrs20min, but `chcx.homology()` finishes in only 18min. **Why does it take so long to just store a few matrices?** At first I thought that `ChainComplex()` also does some simplifications/reductions, but `[chcx.free_module_rank(i) for i in range(0,21)]` shows the original dimensions of matrices :/.
**Is there a faster way to compute the homology** of a chain complex (over $\mathbb{Z}$ or $\mathbb{Z}_p$)?LeonSun, 28 Oct 2018 09:55:39 +0100https://ask.sagemath.org/question/44101/Finite generated algebra cohomologyhttps://ask.sagemath.org/question/41661/finite-generated-algebra-cohomology/ I have an algebra and a differential over this algebra. I want to construct cohomology ring and find the annihilators of some elements. How could I do that with sage?
My algebra looks like:
variables = ', '.join(['u{}'.format(i+1) for i in range(n)] + ['v{}'.format(j+1) for j in range(n)])
F = FreeAlgebra(ZZ, n+n, variables)
gens = F.gens()
u = gens[:n]
v = gens[n:]
print u
print v
I = []
# Koszul
for i in range(5):
for j in range(i+1, 5):
I.append(u[i]*u[j] - u[j]*u[i])
# Stanley-Raysner
for i in range(5):
for j in range(i+1, 5):
if j - i != 1 and j-i != 4:
I.append(v[i]*v[j])
A = F.quotient(F * I * F)
SahDoumTue, 20 Mar 2018 21:16:16 +0100https://ask.sagemath.org/question/41661/Build algebra cohomologyhttps://ask.sagemath.org/question/41660/build-algebra-cohomology/I have an algebra and a differential over this algebra. I want to construct cohomology ring and find the annihilators of some elements. How could I do that with sage?
My algebra looks like:
variables = ', '.join(['u{}'.format(i+1) for i in range(n)] + ['v{}'.format(j+1) for j in range(n)])
F = FreeAlgebra(ZZ, n+n, variables)
gens = F.gens()
u = gens[:n]
v = gens[n:]
print u
print v
I = []
# Koszul
for i in range(5):
for j in range(i+1, 5):
I.append(u[i]*u[j] - u[j]*u[i])
# Stanley-Raysner
for i in range(5):
for j in range(i+1, 5):
if j - i != 1 and j-i != 4:
I.append(v[i]*v[j])
A = F.quotient(F * I * F)
SahDoumTue, 20 Mar 2018 21:13:23 +0100https://ask.sagemath.org/question/41660/How 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.ronnoThu, 22 Jun 2017 22:03:06 +0200https://ask.sagemath.org/question/38060/Test for zero cup producthttps://ask.sagemath.org/question/33331/test-for-zero-cup-product/How can I check whether the cohomology ring H^*(X) of a simplicial complex X has zero cup product (like, say, for X a wedge of spheres). I have a long list of simplicial complexes, so I need a fully algorithmic approach. I probably should start with X.cohomology_ring(QQ) but I don't know what to do next...
Btw, I am a sage newbie.
MathrocksFri, 06 May 2016 18:50:24 +0200https://ask.sagemath.org/question/33331/