Numerical experiments with the sweeping algorithm

M.P. Mello
e-mail: margarid .at. ime .dot. unicamp .dot. br

Reference: 
Conley's spectral sequence via the sweeping algorithm
M.P. Mello, K.A. de Rezende, M.R. da Silveira

Sweeping algorithm over ℤ --- nonrandom matrices

Matrix 0

A=Table[0,{6},{6}];
A[[1,3]]=A[[2,3]]=A[[4,5]]=A[[4,6]]=1;
partition={2,2,2};

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 1

Clear[A,partition]
A = Table[0,{14},{14}];
A[[2,Range[4,7]]]={2,3,2,1};
A[[3,Range[4,9]]]={2,3,1,0,2,1};
A[[4,Range[10,13]]]={0,1,-3,1};
A[[5,Range[10,13]]]={1,0,2,0};
A[[6,Range[10,13]]]={-3,-2,1,-3};
A[[7,Range[10,13]]]={3,2,-2,4};
A[[8,Range[10,13]]]={-1,1,-2,1};
A[[9,Range[10,13]]]={2,-2,3,-1};
partition={1,0,2,6,4,0,1};

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 2

Clear[A,partition]
A = Table[0,{16},{16}];
A[[2,Range[4,8]]]={0,1,-1,-1,-1};
A[[3,Range[4,8]]]={1,0,-1,-1,0};
A[[4,Range[9,13]]]={-1,0,1,0,-1};
A[[5,Range[9,13]]]={0,1,1,1,0};
A[[6,Range[9,13]]]={0,-1,0,-1,0};
A[[7,Range[9,13]]]={-1,1,1,1,-1};
A[[8,Range[9,13]]]={1,1,0,1,1};
A[[9,Range[14,15]]]={-1,1};
A[[10,Range[14,15]]]={1,0};
A[[12,Range[14,15]]]={-1,0};
A[[13,Range[14,15]]]={1,-1};
partition={1,0,2,5,5,2,0,1};

