Skip to content

Conversation

OP5642
Copy link
Contributor

@OP5642 OP5642 commented Sep 9, 2023

This PR provides the MomentAngleComplex class with its own cohomology ring (similar to the one which is available for simplicial, cubical and delta complexes). It requires its own separate class because we do not wish to compute this space explicitly (for efficiency reasons), but rather use a certain isomorphism which allows us to compute the cohomology ring more efficiently. The added class (CohomologyRing) is designed to mimic the already implemented class for cohomology rings by adding as many analogue methods as possible (most significant of which allows us to compute the cup product), but its structure differs fundamentally, and therefore must be a separate class.

This is a part of #35640 (GSoC 2023).

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@OP5642
Copy link
Contributor Author

OP5642 commented Sep 9, 2023

@tscrim

@OP5642 OP5642 force-pushed the cohomology_moment_angle_complex branch from c5a7fca to ffb12b6 Compare November 9, 2023 20:00
Copy link

github-actions bot commented Nov 9, 2023

Documentation preview for this PR (built with commit ffb12b6; changes) is ready! 🎉

@OP5642 OP5642 marked this pull request as ready for review September 16, 2024 16:55
Comment on lines +1083 to +1085

def one(self):
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def one(self):
"""
@cached_method
def one(self):
"""

So we don't have to repeatedly recompute it as it can be called often.

Actually, this is always just a single element $h^{0,0}$ right? If so, then you use should one_basis() and return that index (0, 0). This seems to be an assumption of _to_cycle_on_basis and product_on_basis.

Comment on lines +1379 to +1382
if self.is_one():
return self.parent()._complex.simplicial_complex().generated_subcomplex(set(), is_mutable=is_mutable)
vertex_set = self.parent()._gens[self.leading_support()[0]][self.leading_support()[1]][0]
return self.parent()._complex.simplicial_complex().generated_subcomplex(vertex_set, is_mutable=is_mutable)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.is_one():
return self.parent()._complex.simplicial_complex().generated_subcomplex(set(), is_mutable=is_mutable)
vertex_set = self.parent()._gens[self.leading_support()[0]][self.leading_support()[1]][0]
return self.parent()._complex.simplicial_complex().generated_subcomplex(vertex_set, is_mutable=is_mutable)
P = self.parent()
if self.is_one():
return P._complex.simplicial_complex().generated_subcomplex(set(), is_mutable=is_mutable)
ls = self.leading_support()
vertex_set = P._gens[ls[0]][ls[1]][0]
return P._complex.simplicial_complex().generated_subcomplex(vertex_set, is_mutable=is_mutable)

Comment on lines +1527 to +1530
res = 1
for element in subcomplex.vertices():
res *= _eps(element, simplicial_complex)
return res
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need for the _eps method. I would just put it inline here. This can also be simplified

Suggested change
res = 1
for element in subcomplex.vertices():
res *= _eps(element, simplicial_complex)
return res
return (-1) ** sum(simplicial_complex._vertex_to_index[element]
for element in subcomplex.vertices())


return res

def cup_length(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def cup_length(self):
@cached_method
def cup_length(self, elements=False):

It would be good to have an option to return the list of elements that give the cup length.

cochains_basis = subcomplex_union.n_chains(deg, cochains=True).basis()
# If the resulting cochain exists, then we
# add it to the result; otherwise, we add 0
if cochains_basis.has_key(Simplex(res_union)):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cochains_basis.has_key(Simplex(res_union)):
X = Simplex(res_union)
if X in cochains_basis:

since cochains_basis is a dict, right? This way you don't have to recreate the Simplex below either. Although I would do this as

if X not in cochains_basis:
    continue
[rest of code]

Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants