LinearAlgebra[Modular]
Basis
compute Basis and Nullspace mod m
Calling Sequence
Parameters
Description
Examples
Basis(m, A, orient, basis, nullsp)
m
-
modulus
A
mod m Matrix or list or set of mod m Vectors
orient
orientation of Vectors in mod m Matrix
basis
output format of basis Vectors
nullsp
output format of nullspace Vectors
The Basis function computes a basis of the set of Vectors described by A, and returns that basis and the nullspace.
The orient parameter is specified if A is a mod m Matrix. It indicates to the Basis command whether the vectors of the input Matrix are in rows (orient=row) or columns (orient=column).
The basis and nullsp parameters indicate the format in which the respective Vectors are returned by Basis. They can be any of the following values:
false
no output
row
list of mod m row vectors
column
list of mod m column vectors
Matrix[row]
mod m Matrix with vectors in the rows
Matrix[column]
mod m Matrix with vectors in the columns
If neither basis or nullsp are false, both the basis and nullspace Vectors are returned as a two element sequence. If both are false, an error results.
For example, if Basis is called with basis=false and nullsp=column, the output would be a list of column Vectors for the nullspace.
The Basis command works with a copy of the input data, using the MatBasis command to perform the computation, so if data storage or efficiency are a concern, the MatBasis command should be used.
This command is part of the LinearAlgebra[Modular] package, so it can be used in the form Basis(..) only after executing the command with(LinearAlgebra[Modular]). However, it can always be used in the form LinearAlgebra[Modular][Basis](..).
Three dimensional basis, two dimensional nullspace, and Vector input.
with⁡LinearAlgebraModular:
p≔2741
A≔seq⁡Mod⁡p,Vectorcolumn⁡5,i↦rand⁡,float8,i=1..3
A≔164.1946.211.49.2418.,2543.1568.127.356.581.,430.1549.2376.1511.1839.
B,N≔Basis⁡p,A,column,row
B,N≔1.0.0.1972.1878.,0.1.0.1578.1735.,0.0.1.1724.2166.,769.1163.1017.1.0.,863.1006.575.0.1.
Check orthogonality.
seq⁡seq⁡Multiply⁡p,i,j,i=N,j=B
0.,0.,0.,0.,0.,0.
Matrix input, request nullspace only.
A≔Mod⁡p,Matrix⁡3,5,i,j↦rand⁡,integer
A≔30148075410494231980253314396720512635353265716172198
N≔Basis⁡p,A,row,false,column
N≔12791956248110,327246470101
seq⁡Multiply⁡p,A,i,i=N
000,000
For the same problem, request the nullspace as Matrix.
N≔Basis⁡p,A,row,false,Matrixcolumn
N≔12793271956246424817011001
Multiply⁡p,A,N
000000
See Also
LinearAlgebra/Details
LinearAlgebra[Modular][MatBasis]
LinearAlgebra[Modular][Mod]
LinearAlgebra[Modular][Multiply]
Download Help Document