n=SpectralSequenceConstruction[A,partition,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 3

Clear[A,partition]
A = Table[0,{12},{12}];
A[[2,Range[5,9]]]={-1,0,0,1,-1};
A[[3,Range[5,9]]]={0,1,0,1,-1};
A[[4,Range[5,9]]]={-1,-1,1,0,0};
A[[5,Range[10,11]]]={0,1};
A[[6,Range[10,11]]]={0,-1};
A[[8,Range[10,11]]]={1,0};
A[[9,Range[10,11]]]={1,-1};
partition={1,0,3,5,2,0,1};

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 4

Clear[A,partition]
A = Table[0,{10},{10}];
A[[2,Range[4,7]]]={0,0,7,-5};
A[[3,Range[4,7]]]={5,3,2,0};
A[[4,Range[8,9]]]={1,-3};
A[[5,Range[8,9]]]={-5,5};
A[[6,Range[8,9]]]={5,0};
A[[7,Range[8,9]]]={7,0};
partition={1,0,2,4,2,0,1};

n=SpectralSequenceConstruction[A,partition,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 5

Clear[A,partition];
A = Table[0,{10},{10}];
A[[2,Range[4,7]]]={2,3,2,1};
A[[3,Range[4,7]]]={2,3,1,0};
A[[4,Range[8,9]]]={0,1};
A[[5,Range[8,9]]]={1,0};
A[[6,Range[8,9]]]={-3,-2};
A[[7,Range[8,9]]]={3,2};
partition={1,0,2,4,2,0,1};

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Sweeping algorithm over ℤ --- random matrices

Example 1: 10×10 matrix, 3 blocks

Clear[A,partition]
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[10,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 2: 10×10 matrix, 2 blocks

Clear[A,ul,lr,partition]
nb=2;
{A, partition}=RandomConnectionMatrixGenerator[10,seed->35,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 3: 10×10 matrix, 2 blocks

Clear[A,partition]
nb=2;
{A,partition}=RandomConnectionMatrixGenerator[10,seed->19,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition,Erp->True]
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 4: 16×16 matrix, 3 blocks

Clear[A,partition]
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[16,seed->35,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 5: 16×16 matrix, 2 blocks

Clear[A,partition]
nb=2;
{A,partition}=RandomConnectionMatrixGenerator[16,seed->17,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 6: 20×20 matrix, 4 blocks

Clear[A,partition]
nb=4;
{A,partition}=RandomConnectionMatrixGenerator[20,seed->35,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 7: 20×20 matrix, 3 blocks

Clear[A,partition]
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[20,seed->23,numberofblocks->nb];

n=SpectralSequenceConstruction[A,partition,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 8: 18×18 matrix, 3 blocks

Clear[A,partition]
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->85,numberofblocks->nb,range->20];

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 9: 18×18 matrix, 3 blocks

Clear[A,partition]
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->85,numberofblocks->nb,range->4];

n=SpectralSequenceConstruction[A,partition,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 10: 18×18 matrix, 3 blocks

Clear[A,partition];
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->13,numberofblocks->nb,range->4];

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 11: 18×18 matrix, 3 blocks

Clear[A,partition];
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->123,numberofblocks->nb,range->3];

n=SpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=SpectralSequenceConstruction[A,partition,Nf->True,Erp->True];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Sweeping algorithm over (Subscript[ℤ, 2]) --- nonrandom matrices

Matrix 1 mod 2

Clear[A,partition]
A = Table[0,{14},{14}];
A[[2,Range[4,7]]]={2,3,2,1};
A[[3,Range[4,9]]]={2,3,1,0,2,1};
A[[4,Range[10,13]]]={0,1,-3,1};
A[[5,Range[10,13]]]={1,0,2,0};
A[[6,Range[10,13]]]={-3,-2,1,-3};
A[[7,Range[10,13]]]={3,2,-2,4};
A[[8,Range[10,13]]]={-1,1,-2,1};
A[[9,Range[10,13]]]={2,-2,3,-1};
partition={1,0,2,6,4,0,1};
A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 2 mod 2

Clear[A,partition]
A = Table[0,{16},{16}];
A[[2,Range[4,8]]]={0,1,-1,-1,-1};
A[[3,Range[4,8]]]={1,0,-1,-1,0};
A[[4,Range[9,13]]]={-1,0,1,0,-1};
A[[5,Range[9,13]]]={0,1,1,1,0};
A[[6,Range[9,13]]]={0,-1,0,-1,0};
A[[7,Range[9,13]]]={-1,1,1,1,-1};
A[[8,Range[9,13]]]={1,1,0,1,1};
A[[9,Range[14,15]]]={-1,1};
A[[10,Range[14,15]]]={1,0};
A[[12,Range[14,15]]]={-1,0};
A[[13,Range[14,15]]]={1,-1};
partition={1,0,2,5,5,2,0,1};
A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 3 mod 2

Clear[A,partition]
A = Table[0,{12},{12}];
A[[2,Range[5,9]]]={-1,0,0,1,-1};
A[[3,Range[5,9]]]={0,1,0,1,-1};
A[[4,Range[5,9]]]={-1,-1,1,0,0};
A[[5,Range[10,11]]]={0,1};
A[[6,Range[10,11]]]={0,-1};
A[[8,Range[10,11]]]={1,0};
A[[9,Range[10,11]]]={1,-1};
partition={1,0,3,5,2,0,1};
A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 4 mod 2

Clear[A,partition]
A = Table[0,{10},{10}];
A[[2,Range[4,7]]]={0,0,7,-5};
A[[3,Range[4,7]]]={5,3,2,0};
A[[4,Range[8,9]]]={1,-3};
A[[5,Range[8,9]]]={-5,5};
A[[6,Range[8,9]]]={5,0};
A[[7,Range[8,9]]]={7,0};
partition={1,0,2,4,2,0,1};
A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 5 mod 2

Clear[A,partition]
A = Table[0,{10},{10}];
A[[2,Range[4,7]]]={2,3,2,1};
A[[3,Range[4,7]]]={2,3,1,0};
A[[4,Range[8,9]]]={0,1};
A[[5,Range[8,9]]]={1,0};
A[[6,Range[8,9]]]={-3,-2};
A[[7,Range[8,9]]]={3,2};
partition={1,0,2,4,2,0,1};
A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Matrix 6

Clear[A,partition]
A = Table[0,{12},{12}];
A[[2,4]]=A[[2,5]]=A[[3,4]]=A[[3,5]]=A[[4,8]]=A[[4,9]]=A[[5,8]]=A[[5,9]]=A[[6,9]]=A[[6,10]]=A[[7,10]]=A[[7,11]]=1;
partition={1,0,2,4,4,0,1};

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Sweeping algorithm over (Subscript[ℤ, 2]) --- random matrices

Example 1: 18×18 matrix, 3 blocks

Clear[A,partition];
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->85,numberofblocks->nb,range->4];

A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 2: 14×14 matrix, 2 blocks

Clear[A,partition];
nb=2;
{A,partition}=RandomConnectionMatrixGenerator[14,seed->15,numberofblocks->nb,range->4];

A=Mod[A,2];

partition

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 3: 14×14 matrix, 2 blocks

{A,partition}=RandomConnectionMatrixGenerator[14,seed->611,numberofblocks->nb,range->4];

A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 4: 18×18 matrix, 3 blocks

Clear[A,partition];
nb=3;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->123,numberofblocks->nb,range->3];

A=Mod[A,2];

A//MatrixForm

n=BinarySpectralSequenceConstructionWithHk[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

Example 5: 18×18 matrix, 4 blocks

Clear[A,partition];
nb=4;
{A,partition}=RandomConnectionMatrixGenerator[18,seed->85,numberofblocks->nb,range->4];

A=Mod[A,2];

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]

n=BinarySpectralSequenceConstruction[A,partition];
Table[changeofbasismatrix[i]//MatrixForm,{i,1,n}]