# Matrix -- the class of all matrices

## Description

A matrix is a homomorphism between two modules, together with an integer (or vector of integers) called its degree, which is used when determining whether the map is homogeneous. The matrix is stored in the usual way as a rectangular array of ring elements. When the source or target modules are not free, the matrix is interpreted as a linear transformation in terms of the generators of the modules.

A matrix f is an immutable object, so if you want to cache information about it, put it in the hash table f.cache.

Common ways to make a matrix:

Common ways to get information about matrices:
Common operations on matrices:
Common ways to use a matrix:

## Methods that use a matrix :

• Matrix * Number, see * -- a binary operator, usually used for multiplication
• Matrix * RingElement, see * -- a binary operator, usually used for multiplication
• Matrix * Vector, see * -- a binary operator, usually used for multiplication
• Matrix * ZZ, see * -- a binary operator, usually used for multiplication
• Number * Matrix, see * -- a binary operator, usually used for multiplication
• RingElement * Matrix, see * -- a binary operator, usually used for multiplication
• Matrix + Number, see + -- a unary or binary operator, usually used for addition
• Matrix + RingElement, see + -- a unary or binary operator, usually used for addition
• Number + Matrix, see + -- a unary or binary operator, usually used for addition
• RingElement + Matrix, see + -- a unary or binary operator, usually used for addition
• Matrix - Number, see - -- a unary or binary operator, usually used for negation or subtraction
• Matrix - RingElement, see - -- a unary or binary operator, usually used for negation or subtraction
• Number - Matrix, see - -- a unary or binary operator, usually used for negation or subtraction
• RingElement - Matrix, see - -- a unary or binary operator, usually used for negation or subtraction
• Matrix // Number, see // -- a binary operator, usually used for quotient
• Number // Matrix, see // -- a binary operator, usually used for quotient
• Matrix == Matrix, see == -- equality
• Matrix == Number, see == -- equality
• Matrix == RingElement, see == -- equality
• Matrix == ZZ, see == -- equality
• Number == Matrix, see == -- equality
• RingElement == Matrix, see == -- equality
• basis(InfiniteNumber,InfiniteNumber,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(InfiniteNumber,List,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(InfiniteNumber,ZZ,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(List,InfiniteNumber,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(List,List,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(List,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(ZZ,InfiniteNumber,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(ZZ,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• basis(ZZ,ZZ,Matrix), see basis -- basis or generating set of all or part of a ring, ideal or module
• betti(Matrix) -- display of the degrees of a map
• chainComplex(Matrix) -- make a small chain complex
• clean(RR,Matrix), see clean -- Set to zero elements that are approximately zero
• coefficients(Matrix), see coefficients -- monomials and their coefficients
• coimage(Matrix), see coimage -- coimage of a map
• cokernel(Matrix), see cokernel -- cokernel of a map of modules, graded modules, or chaincomplexes
• components(Matrix), see components -- list the components of a direct sum
• contract(Matrix,Number), see contract(Matrix,Matrix) -- contract a matrix by a matrix
• contract(Matrix,RingElement), see contract(Matrix,Matrix) -- contract a matrix by a matrix
• contract(Matrix,Vector), see contract(Matrix,Matrix) -- contract a matrix by a matrix
• contract(Number,Matrix), see contract(Matrix,Matrix) -- contract a matrix by a matrix
• contract(RingElement,Matrix), see contract(Matrix,Matrix) -- contract a matrix by a matrix
• contract(Vector,Matrix), see contract(Matrix,Matrix) -- contract a matrix by a matrix
• degree(Matrix) (missing documentation)
• degrees(Matrix) -- degrees of target and source
• determinant(Matrix), see determinant -- determinant of a matrix
• diagonalMatrix(Matrix) -- make a diagonal matrix from entries of a matrix
• diff(Matrix,Vector), see diff(Matrix,Matrix) -- differentiate a matrix by a matrix
• diff(Vector,Matrix), see diff(Matrix,Matrix) -- differentiate a matrix by a matrix
• diff(Matrix,RingElement) -- differentiation
• diff(RingElement,Matrix) -- differentiate each entry of a matrix
• directSum(Matrix), see directSum -- direct sum of modules or maps
• eagonNorthcott(Matrix) -- Eagon-Northcott complex of a matrix of linear forms
• eigenvalues(Matrix), see eigenvalues -- find eigenvalues of a matrix
• eigenvectors(Matrix), see eigenvectors -- find eigenvectors of a matrix over RR or CC
• entries(Matrix), see entries -- lists the entries of a matrix
• Ext^ZZ(Matrix,Ideal), see Ext^ZZ(Matrix,Module) -- map between Ext modules
• Ext^ZZ(Matrix,Ring), see Ext^ZZ(Matrix,Module) -- map between Ext modules
• Ext^ZZ(Ideal,Matrix), see Ext^ZZ(Module,Matrix) -- map between Ext modules
• extend(ChainComplex,ChainComplex,Matrix) -- extend a module map to a chain map, if possible
• exteriorPower(List,Matrix) (missing documentation)
• forceGB(Matrix), see forceGB -- declare that the columns of a matrix are a Gröbner basis
• fromDual(Matrix) (missing documentation)
• gb(Matrix), see gb -- compute a Gröbner basis
• gbRemove(Matrix), see gbRemove -- remove Gröbner basis
• gbSnapshot(Matrix), see gbSnapshot -- the Gröbner basis matrix as so far computed
• Matrix _ ZZ, see generators of ideals and modules
• gramm(Matrix) (missing documentation)
• hermite(Matrix) (missing documentation)
• homology(Matrix,Matrix) -- homology of a pair of maps
• ideal(Matrix) -- make an ideal
• image(Matrix), see image -- image of a map
• indices(Matrix), see indices(RingElement) -- indices of variables occurring in a polynomial
• inducedMap(Module,Nothing,Matrix), see inducedMap(Module,Module,Matrix) -- compute the induced map
• inducedMap(Nothing,Module,Matrix), see inducedMap(Module,Module,Matrix) -- compute the induced map
• inducedMap(Nothing,Nothing,Matrix), see inducedMap(Module,Module,Matrix) -- compute the induced map
• inducesWellDefinedMap(Module,Module,Matrix), see inducesWellDefinedMap -- whether a map is well defined
• inducesWellDefinedMap(Module,Nothing,Matrix), see inducesWellDefinedMap -- whether a map is well defined
• inducesWellDefinedMap(Nothing,Module,Matrix), see inducesWellDefinedMap -- whether a map is well defined
• inducesWellDefinedMap(Nothing,Nothing,Matrix), see inducesWellDefinedMap -- whether a map is well defined
• installHilbertFunction(Matrix,RingElement), see installHilbertFunction -- install a Hilbert function without computation
• inverse(Matrix) -- compute the inverse
• isHomogeneous(Matrix), see isHomogeneous -- whether something is homogeneous (graded)
• isInjective(Matrix), see isInjective -- whether a map is injective
• isIsomorphism(Matrix), see isIsomorphism -- whether a map is an isomorphism
• isLLL(Matrix), see isLLL -- is a basis an LLL basis?
• isSurjective(Matrix), see isSurjective -- whether a map is surjective
• isWellDefined(Matrix), see isWellDefined -- whether a map is well defined
• kernel(Matrix) -- kernel of a matrix
• kernelLLL(Matrix) (missing documentation)
• koszul(Matrix) -- the Koszul complex
• leadComponent(Matrix), see leadComponent -- the leading component of a vector or matrix
• lift(Matrix,type of QQ,type of QQ), see lift -- lift to another ring
• lift(Matrix,type of QQ,type of ZZ), see lift -- lift to another ring
• lift(Matrix,type of ZZ,type of ZZ), see lift -- lift to another ring
• liftable(Matrix,type of Number) (missing documentation)
• LLL(Matrix), see LLL -- compute an LLL basis
• LUdecomposition(Matrix), see LUdecomposition -- LU decomposition
• map(Ring,Matrix) -- make a ring map
• map(Ring,Ring,Matrix) -- make a ring map
• markedGB(Matrix,Matrix) -- make a marked Gröbner basis
• Matrix ** RingElement -- a binary operator, usually used for tensor product or Cartesian product
• Matrix // RingElement, see Matrix // Matrix -- factor a map through another
• Matrix \\ Matrix, see Matrix // Matrix -- factor a map through another
• Matrix \\ RingElement, see Matrix // Matrix -- factor a map through another
• RingElement // Matrix, see Matrix // Matrix -- factor a map through another
• RingElement \\ Matrix, see Matrix // Matrix -- factor a map through another
• Matrix \\ Number (missing documentation)
• Matrix _ Sequence -- get entry of matrix
• Matrix | RingElement, see Matrix | Matrix -- join matrices horizontally
• Matrix | ZZ, see Matrix | Matrix -- join matrices horizontally
• RingElement | Matrix, see Matrix | Matrix -- join matrices horizontally
• ZZ | Matrix, see Matrix | Matrix -- join matrices horizontally
• Matrix || RingElement, see Matrix || Matrix -- join matrices vertically
• Matrix || ZZ, see Matrix || Matrix -- join matrices vertically
• RingElement || Matrix, see Matrix || Matrix -- join matrices vertically
• ZZ || Matrix, see Matrix || Matrix -- join matrices vertically
• Matrix % RingElement, see methods for normal forms and remainder -- calculate the normal form of ring elements and matrices
• RingElement % Matrix, see methods for normal forms and remainder -- calculate the normal form of ring elements and matrices
• minors(ZZ,Matrix) -- ideal generated by minors
• monomialIdeal(Matrix) -- monomial ideal of lead monomials
• monomials(Matrix), see monomials -- matrix of monomials in a ring element or matrix
• mutableMatrix(Matrix), see mutableMatrix -- make a mutable matrix
• newCoordinateSystem(PolynomialRing,Matrix), see newCoordinateSystem -- change variables
• norm(InfiniteNumber,Matrix), see norm
• norm(Matrix), see norm
• norm(RR,Matrix), see norm
• Number \\ Matrix (missing documentation)
• numColumns(Matrix) -- number of columns in a matrix or mutable matrix
• numeric(Matrix), see numeric -- convert to floating point
• numeric(ZZ,Matrix), see numeric -- convert to floating point
• numRows(Matrix) -- number of rows in a matrix or mutable matrix
• permanents(ZZ,Matrix), see permanents -- ideal generated by square permanents of a matrix
• pfaffians(ZZ,Matrix), see pfaffians -- ideal generated by Pfaffians
• pivots(Matrix) -- list of pivot locations of a matrix
• precision(Matrix), see precision
• rank(Matrix), see rank -- compute the rank
• resolution(Matrix) -- given a module map represented by a matrix, produce a comparison map between resolutions of its source and target
• ring(Matrix), see ring -- get the associated ring of an object
• ringFromFractions(Matrix,RingElement), see ringFromFractions -- find presentation for f.g. ring
• rsort(Matrix), see rsort -- sort a list or matrix in reverse order
• simpleDocFrob(ZZ,Matrix) -- a sample documentation node
• smithNormalForm(Matrix) -- smith normal form for a matrix over ZZ or a PID
• solve(Matrix,Matrix), see solve -- solve a linear equation
• sort(Matrix) -- sort the columns of a matrix
• sortColumns(Matrix), see sortColumns -- permutation giving sort order
• source(Matrix) -- find the source module of matrix
• submatrix'(Matrix,Nothing,VisibleList), see submatrix' -- exclude rows and/or columns of a matrix
• submatrix'(Matrix,VisibleList), see submatrix' -- exclude rows and/or columns of a matrix
• submatrix'(Matrix,VisibleList,Nothing), see submatrix' -- exclude rows and/or columns of a matrix
• submatrix'(Matrix,VisibleList,VisibleList), see submatrix' -- exclude rows and/or columns of a matrix
• submatrix(Matrix,VisibleList) -- select columns
• submatrix(Matrix,Nothing,VisibleList), see submatrix(Matrix,VisibleList,VisibleList) -- select part of a matrix
• submatrix(Matrix,VisibleList,Nothing), see submatrix(Matrix,VisibleList,VisibleList) -- select part of a matrix
• submatrix(Matrix,VisibleList,VisibleList) -- select part of a matrix
• subquotient(Matrix,Matrix), see subquotient -- make a subquotient module
• subquotient(Matrix,Nothing), see subquotient -- make a subquotient module
• subquotient(Module,Matrix,Matrix), see subquotient -- make a subquotient module
• subquotient(Module,Matrix,Nothing), see subquotient -- make a subquotient module
• subquotient(Module,Nothing,Matrix), see subquotient -- make a subquotient module
• subquotient(Nothing,Matrix), see subquotient -- make a subquotient module
• substitute(Ideal,Matrix), see substitute -- substituting values for variables
• substitute(Matrix,Option), see substitute -- substituting values for variables
• substitute(Module,Matrix), see substitute -- substituting values for variables
• substitute(RingElement,Matrix), see substitute -- substituting values for variables
• substitute(Vector,Matrix), see substitute -- substituting values for variables
• support(Matrix), see support -- list of variables occurring in a polynomial or matrix
• SVD(Matrix), see SVD -- singular value decomposition of a matrix
• symmetricAlgebra(Matrix), see symmetricAlgebra -- the symmetric algebra of a module
• symmetricAlgebra(Nothing,Nothing,Matrix), see symmetricAlgebra -- the symmetric algebra of a module
• symmetricAlgebra(Nothing,Ring,Matrix), see symmetricAlgebra -- the symmetric algebra of a module
• symmetricAlgebra(Ring,Nothing,Matrix), see symmetricAlgebra -- the symmetric algebra of a module
• symmetricAlgebra(Ring,Ring,Matrix), see symmetricAlgebra -- the symmetric algebra of a module
• symmetricKernel(Matrix), see symmetricKernel -- Compute the Rees ring of the image of a matrix
• target(Matrix) -- find the target module of matrix
• tensor(Ring,RingMap,Matrix) -- tensor product via a ring map
• toDual(ZZ,Matrix) (missing documentation)
• topCoefficients(Matrix), see topCoefficients -- first variable and its coefficient of a polynomial or matrix
• Tor_ZZ(Ideal,Matrix) (missing documentation)
• Tor_ZZ(Matrix,Ideal) (missing documentation)
• Tor_ZZ(Matrix,Ring) (missing documentation)
• trace(Matrix) -- trace of a matrix

## For the programmer

The object Matrix is a type, with ancestor classes ModuleMap < HashTable < Thing.