> > Andrew, does this mean, that your patch when ready will actually take care > of the tickets mentioned? > > Not really. What I have been doing provides a different way of displaying tables from inside sage (rather than specifically from the notebook). What I am doing provides a different way of solving the problems in these tickets but it will not solve the actual problems.
There are two components to what I am doing: 1. A LabelledMatrix class which has some overlap with John's patch #13131, which I have only just learnt about. 2. A new (one way) html interface, HTMLDisplay, which opens a web page - in the sage documentation style - for the pretty printing of sage objects. I am writing this mainly so that I can display and work with "large" tables although I am trying to make the class as general as possible in the hope that it will be useful to someone else. Except for the documentation, and hence many minor fixes, the LabelledMatrix class is basically done (although now I clearly need to talk with John and work out what he has done...). I have a working prototype for the HTMLDisplay class but I still need to throw in the css/html for my application -- tables with fixed row/column labels and with scrollable entries. The focus of my LabelledMatrix class seems to be a little different to John's patch #13131. What I really want/need is a way of labelling and accessing the entries of a matrix using the combinatorial data that labels its rows and columns - given the focus on the combinatorics, at one point my class was called CombinatorialMatrix. The idea is that virtually any sage object can be used to label the rows and columns of a matrix, and to access it's entries. It is also possible to associate CombinatorialFreeModules with the row and column spaces in a natural way. As an example, my class lets you do the following (the formatting is a little mucked up...): sage: P4=CombinatorialFreeModule(ZZ,Partitions(4),prefix='P') sage: K4=KleshchevPartitions(3,4) # labels irreducible modules in characteristic 3 sage: d=LabelledMatrix(rows=P4,columns=K4, unitriangular=True, default_value=0) sage: d.display() [4] | [3, 1] | 1 [2, 2] | . 1 [2, 1, 1] | . . 1 [1, 1, 1, 1] | . . . 1 sage: d.options(row_label='compact_high'); d.display() 4 | 3,1 | 1 2^2 | . 1 2,1^2 | . . 1 1^4 | . . . 1 sage: d[[1,1,1,1]] P[[1, 1, 1, 1]] sage: d[[2,2],[1,1,1,1]]=2 sage: d[[2,2]] 2*P[[1, 1, 1, 1]] + P[[2, 2]] sage: d[[2,2]] in P4 True Here is a second example: sage: d=LabelledMatrix(rows=Partitions(5), columns=['dim S(mu)','dim D(mu)'],default_value=0) sage: for mu in d.rows(): d[mu,0]=StandardTableaux(mu).cardinality() sage: d[:,1]=[0,0,4,6,1,4,1] # a work around until graded Specht modules are merged sage: d.options(row_label='compact_high',col_label='repr', name='Dimensions in characteristic 3') sage: d.display() Dimensions in characteristic 3 --------------------------- | dim S(mu) dim D(mu) ------|-------------------- 5 | 1 . 4,1 | 4 . 3,2 | 5 4 3,1^2 | 6 6 2^2,1 | 5 1 2,1^3 | 4 4 1^5 | 1 1 sage: d.transpose().display() Dimensions in characteristic 3 ----------------------------------------------------- | 5 4,1 3,2 3,1^2 2^2,1 2,1^3 1^5 ----------|------------------------------------------ dim S(mu) | 1 4 5 6 5 4 1 dim D(mu) | . . 4 6 1 4 1 When the LabelledMatrix is actually a matrix then all of the matrix methods are available to it -- but without tab-completions, and sometimes with embellishments as above. For example, the inverse of an invertible labelled matrix is again a labelled matrix (of course, the default labelling sets won't always be mathematically correct...). The LabelledMatrix class is intended to be used as a base class for building richer classes for working with things like decomposition matrices, character tables, Cayley tables, homomorphisms of combinatorial free modules, .... Such classes would set the many (cumbersome) options to a LabelledMatrix as well as provide new methods. The applications that I am most interested in are decomposition matrices and homomorphisms, but as a test case I wrote a rudimentary wrapper for character tables which lets you do things like: sage: ct=CharacterTable(G); ct.display() Character table of Symmetric group of order 5! as a permutation group ------------------------- | 1a 2a 2b 3a 6a 4a 5a ---|--------------------- X0 | 1 -1 1 1 -1 -1 1 X1 | 4 -2 0 1 1 0 -1 X2 | 5 -1 1 -1 -1 1 0 X3 | 6 0 -2 0 0 0 1 X4 | 5 1 1 -1 1 -1 0 X5 | 4 2 0 1 -1 0 -1 X6 | 1 1 1 1 1 1 1 sage: ct['X3'] [6, 0, -2, 0, 0, 0, 1] sage: ct[3] [6, 0, -2, 0, 0, 0, 1] sage: ct[:,'3a'] [1, 1, -1, 0, -1, 1, 1] My HTMLDisplay class is still rather rough. It's aim is to display sage objects in a web browser or, if you like, extreme pretty printing. The information exchange is one way: sage opens a window/tab in your browser but the browser cannot communicate with sage. Rather than just displaying a single sage object, the aim of HTMLDisplay to construct, and crudely edit, an HTML page which can contain many sage objects. The web pages constructed by HTMLDisplay are modelled on the sage documentation pages. As one application (using LabelledMatrices), I would like to be able to display all of the decomposition matrices of the symmetric groups in characteristic p for n\le 20, say, and a fixed prime p. For most sage objects I doubt an HTML interface is necessary, however, for a large matrix (such as a decomposition matrix) even printing it is not so useful because it is just too big. My initial goal is simply to be able to scroll the entries of the table (in the browser) whilst keeping the row and column labels fixed. Modulo the css specifications, which I have in some other code, this is almost done too. There are still many sharp corners to smooth out, however, and I may not be able to work on this for a few more weeks. Finally, I guess that there is a third aspect to all of this which I haven't though about yet: ultimately, I also want to write an interface between LabelledMatrices and an (SQLite?) database for storing an retrieving decomposition matrices... Andrew Andrew -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To post to this group, send email to sage-devel@googlegroups.com. To unsubscribe from this group, send email to sage-devel+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en.