Opened 6 years ago

Closed 6 years ago

#18478 closed defect (fixed)

Fix comparison of equal newforms in different parents

Reported by: pbruin Owned by:
Priority: minor Milestone: sage-6.8
Component: modular forms Keywords: newform comparison
Cc: vdelecroix, davidloeffler Merged in:
Authors: Peter Bruin Reviewers: David Loeffler
Report Upstream: N/A Work issues:
Branch: 8b6cea1 (Commits) Commit: 8b6cea1b82b92af1be73ea29686b8200a0caf4d0
Dependencies: Stopgaps:

Description

Two newforms that are identical but live in different parents (spaces of cusp forms for Gamma0 versus Gamma1, or with versus without character) should be regarded as equal, but currently are not:

sage: f = Newforms(Gamma1(11), 2)[0]; f
q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6)
sage: g = Newforms(Gamma0(11), 2)[0]; g
q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6)
sage: f == g
False
sage: f = Newforms(DirichletGroup(4)[1], 5)[0]; f
q - 4*q^2 + 16*q^4 - 14*q^5 + O(q^6)
sage: g = Newforms(Gamma1(4), 5)[0]; g
q - 4*q^2 + 16*q^4 - 14*q^5 + O(q^6)
sage: f == g
False

This came up in comment:15:ticket:18061. The current version of the __eq__ method was written in #18068; I did not know about this bug then.

Comparison of modular forms of type ModularFormElement living in different parents is broken as well (see e.g. comment:9:ticket:18068), but this should probably dealt with on a different ticket, by properly implementing coercion for modular forms.

Change History (3)

comment:1 Changed 6 years ago by pbruin

  • Branch set to u/pbruin/18478-Newform_comparison
  • Commit set to 8b6cea1b82b92af1be73ea29686b8200a0caf4d0
  • Status changed from new to needs_review

comment:2 Changed 6 years ago by davidloeffler

  • Reviewers set to David Loeffler
  • Status changed from needs_review to positive_review

Looks good to me.

comment:3 Changed 6 years ago by vbraun

  • Branch changed from u/pbruin/18478-Newform_comparison to 8b6cea1b82b92af1be73ea29686b8200a0caf4d0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.