﻿(* arXiv:1410.8236 *)
(* B.3. Ex.1 *)
(* notation
   rnk[n,k]  : r_{n,k}^{X,\mathcal{D}}
   poch[a,n] : (a)_n
   b1        : b_1
   s1        : \sigma_1
   s2        : \sigma_2
   sp1       : \sigma'_1
   sp2       : \sigma'_2
*)

poch[a_,n_]:=Product[a+i,{i,0,n-1}];

rnk[n_,2]:=(s1-sp1-2)*
           poch[b1+n-1,2]poch[s1+n-2,1]/
           (2poch[b1+2n-1,4]poch[s1+n,1]);
rnk[n_,-2]:=n(n-1)(s1-sp1-2)*
           poch[s1+n-2,2]*
           poch[sp1+n-2,1]poch[sp1+n+1,1]*
           poch[a1+a3+n-2,2]poch[a1+a4+n-2,2]*
           poch[a2+a3+n-2,2]poch[a2+a4+n-2,2]/
           (2poch[b1+2n-4,4]);
rnk[n_,1]:=-2poch[b1+n-1,1]*
           poch[s1+n-2,1]poch[sp1+n+1,1]/
           (poch[b1+2n-2,3]poch[b1+2n+2,1])*
       ((s1-sp1-2)n(n+b1)-(b1-2)(sp1-s2+sp2+1));
rnk[n_,-1]:=2n poch[s1+n-2,2]*
            poch[sp1+n-1,1]poch[sp1+n+1,1]*
            poch[a1+a3+n-1,1]poch[a1+a4+n-1,1]*
            poch[a2+a3+n-1,1]poch[a2+a4+n-1,1]/
            (poch[b1+2n-4,1]poch[b1+2n-2,3])*
        ((2-s1+sp1)n(n+b1-2)+(s1-2)b1-(s2-sp2)(b1-2));
rnk[n_,0]:=1/(32poch[b1+2n-3,2]poch[b1+2n,2])*
     (96(s1-sp1-2)n^7(n+4b1-4)
       +64n^6((s1-2)(9s1^2-18s1+3s2-sp2+5)
              +sp1(12s1^2-49s1+s2-3sp2+41)
              -3sp1^2(4s1-1)-9sp1^3)
       +192(b1-1)n^5((s1-2)(2s1^2-4s1+3s2-sp2-2)
              +(5s1^2-21s1+s2-3sp2+20)sp1
              +(3-5s1)sp1^2-2sp1^3)
      +16n^4((s1-2)(6s1^4-24s1^3+2(18s2-5sp2-8)s1^2-2(33s2-11sp2-41)s1
                    +6s2^2-10sp2^2-12s2 sp2+6s2-6sp2-35)
             +sp1(54s1^4-328s1^3+2(53s2-36sp2+297)s1^2
                   -6(54s2-26sp2+47)s1
                   +10s2^2-6sp2^2+12s2 sp2+218s2-66sp2-49)
             +2sp1^2(27s1^3-198s1^2+(36s2-53sp2+348)s1-57s2+61sp2-150)
             +2sp1^3(-27s1^2-2s1+5s2-18sp2+55)
             -6sp1^4(9s1-8)
             -6sp1^5)
      +32(b1-1)n^3(
             (s1-2)(6(s2-2)s1^2-2(3s2-sp2-13)s1+6s2^2-10sp2^2
                    -12s2 sp2-24s2+4sp2-1)
             +sp1(6s1^4-42s1^3+2(18s2-11sp2+32)s1^2-4(31s2-9sp2-8)s1
                 +10s2^2-6sp2^2+12s2 sp2+88s2+4sp2-71)
             +2sp1^2(6s1^3-47s1^2+(11s2-18sp2+89)s1-17s2+21sp2-41)
             -6sp1^3(2s1^2-s1+sp2-3)
             -6sp1^4(s1-1))        
      +4n^2((s1-2)(8(sp2-2)s1^4+8(3s2-2sp2+10)s1^3
            +6(4s2^2-12sp2^2-8s2 sp2-32s2+4sp2-13)s1^2
            -4(6s2^2-42sp2^2-12s2 sp2-72s2+4sp2+7)s1
            -24s2^2-40sp2^2+48s2 sp2-72s2+31)
          +sp1(-16s1^5+8(11s2-3sp2-4)s1^4-8(57s2+sp2-66)s1^3
               +2(64s2^2-80sp2^2-32s2 sp2+220s2+160sp2-587)s1^2
               -8(40s2^2-56sp2^2-32s2 sp2-72s2+64sp2-101)s1
               +120s2^2-280sp2^2-208s2 sp2-672s2+168sp2-111)
          +2sp1^2(12s1^5-144s1^4+4(33s2-26sp2+99)s1^3
                 -4(151s2-61sp2+48)s1^2
                 +(80s2^2-64sp2^2+32s2 sp2+736s2-60sp2-317)s1
                 -4(25s2^2-23sp2^2-2s2 sp2+52s2+24sp2-52))
          +2sp1^3(12s1^4-200s1^3+4(26s2-33sp2+147)s1^2
                 -4(89s2-63sp2+126)s1
                 +36s2^2-12sp2^2+24s2 sp2+260s2-72sp2+79)
          -8sp1^4(3s1^3+12s1^2-(3s2-11sp2+47)s1+6s2-13sp2+28)
          -8sp1^5(3s1^2-4s1+s2-1))
      -4(b1-1)n(-(s1-2)(8(sp2+1)s1^3-2(16sp2^2+12s2+12sp2+5)s1^2
                      +4(6s2^2+22sp2^2-12s2 sp2+6s2+10sp2-3)s1
                       -3(16s2^2-32s2 sp2-16s2+8sp2-1))
            +sp1(-8(sp2-1)s1^4-8(s2-11sp2+7)s1^3
                -2(20s2^2-28sp2^2-8s2 sp2-92s2+132sp2-53)s1^2
                +16(6s2^2-10sp2^2-4s2 sp2-37s2+15sp2-1)s1
                +16s2^2+96sp2^2+64s2 sp2+440s2-45)
            +2sp1^2(8s1^4-4(5s2-4sp2+4)s1^3+4(27s2-5sp2-15)s1^2
                    +(-28s2^2+20sp2^2-8s2 sp2-140s2-44sp2+143)s1
                    +4(9s2^2-7sp2^2-2s2 sp2+11s2+13sp2-16))
            +2sp1^3(16s1^3-4(4s2-5sp2+16)s1^2+4(19s2-9sp2+17)s1
                    -16s2^2-68s2+4sp2-17)
            +8sp1^4(2s1^2+(s2-5)s1-s2+2))
      -(b1-2)(b1-3)(s1(s1+1)(s1-2)(1+4sp2)^2
            +sp1(8(2sp2-1)s1^3+(48sp2^2-32s2 sp2+56s2+16sp2+1)s1^2
                 -4(20s2^2+28sp2^2-32s2 sp2+2s2+30sp2-1)s1
                 +2(32s2^2+16sp2^2-64s2 sp2-32s2+24sp2-1))
            +sp1^2(16(s2+3sp2-1)s1^2+(-48s2^2+32s2 sp2+112s2-120sp2+7)s1
                   +16s2^2-64s2 sp2-168s2+48sp2+5)
            +sp1^3(8(6s2-1)s1-16s2^2-72s2+7)));

