Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cohomology ring of simplicial complexes #6102

Closed
antieau mannequin opened this issue May 21, 2009 · 62 comments
Closed

cohomology ring of simplicial complexes #6102

antieau mannequin opened this issue May 21, 2009 · 62 comments

Comments

@antieau
Copy link
Mannequin

antieau mannequin commented May 21, 2009

Add functionality in sage to compute the cohomology ring of a simplicial complex.

This relies on #6099, #6100, and #5882.

These will be examples of graded alebras, finite as modules over their bases, that are graded-commutative.

Depends on #19179

CC: @jhpalmieri @sagetrac-fbreuer @tscrim @fchapoton

Component: algebraic topology

Author: John Palmieri, Travis Scrimshaw

Branch/Commit: 9bfc2d2

Reviewer: Travis Scrimshaw, John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/6102

@antieau antieau mannequin added this to the sage-5.11 milestone May 21, 2009
@antieau antieau mannequin self-assigned this May 21, 2009
@jhpalmieri
Copy link
Member

comment:1

The following code was posted by Felix Breuer on sage-support

def cup_product(X,c1,dim1,c2,dim2):
    d = dim1 + dim2 
    faces1 = list(X.n_faces(dim1))
    faces2 = list(X.n_faces(dim2))
    faces = list(X.n_faces(d))
    res = []
    for sigma in faces:
        sigma1 = Simplex(sigma[0:dim1+1])
        sigma2 = Simplex(sigma[dim1:d+1])
        index1 = faces1.index(sigma1)
        index2 = faces2.index(sigma2)
        coeff1 = c1[index1]
        coeff2 = c2[index2]
        coeff = coeff1 * coeff2
        res.append(coeff)
    return vector(tuple(res))

To use it on the Torus, for example, you can do this:

X = simplicial_complexes.Torus()
C = X.chain_complex(cochain=True)
H = C.homology(generators=True)
gen1 = H[1][1][0]
gen2 = H[1][1][1]
d1 = C.differential()[1]
q = cup_product(X,gen1,1,gen1,1)
print q
print d1.solve_right(q)
p = cup_product(X,gen1,1,gen2,1)
print p
print d1.solve_right(p) #error

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@jhpalmieri
Copy link
Member

Dependencies: #19179

@jhpalmieri
Copy link
Member

Branch: u/jhpalmieri/AT-model

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri
Copy link
Member

Commit: 763a8a8

@jhpalmieri
Copy link
Member

comment:9

Here is an initial attempt.


New commits:

dece275trac 19179: chain homotopies, chain contractions, and duals of chain maps
763a8a8trac 6102: cup products, cohomology rings, mod 2 cohomology operations

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 10, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

d7b9ed4change AssertionError to other errors
d63774bMerge branch 'chains' into AT-model
c0918b8change AttributeErrors to other errors

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 10, 2015

Changed commit from 763a8a8 to c0918b8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 11, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

d65ba8dtrac 19179: change `_repr_` for chain maps, chain homotopies
c38751bMerge branch 'chains' into AT-model
f70e3a2trac 19179: doctest fixes for `_repr_` changes
92b17e8Merge branch 'chains' into AT-model
6cd5b7ctrac 6102: doctest fixes for `_repr_` changes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 11, 2015

Changed commit from c0918b8 to 6cd5b7c

@jhpalmieri

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 12, 2015

Changed commit from 6cd5b7c to 869636b

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 12, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

4e50776trac 19179: hashing of chain maps, chain homotopies
869636bMerge branch 'chains' into AT-model

@jhpalmieri
Copy link
Member

comment:15

#18246 broke the default hashing of chain homotopies, so I've added a __hash__ method, and also one for chain maps. This is necessary so that we can cache the methods algebraic_topological_model, homology_basis, and cohomology_ring in cell_complex.

@jhpalmieri
Copy link
Member

comment:37

Turns out that cup products for Delta complexes weren't too hard to implement, so I did that.


New commits:

d00d31btrac 6102: cup products for Delta complexes

@jhpalmieri
Copy link
Member

Changed commit from 716469a to d00d31b

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 12, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

