// We assume C is a linear code over the integers modulo k Q:=Rationals(); constructionA:=function(C) n:=Length(C); k:=#Alphabet(C); g:=GeneratorMatrix(C); gL1:=Matrix(Q,Nrows(g),n,[Integers()!x:x in Eltseq(g)]); id:=ScalarMatrix(Q,n,1); return Lattice(VerticalJoin(gL1,k*id),1/k*id); end function;