I'd be willing to add that to my list of things to do for a future version,
such as 1.4.  (I have a feeling your display won't look right if some of the
numbers have more than one digit.)

Can you really get something useful out of that?

Maybe you want four dimensions as an option, too!

On Sep 19, 2009, at 7:47 PM, David Eisenbud wrote:

> Dear Dan,
> 
> Suppose S is a multigraded ring and I give a weight vector;
> M2 is now wonderful about giving me a betti table where the
> degrees are given by applying the weight vector. Recently
> Frank Schreyer and Daniel Erman and I have been making computations
> where it's a big help to see more, and I've written code that does
> what I want in a special case. I think it could be useful much more
> generally, and I want to suggest it as an addition in 1.3 or 1.4:
> a betti command that works with two weights at once.
> 
> Here's some code to try to see what I mean, in the special case where
> the ring is bigraded and the two weight vectors are just {1,0} and {0,1}:
> 
> <twoBetti-demo.m2>
> As you'll see, the different syzygies are represented by different boxes of betti numbers.
> In this version, the position of the boxes is identified by giving the
> bihomogeneous coordinates of the upper left corner, and all the boxes
> are made to be of the same size and position, to make them most
> comparable. Of course this isn't efficient in space, and for large examples one
> might want to contract each one to just contain the nonzero entries.
> 
> I think you'll have ideas about how to present this best, and what sort of interface
> it might have; I was thinking that one would have a "betti" method that took two weight
> vectors, and would trigger behavior like the one in this example, with some options for
> how to place the boxes (which maybe should be exhibited one after the other vertically
> instead of horizontally, as here -- at least if they are big or many.)

--

twoBetti = FF ->(
     T:=for i from 0 to 4 list tally last degrees FF.dd_i;
     startrows := min apply(keys T_0, first);
     startcols := min apply(keys T_0, last);
     start := {startrows, startcols};
     endrows := max apply(keys T_2, first);
     endcols := max apply(keys T_2, last);
     print ((startrows, startcols), (endrows, endcols));
     rowsize := endrows-startrows+1;
     colsize := endcols-startcols+1;
     m:=map(ZZ^(rowsize), ZZ^(colsize), (i,j) -> 0);
     for i from 0 to 4 list(
     	  mm=mutableMatrix m;
     	  scan(keys T_i, j-> mm_(toSequence (j-start))=T_i#j);
	  mm
     	  ))
randomBigraded=(r0,r1,col0,col1)->(
     random(S^{r0:{0,-1},r1:{0,0}}, S^{col0:{-1,-1}, col1:{-1,0}})
	       )
end
restart
load "twoBetti-demo.m2"

kk=ZZ/32003
S=kk[s,t,u,v, Degrees=>{2:{1,0},2:{0,1}}]
m1 = randomBigraded(1,1,2,1)
m2 = randomBigraded(2,2,4,2)
m3 = randomBigraded(3,3,6,3)
twoBetti res coker m1
twoBetti res coker m2
twoBetti res coker m3