12d4cc7trac 6102: fix typo "left" -> "right"

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 12, 2015

Changed commit from d00d31b to 12d4cc7

@tscrim
Copy link
Collaborator

tscrim commented Oct 13, 2015

comment:39

I'm still working on my refactoring, but I did #19397 for getting the degree d components.

@tscrim
Copy link
Collaborator

tscrim commented Oct 13, 2015

Changed branch from u/jhpalmieri/AT-model to u/tscrim/AT-model

@tscrim
Copy link
Collaborator

tscrim commented Oct 13, 2015

Changed commit from 12d4cc7 to 3751753

@tscrim
Copy link
Collaborator

tscrim commented Oct 13, 2015

comment:40

Done. I spent so much time trying to get the cup_product to iterate over cohomology, but I realized that it was support to be over homology... Anyways, it works now. With the category framework, I was able to remove __pow__ (at a small cost of a not correct error for negative powers, at least for now I didn't want to muck with the AlgebrasWithBasis code). So if you're happy with my changes, then you can set a positive review.


New commits:

8b59ed3Making (co)homology into a graded module (algebra).
3751753Making Sq work for inhomogeneous elements.

@jhpalmieri
Copy link
Member

comment:41

I will have some reviewer's changes on top of your changes soon. Meanwhile, I noticed that you removed the code related to the FiniteDimensionalAlgebra class. I don't know much about that class, and I don't mind the removal of that code. We could also reinstate it as a method for the class CohomologyRing ("exporting" it as a FiniteDimensionalAlgebra). Is that worth doing?

@tscrim
Copy link
Collaborator

tscrim commented Oct 15, 2015

comment:42

No, the CohomologyRing class takes the place of the FiniteDimensionalAlgebra. Was there something in that class that you were using that this version can't do? If there was, it is probably something we should generalize (on a followup ticket).

@jhpalmieri
Copy link
Member

comment:43

There isn't anything that I was using, but it has some methods (cardinality, is_unitary, is_commutative) that I suppose some people might want.

@tscrim
Copy link
Collaborator

tscrim commented Oct 15, 2015

comment:44

The cardinality should work, but it is not there and is something we should implement in generality. A default is_unitary that returns True could perhaps go in UnitalAlgebras, but the cohomology ring is unital as the sum of the 0-th degree components, correct (you had this in your __pow__ method too)? There should be a generic is_commutative test for finite dimensional algebras with basis. I will open up a separate ticket when I get to my office.

@tscrim
Copy link
Collaborator

tscrim commented Oct 15, 2015

comment:45

This is now #19416.

@jhpalmieri
Copy link
Member

Changed branch from u/tscrim/AT-model to u/jhpalmieri/AT-model

@jhpalmieri
Copy link
Member

Changed commit from 3751753 to 9bfc2d2

@jhpalmieri
Copy link
Member

comment:47

Okay, your turn again. If you're happy with these changes, set it to positive review. A summary of my changes:

  • various documentation fixes: some docstrings didn't get changed in your refactoring, some cross-references didn't work, etc.
  • I moved several instances of if base_ring is None to the methods in cell_complex.py. Before, some were there but some were in algebraic_topological_model.py.
  • I removed the explicit check about immutability for simplicial complexes because it wasn't being used: once we cache the method, immutability is checked as soon as the method is called, so checking again in the method is redundant. (And if we ever decide that the method should not be cached, there is no reason to check immutability.)

@jhpalmieri
Copy link
Member

Changed author from John Palmieri to John Palmieri, Travis Scrimshaw

@jhpalmieri
Copy link
Member

Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, John Palmieri

@tscrim
Copy link
Collaborator

tscrim commented Oct 15, 2015

comment:49

Then it is a positive review. This is a very nice addition to Sage which I'm hoping to get some good use from (especially once #18175 and more of SageManifolds gets merged in). Thanks for all your work.

@jhpalmieri
Copy link
Member

comment:51

Great! Thanks very much.

@vbraun
Copy link
Member

vbraun commented Oct 18, 2015

Changed branch from u/jhpalmieri/AT-model to 9bfc2d2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants