Opened 9 years ago

Closed 9 years ago

#14041 closed enhancement (fixed)

Give the SteenrodAlgebra a proper basis object

Reported by: cnassau Owned by: jhpalmieri
Priority: minor Milestone: sage-5.8
Component: algebraic topology Keywords: Steenrod algebra
Cc: Merged in: sage-5.8.beta1
Authors: Christian Nassau Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #13856 Stopgaps:

Status badges

Description

In Sage 5.6, the basis of the Steenrod algebra is not quite what it should be:

sage: A=SteenrodAlgebra(7)
sage: for k in zip((1,..,5),A.basis()):
....:     print k
Traceback (most recent call last):
...
IndexError: tuple index out of range

The attached patch uses the new set_from_iterator-classes to fix this:

sage: A=SteenrodAlgebra(7)
sage: for (idx,a) in zip((1,..,5),A.basis()):
...      print idx, a
1 1
2 Q_0
3 P(1)
4 Q_1
5 Q_0 P(1)

Attachments (1)

steenrod_algebra_basis.patch (7.0 KB) - added by cnassau 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by cnassau

comment:1 Changed 9 years ago by cnassau

  • Status changed from new to needs_review

comment:2 follow-up: Changed 9 years ago by jhpalmieri

Should I be worried about calling another method (self.is_finite()) from the __init__ method? Otherwise, this looks okay to me.

comment:3 in reply to: ↑ 2 Changed 9 years ago by cnassau

Replying to jhpalmieri:

Should I be worried about calling another method (self.is_finite()) from the __init__ method?

I wouldn't worry - we already test implictly that these calls work even though the object hasn't been fully constructed yet. The only alternative would be to move the code of self.is_finite entirely into the constructor and have the result cached - but I see no reason to do so; it clearly wouldn't make the code more readable, and probably also not any more reliable.

comment:4 Changed 9 years ago by jhpalmieri

  • Reviewers set to John Palmieri
  • Status changed from needs_review to positive_review

comment:5 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.7 to sage-5.8

comment:6 Changed 9 years ago by jdemeyer

  • Merged in set to sage-5.8.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.