Opened 5 years ago

Last modified 17 months ago

#18003 closed enhancement

Implement Fully Packed Loop class — at Version 15

Reported by: kdilks Owned by:
Priority: major Milestone: sage-6.9
Component: combinatorics Keywords: fpl, ncp, days64, days65, asm, lp, fully packed loop
Cc: tscrim, jessicapalencia, egunawan, vinceknight, jcampbell, kdilks, nadialafreniere, mlapointe Merged in:
Authors: James Campbell, Vince Knight, Jessica Striker, Kevin Dilks, Emily Gunawan Reviewers: Jessica Striker, Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: public/ticket/18003 (Commits) Commit: 0cbd4f6d2306e42b2e801c05ca81f2699df35a2d
Dependencies: Stopgaps:

Description (last modified by tscrim)

Create the FullyPackedLoop class which does the following:

  • Add methods for ascii/graphical representation by modifying corresponding code for six vertex model.
  • Add method to_alternating_sign_matrix.
  • Add method link_pattern to extract link pattern/ non-crossing partition.

Change History (15)

comment:1 Changed 5 years ago by jcampbell

  • Cc vinceknight jcampbell kdilks added
  • Description modified (diff)

comment:2 Changed 5 years ago by jessicapalencia

  • Cc jessicapalencia added; jstriker removed
  • Keywords asm added

comment:3 Changed 5 years ago by egunawan

  • Description modified (diff)
  • Keywords lp added
  • Summary changed from Extract non-crossing matching from Fully Packed Loop to Extract non-crossing matching (link pattern) from Fully Packed Loop

comment:4 Changed 5 years ago by egunawan

I'm sorry Vince for using trac for development process, but I don't have everyone's email addresses. This is from the latest u/jcampbell/lp pull:

sage: mat = AlternatingSignMatrix?([[0,0,0,1,0,0], [0,0,1,-1,1,0], [0,1,0,0,-1,1], [1,0,-1,1,0,0], \ ....: ....: [0,0,1,0,0,0], [0,0,0,0,1,0]]) sage: mat [ 0 0 0 1 0 0] [ 0 0 1 -1 1 0] [ 0 1 0 0 -1 1] [ 1 0 -1 1 0 0] [ 0 0 1 0 0 0] [ 0 0 0 0 1 0] sage: fpl = FullyPackedLoop?(mat) sage: ncp = fpl.link_pattern()


KeyError? Traceback (most recent call last) <ipython-input-62-beb825ee7c96> in <module>()


/Users/eg/sageMar2015/sage/local/lib/python2.7/site-packages/sage/combinat/fully_packed_loop.pyc in link_pattern(self)

637 vertices_d[position] = 0 # allows us to start 638

--> 639 while not vertices_d[position]:

640 vertices_d.pop(position) 641 choices = self._get_coordinates(position)

KeyError?: (0, 2)

comment:5 Changed 5 years ago by jcampbell

yeah it's not currently working quite right, i'll keep working on it over the flight though and hopefully figure out what's going wrong. G+ is probably the best way to contact me so add me on there :)

comment:6 Changed 5 years ago by egunawan

  • Authors set to jcampbell
  • Branch set to u/jcampbell/lp
  • Commit set to e68af68a1fd276343a9ad717b0cecb0a523fac02
  • Dependencies set to 17988
Last edited 5 years ago by egunawan (previous) (diff)

comment:7 Changed 5 years ago by egunawan

  • Branch u/jcampbell/lp deleted
  • Commit e68af68a1fd276343a9ad717b0cecb0a523fac02 deleted
  • Description modified (diff)

comment:8 Changed 5 years ago by egunawan

  • Branch set to public/ticket/18003
  • Commit set to 071917548a5ab9531331bf9f2ee85037875333b9
  • Description modified (diff)

Last 10 new commits:

b29b31eiterates over keys and values
5af8c34fixes a few bugs
8843710adds tests and cleans up a few bugs
8e9fd93changes gap to space
c0b0365adds more tests
e68af68fixes get_coordinate function
e154b0cadds another test to get_coordinate
176e328code now produces correct answers, but tests are wrong
5f3d15dadds some bigger tests and fixes old ones
0719175#18003 Add tests for link_pattern and fix doc to say it returns a list. I did not check docbuild.

comment:9 Changed 5 years ago by kdilks

I think the code for link pattern isn't properly tab aligned. Right now when I take an ASM and send it to a link pattern, I get the right result the first time, and then subsequent times I only get the last pair.

comment:10 Changed 5 years ago by git

  • Commit changed from 071917548a5ab9531331bf9f2ee85037875333b9 to 1024081e05ad51eade1950b6dcdf501dd6f7de7e

Branch pushed to git repo; I updated commit sha1. New commits:

3d1fad1copies dicitonary to ensure it can be run again
44bf8f2adds emilys tests
1024081James fixed bug which shows up when you call link_pattern() twice

comment:11 Changed 5 years ago by git

  • Commit changed from 1024081e05ad51eade1950b6dcdf501dd6f7de7e to 0cbd4f6d2306e42b2e801c05ca81f2699df35a2d

Branch pushed to git repo; I updated commit sha1. New commits:

8e33669#18003: Add test for previous bug which showed up when link_pattern in called twice for the same FullyPackedLoop self.
0cbd4f6#18003: Add __eq__ function for FullyPackedLoop

comment:12 Changed 5 years ago by egunawan

  • Dependencies 17988 deleted
  • Description modified (diff)
  • Keywords fully packed loop added
  • Reviewers set to Jessica Striker, Travis Scrimshaw
  • Summary changed from Extract non-crossing matching (link pattern) from Fully Packed Loop to Implement Fully Packed Loop class

comment:13 Changed 5 years ago by egunawan

I believe this is ready to be reviewed by Travis?

I added the equality functionality. I wanted to do a test like isinstance(other,FullyPackedLoop?), but I did not because of this behavior which I don't understand:

sage: A=AlternatingSignMatrices?(3) sage: M=A.random_element() sage: f=FullyPackedLoop?(M) sage: type(f) <class 'sage.combinat.fully_packed_loop.FullyPackedLoop?'> sage: isinstance(f,FullyPackedLoop?) False

comment:14 Changed 5 years ago by egunawan

  • Status changed from new to needs_review

comment:15 Changed 5 years ago by tscrim

  • Authors changed from jcampbell to James Campbell, Vince Knight, Jessica Striker, Kevin Dilks, Emily Gunawan
  • Description modified (diff)

On my todo list.

Note: See TracTickets for help on using tickets.