next | previous | forward | backward | up | index | toc

# randomChainComplex -- random chain complex over the integers with prescribed ranks of the homology group and ranks of the matrices

## Synopsis

• Usage:
C = randomChainComplex(h,r)
• Inputs:
• h, a list, of desired ranks of the homology groups, of some length $n$
• r, a list, of desired ranks of the matrices in the complex, of length $n-1$
• Optional inputs:
• Height => an integer, default value 10, the sizes of the random integers used
• WithLLL => , default value true, use the LLL algorithm to keep the sizes of the integers small
• ZeroMean => , default value true, whether to balance the random numbers around zero
• Outputs:
• C, , a random chain complex over the integers whose homology ranks match $h$, and whose matrices have ranks given by $r$

## Description

 i1 : h={1,4,6,5,1} o1 = {1, 4, 6, 5, 1} o1 : List i2 : r={1,3,3,4} o2 = {1, 3, 3, 4} o2 : List i3 : C=randomChainComplex(h,r) 2 8 12 12 5 o3 = ZZ <-- ZZ <-- ZZ <-- ZZ <-- ZZ 0 1 2 3 4 o3 : ChainComplex i4 : prune HH C 1 o4 = 0 : ZZ 4 1 : ZZ 6 2 : ZZ 5 3 : ZZ 1 4 : ZZ o4 : GradedModule i5 : for i from 0 to 4 list rank HH_i C o5 = {1, 4, 6, 5, 1} o5 : List i6 : for i from 1 to 4 list rank(C.dd_i) o6 = {1, 3, 3, 4} o6 : List

The optional argument Height chooses the maximum sizes of the random numbers used. The actual numbers are somewhat larger (twice as many bits), as matrices are multiplied together.

 i7 : h={1,4,0,5,1} o7 = {1, 4, 0, 5, 1} o7 : List i8 : r={2,3,3,4} o8 = {2, 3, 3, 4} o8 : List i9 : C=randomChainComplex(h,r, Height=>1000) 3 9 6 12 5 o9 = ZZ <-- ZZ <-- ZZ <-- ZZ <-- ZZ 0 1 2 3 4 o9 : ChainComplex i10 : C.dd 3 9 o10 = 0 : ZZ <---------------------------------------------------------------------- ZZ : 1 | 44424 -8775 -2160 -53262 -62508 -10437 -6822 -62838 1011 | | 90516 14087 19368 -141214 -90936 2397 -10686 -117210 24977 | | 138645 31572 37098 -226521 -127899 11070 -15363 -176148 45423 | 9 6 1 : ZZ <--------------------------------------------------------- ZZ : 2 | 330985 16445 756805 1698 330472 348418 | | 713026 -154053 -42697 1538759 531828 793108 | | 1313518 -554313 -1321367 952247 994858 2800 | | 1504309 -561736 -934444 734919 1193028 74986 | | -566001 95813 3887 -1731404 -398918 -893718 | | -940456 315736 168999 191100 -803825 96554 | | -505191 256413 438512 888174 -448781 587460 | | -380977 341680 1286800 724845 -281448 878246 | | 1910440 -687155 -752920 2107 1588083 -178598 | 6 12 2 : ZZ <-------------------------------------------------------------------------------------------------------------------------------- ZZ : 3 | 41388167 -95238274 5488161 12322184 -52314315 -15854513 50425642 -29862626 -100716183 -78673592 -64535295 57729071 | | 9777314 29735878 8710464 42894623 -632054 -31139424 6643135 83313808 -38773955 -56265921 3886477 -86494233 | | 21143227 -17020460 17282979 975209 12792629 -27787635 -357149 9785294 -29488934 -28260935 -29357422 16504066 | | 20760737 -1043822 21170415 7109264 22491307 -36115359 -6466526 30843814 -27310181 -32178816 -24665021 -4404699 | | -40854113 120671920 421659 2171879 64292129 1029525 -57179939 69499514 98152576 65571655 71827928 -98294804 | | -47055725 11588622 -43668471 -17943160 -39150723 76088519 6825892 -62888800 68596487 76741536 56882559 6646445 | 12 5 3 : ZZ <---------------------------------------------------- ZZ : 4 | -2098931 -882197 -1197770 192505 -821100 | | -540649 1132991 -2558060 653635 -1393888 | | -1333740 3364752 -3624762 -4878996 2320266 | | -1425716 -2621421 1862275 564680 -64468 | | 1352058 -1470320 3544570 -96870 1495604 | | -121418 1868293 -1472318 -1881704 649512 | | -37268 -77123 -385029 440508 -259828 | | -469251 -460737 -885687 1959819 -1865142 | | -1299118 659729 -1037071 -1031938 -476574 | | 28821 -1464654 -120682 2377619 -941278 | | -857790 -1893725 2246803 -1115706 1519562 | | -1160441 -1211038 -190488 1500701 -1537374 | o10 : ChainComplexMap i11 : C.dd^2 == 0 o11 = true i12 : prune HH C o12 = 0 : cokernel | 3 | | 0 | 4 1 : ZZ 2 : cokernel | 64931150 | 3 : cokernel | 6 | | 0 | | 0 | | 0 | | 0 | | 0 | 1 4 : ZZ o12 : GradedModule i13 : for i from 0 to 4 list rank HH_i C o13 = {1, 4, 0, 5, 1} o13 : List i14 : for i from 1 to 4 list rank(C.dd_i) o14 = {2, 3, 3, 4} o14 : List

## Caveat

This returns a chain complex over the integers. Notice that if one gives h to be a list of zeros, then that doesn't mean that the complex is exact, just that the ranks are as expected.