rowmatrix(r:List(Fraction(Integer))):Matrix(Fraction(Integer)) ==
 [r]::Matrix(Fraction(Integer))

columnmatrix(c:List(Fraction(Integer))):Matrix(Fraction(Integer)) ==
 [[i] for i in c]::Matrix(Fraction(Integer))

k(n) == 
 M := diagonalMatrix([2 for i in 1..n]) 
 for i in 1..n-1 repeat M(i,i+1):=-1 
 for i in 1..n-1 repeat M(i+1,i):=-1 
 M::SquareMatrix(n,Fraction(Integer))

t(n) == 
 M:=k(n)
 N:=M::Matrix(Fraction(Integer)) 
 qsetelt!(N,1,1,1) 
 N::SquareMatrix(n,Fraction(Integer))

b(n) == 
 M:=k(n)
 N:=M::Matrix(Fraction(Integer)) 
 qsetelt!(N,1,1,1) 
 qsetelt!(N,n,n,1)
 N::SquareMatrix(n,Fraction(Integer))

K:=k(3)
T:=t(3)
B:=b(3)


