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

Add part for graded objects and other improvements #3522

Open
wants to merge 15 commits into
base: development
Choose a base branch
from

Conversation

mahrud
Copy link
Member

@mahrud mahrud commented Oct 16, 2024

This PR is on top of #3519.

Summary of changes:

  • added part for modules, matrices, ideals, and rings
    • this is the same as part(ZZ, Complex), but for other graded objects
  • added cover, super, and ambient for Complex
  • added cover, super, and ambient for ComplexMap
    • these two are mostly for compatibility (e.g. I used them)
  • added basis(ZZ, Complex)
  • added basis(ZZ, ComplexMap)
    • this is a similar to part(ZZ, Complex), but the base ring is the original ring, not its coefficient ring
  • simplified part(ZZ, Complex)
  • simplified part(ZZ, ComplexMap)
  • simplified part using cover
    • the main reason I added cover here was so I could make this simplification
  • added better algorithm for basis(ZZ, Complex)
  • added better algorithm for truncate(ZZ, Complex)
  • added better algorithm for truncate(ZZ, ComplexMap)
    • this is way faster for large enough complexes
  • added tests for basis of Complex and ComplexMap
  • added method for truncating source of map more than target
    • we use this frequently in Varieties

The rest are optimizations in line with #3352 to eliminate unnecessary gb computations, though there's more work left.

  • cached subquotient gens in M.cache.Monomial
  • optimized basis(ZZ, Matrix)
  • used ??= to cache image, coker, coimage
  • added ways to avoid gb calls in inducedMap

@mahrud mahrud linked an issue Oct 16, 2024 that may be closed by this pull request
@mahrud mahrud requested a review from ggsmith October 16, 2024 03:52
@mahrud mahrud force-pushed the quickfix/part branch 2 times, most recently from be82d3e to b1eb629 Compare October 18, 2024 11:44
@mahrud mahrud marked this pull request as ready for review October 18, 2024 18:55
f := truncate(degs, dd^C_lo, opts);
complex hashTable for i from lo+1 to hi list i => (
f = inducedTruncationMap(source f, truncate(degs, C_i, opts), dd^C_i))
))

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid calling Truncation within part?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do not call truncate within part. We do however call basis.

complex hashTable for i from lo+1 to hi list i => (
f = inducedBasisMap(source f, image basis(deg, C_i, opts), dd^C_i))
))

Copy link
Contributor

Choose a reason for hiding this comment

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

The phrase basis of complex seems particularly unfortunate.

Copy link
Contributor

@ggsmith ggsmith left a comment

Choose a reason for hiding this comment

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

From my perspective, the proposed changes need (at a minimum) documentation and tests before being accepted. In particular, I suspect that several of the methods do not typically return well-defined complexes or complex maps.

@mahrud
Copy link
Member Author

mahrud commented Oct 28, 2024

From my perspective, the proposed changes need (at a minimum) documentation and tests before being accepted.

Tests have been included, I'm happy to add some documentation this week if otherwise the changes are acceptable.

In particular, I suspect that several of the methods do not typically return well-defined complexes or complex maps.

I'm happy to remove super and ambient for now if you suspect those are not well-defined (though I'm still curious to know why you suspect that or whether there are obvious examples I'm missing), but I use cover in the simplified version of part. Are there specifically issues for cover of a complex?

Alternatively, would it make sense to have an internal method for cover Complex that is used in part?

@mahrud
Copy link
Member Author

mahrud commented Oct 29, 2024

I removed cover, super, ambient, and changed part to use an unexported cover' method.

@mahrud
Copy link
Member Author

mahrud commented Oct 29, 2024

I also changed this PR to only depend on 4 specific commits from the basis PR, which in particular don't include any breaking change.

@mahrud mahrud requested a review from ggsmith October 30, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug in part(Complex)
2 participants