Opened 12 years ago

Closed 12 years ago

#9267 closed defect (fixed)

Update the charge statistic on words

Reported by: Jason Bandlow Owned by: Sage Combinat CC user
Priority: major Milestone: sage-4.5.2
Component: combinatorics Keywords: words, charge, cocharge
Cc: Merged in: sage-4.5.2.alpha0
Authors: Jason Bandlow Reviewers: Franco Saliola
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jason Bandlow)

The following behavior is currently in sage:

sage: w = Word([1,2,3,1,2])
sage: w.charge()
0

This is inconsistent with the definition one usually finds in the literature, which would give the charge of this word as 2. (see Macdonald's book, for example).

The goal of this ticket is to fix this bug, add a cocharge statistic, and extend the definition to words without partition content.

See this thread on sage-combinat-devel for discussion of this ticket.

Attachments (1)

trac_9267-charge_jb.patch (10.3 KB) - added by Jason Bandlow 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by Jason Bandlow

Authors: Jason Bandlow
Description: modified (diff)
Status: newneeds_review

comment:2 Changed 12 years ago by Franco Saliola

Status: needs_reviewneeds_work

Tested against sage-4.4.4. Patch applies cleanly. All tests pass. The code looks good.

Just a few documentation issues:

  • Add a line break here:
     r"""Implements Lascoux and Schutzenberger's `s_i` operator, swapping
    
  • Please add a reference in the documentation to an article or book that defines charge, cocharge, Lascoux and Schutzenberger's s_i operators, etc.
  • Since this definition of charge differs from that found in Macdonald's book, and since Sage uses many of Macdonald's conventions, I think it is a good idea to add a warning in the docstring of charge that explains that this is the common definition found in the literature and that it differs from that in Macdonald's book.

comment:3 Changed 12 years ago by Jason Bandlow

Reviewers: Franco Saliola
Status: needs_workneeds_review

Wow, I can't believe I forgot to put those comments in after all the discussion. Thanks a lot for the review, Franco. Please look at the new version and let me know what you think.

comment:4 Changed 12 years ago by Franco Saliola

Status: needs_reviewneeds_info

Jason, is the \A intentional in references [2] and [3]?

Otherwise, this gets a positive review from me, provided that the documentation builds correctly (I have not had the chance to build it yet, and won't be able to do it today).

Changed 12 years ago by Jason Bandlow

Attachment: trac_9267-charge_jb.patch added

comment:5 in reply to:  4 Changed 12 years ago by Jason Bandlow

Status: needs_infoneeds_review

Replying to saliola:

Jason, is the \A intentional in references [2] and [3]?

In a first, incorrectly sphinxed, attempt to add these references, the 'A.' was being interpreted as the start of a list, so I had to make the 'A' a literal. But that's not happening anymore, so I've removed the backslash.

Otherwise, this gets a positive review from me, provided that the documentation builds correctly (I have not had the chance to build it yet, and won't be able to do it today).

Great! I think the doc builds ok, but I will wait until someone else verifies this instead of setting positive review on my own patch.

Thanks again, Franco.

comment:6 Changed 12 years ago by Franco Saliola

Status: needs_reviewpositive_review

Documentation looks good.

comment:7 Changed 12 years ago by Mitesh Patel

Merged in: sage-4.5.2.alpha0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.