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

minimal_model of GradedCommutativeAlgebra misuses cache #35649

Closed
2 tasks done
miguelmarco opened this issue May 18, 2023 · 1 comment · Fixed by #35650
Closed
2 tasks done

minimal_model of GradedCommutativeAlgebra misuses cache #35649

miguelmarco opened this issue May 18, 2023 · 1 comment · Fixed by #35650

Comments

@miguelmarco
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Did you read the documentation and troubleshoot guide?

  • I have read the documentation and troubleshoot guide

Environment

- **OS**: Debian Linux
- **Sage Version**: 9.8

Steps To Reproduce

  1. Create two GradedCommutativeDifferentialAlgebras with the same names in the generators but different minimal models
  2. Compute the minimal model of the first one
  3. Compute the minimal model of the second one

Expected Behavior

The codomain of the minimal model of the second GCDA should be the second algebra itself

Actual Behavior

It returns the first algebra

Additional Information

Example:

sage: A.<e1,e2,e3,e4,e5,e6> = GradedCommutativeAlgebra(QQ)
sage: B1 = A.cdg_algebra({e5:e1*e2,e6:e3*e4})
sage: B2 = A.cdg_algebra({e5:e1*e2,e6:e1*e2+e3*e4})
sage: B1.minimal_model()
Commutative Differential Graded Algebra morphism:
  From: Commutative Differential Graded Algebra with generators ('x1_0', 'x1_1', 'x1_2', 'x1_3', 'y1_0', 'y1_1') in degrees (1, 1, 1, 1, 1, 1) over Rational Field with differential:
   x1_0 --> 0
   x1_1 --> 0
   x1_2 --> 0
   x1_3 --> 0
   y1_0 --> x1_0*x1_1
   y1_1 --> x1_2*x1_3
  To:   Commutative Differential Graded Algebra with generators ('e1', 'e2', 'e3', 'e4', 'e5', 'e6') in degrees (1, 1, 1, 1, 1, 1) over Rational Field with differential:
   e1 --> 0
   e2 --> 0
   e3 --> 0
   e4 --> 0
   e5 --> e1*e2
   e6 --> e3*e4
  Defn: (x1_0, x1_1, x1_2, x1_3, y1_0, y1_1) --> (e1, e2, e3, e4, e5, e6)
sage: B2.minimal_model()
Commutative Differential Graded Algebra morphism:
  From: Commutative Differential Graded Algebra with generators ('x1_0', 'x1_1', 'x1_2', 'x1_3', 'y1_0', 'y1_1') in degrees (1, 1, 1, 1, 1, 1) over Rational Field with differential:
   x1_0 --> 0
   x1_1 --> 0
   x1_2 --> 0
   x1_3 --> 0
   y1_0 --> x1_0*x1_1
   y1_1 --> x1_2*x1_3
  To:   Commutative Differential Graded Algebra with generators ('e1', 'e2', 'e3', 'e4', 'e5', 'e6') in degrees (1, 1, 1, 1, 1, 1) over Rational Field with differential:
   e1 --> 0
   e2 --> 0
   e3 --> 0
   e4 --> 0
   e5 --> e1*e2
   e6 --> e3*e4
  Defn: (x1_0, x1_1, x1_2, x1_3, y1_0, y1_1) --> (e1, e2, e3, e4, e5, -e5 + e6)
@miguelmarco
Copy link
Contributor Author

I found the cuplrit in the fact that CachedRepresentation of CohomologyClass caches only the string representation, so it reuses them for different parents.

Solved by adding a parent to the creation of the class.

@miguelmarco miguelmarco self-assigned this May 18, 2023
vbraun pushed a commit that referenced this issue Jun 3, 2023
    
### 📚 Description

Fixes #35649

Adds the parent to the creation of cohomology classes, so they are not
confused between different parents.

### 📝 Checklist

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

### ⌛ Dependencies
    
URL: #35650
Reported by: miguelmarco
Reviewer(s): Matthias Köppe, miguelmarco, Travis Scrimshaw
@mkoeppe mkoeppe added this to the sage-10.1 milestone Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants