Linear algebra
Contents
- Creation of vector spaces
- Creation of vectors
- Basic properties of vector spaces
- Vector components
- Creation of matrix spaces
- Creation of matrices
- Basic properties of matrix spaces
- Matrix components
- Arithmetic
- Transpose, determinant, inverse
Creation of vector spaces
VectorSpace (K :: FldPadExact, n :: RngIntElt)
KSpace (K :: FldPadExact, n :: RngIntElt)
-> ModTupFld_FldPadExact
The full vector space over K
of dimension n
.
Creation of vectors
From coefficients
Vector (F :: FldPadExact, n :: RngIntElt, cs)
-> ModTupFldElt_FldPadExact
The vector of length n
over F
defined by cs
.
Vector (cs :: [FldPadExactElt])
-> ModTupFldElt_FldPadExact
The vector whose coefficients are given by cs
.
Special forms
Zero (V :: ModTupFld_FldPadExact)
ZeroVector (V :: ModTupFld_FldPadExact)
ZeroVector (F :: FldPadExact, n :: RngIntElt)
-> ModTupFldElt_FldPadExact
The zero vector.
Coercion
The following can be coerced to a vector in V:
- A vector in V
- A vector whose components are coercible to the base field of V
- A sequence of vector entries, all coercible to the base field
IsCoercible (V :: ModTupFld_FldPadExact, X)
-> BoolElt, Any
True if X
is coercible to an element of V
. If so, also returns the coerced element.
Basic properties of vector spaces
BaseField (V :: ModTupFld_FldPadExact)
-> FldPadExact
The base field of V
.
BaseField (v :: ModTupFldElt_FldPadExact)
-> FldPadExact
The base field of v
.
Degree (V :: ModTupFld_FldPadExact)
-> RngIntElt
If V
is a subspace of K^n
, returns n
. That is, the number of columns in vectors in V
.
Generic (V :: ModTupFld_FldPadExact)
-> ModTupFld_FldPadExact
The generic vector space containing V
.
IsGeneric (V :: ModTupFld_FldPadExact)
-> BoolElt
True if V
is generic, i.e. it was created as the full-dimensional vector space with default generators.
Dimension (V :: ModTupFld_FldPadExact)
-> RngIntElt
The dimension of V
.
Generators (V :: ModTupFld_FldPadExact)
-> []
The generators of V
.
Vector components
Nrows (v :: ModTupFldElt_FldPadExact)
Ncols (v :: ModTupFldElt_FldPadExact)
-> RngIntElt
Number of rows (always 1) and columns.
Eltseq (v :: ModTupFldElt_FldPadExact)
-> []
The components of v
as a sequence.
Component (v :: ModTupFldElt_FldPadExact, i :: RngIntElt)
'@' (i :: RngIntElt, v :: ModTupFldElt_FldPadExact)
-> FldPadExactElt
The i
th component of v
.
Creation of matrix spaces
KMatrixSpace (K :: FldPadExact, m :: RngIntElt, n :: RngIntElt)
-> ModMatFld_FldPadExact
The space of m x n
matrices over K
.
Creation of matrices
From coefficients
Matrix (K :: FldPadExactElt, nrows :: RngIntElt, ncols :: RngIntElt, cs)
-> ModMatFldElt_FldPadExact
The nrows x ncols
matrix over K
defined by cs
.
Matrix (nrows :: RngIntElt, ncols :: RngIntElt, cs :: [FldPadExactElt])
-> ModMatFldElt_FldPadExact
The nrows x ncols
matrix with coefficients cs
.
Matrix (cs :: [[FldPadExactElt]])
Matrix (cs :: [ModTupFldElt_FldPadExact])
-> ModMatFldElt_FldPadExact
The matrix whose rows are given by each entry in cs
.
Special forms
Zero (M :: ModMatFld_FldPadExact)
ZeroMatrix (M :: ModMatFld_FldPadExact)
ZeroMatrix (K :: FldPadExact, nrows :: RngIntElt, ncols :: RngIntElt)
-> ModMatFldElt_FldPadExact
The zero matrix.
Identity (M :: ModMatFld_FldPadExact)
IdentityMatrix (M :: ModMatFld_FldPadExact)
IdentityMatrix (K :: FldPadExact, nrows :: RngIntElt)
-> ModMatFldElt_FldPadExact
The identity matrix.
ScalarMatrix (M :: ModMatFld_FldPadExact, x)
ScalarMatrix (K :: FldPadExact, nrows :: RngIntElt, x)
ScalarMatrix (nrows :: RngIntElt, x :: FldPadExactElt)
-> ModMatFldElt_FldPadExact
The scalar matrix with x
on the diagonal and zero elsewhere.
DiagonalMatrix (M :: ModMatFld_FldPadExact, cs :: [])
DiagonalMatrix (K :: FldPadExact, cs :: [])
DiagonalMatrix (cs :: [FldPadExactElt])
-> ModMatFldElt_FldPadExact
The diagonal matrix with diagonal entries given by cs
.
Coercion
The following can be coerced to a matrix in M:
- A matrix in M (or whose components are coercible to the base field)
- A sequence of sequences of components
- A sequence of row vectors
- A sequence of components
IsCoercible (M :: ModMatFld_FldPadExact, X)
-> BoolElt, Any
True if X
is coercible to an element of M
. If so, also returns the coerced element.
Basic properties of matrix spaces
BaseField (M :: ModMatFld_FldPadExact)
BaseField (m :: ModMatFldElt_FldPadExact)
-> FldPadExact
The base field.
Nrows (M :: ModMatFld_FldPadExact)
Ncols (M :: ModMatFld_FldPadExact)
-> RngIntElt
Number of rows and columns.
Degree (M :: ModMatFld_FldPadExact)
-> RngIntElt
Number of components.
Dimension (M :: ModMatFld_FldPadExact)
-> RngIntElt
The dimension of M
.
Generators (M :: ModMatFld_FldPadExact)
-> []
The generators of M
.
RowSpace (M :: ModMatFld_FldPadExact)
-> ModTupFld_FldPadExact
The vector space of rows of M
.
TransposeSpace (M :: ModMatFld_FldPadExact)
-> ModMatFld_FldPadExact
The space of transposes of elements of M
.
Matrix components
Nrows (m :: ModMatFldElt_FldPadExact)
Ncols (m :: ModMatFldElt_FldPadExact)
-> RngIntElt
Number of rows and columns.
Eltseq (m :: ModMatFldElt_FldPadExact)
-> []
The components of m
.
Component (m :: ModMatFldElt_FldPadExact, i :: RngIntElt, j :: RngIntElt)
'@' (i :: RngIntElt, j :: RngIntElt, m :: ModMatFldElt_FldPadExact)
-> FldPadExactElt
The j
th component of the i
th row of m
.
Rows (m :: ModMatFldElt_FldPadExact)
-> []
The rows of m
.
Row (m :: ModMatFldElt_FldPadExact, i :: RngIntElt)
-> FldPadExactElt
'@' (i :: RngIntElt, m :: ModMatFldElt_FldPadExact)
-> ModTupFldElt_FldPadExact
The i
th row of m
.
Arithmetic
Addition
'-' (v :: ModTupFldElt_FldPadExact)
'+' (v :: ModTupFldElt_FldPadExact, w :: ModTupFldElt_FldPadExact)
'-' (v :: ModTupFldElt_FldPadExact, w :: ModTupFldElt_FldPadExact)
'&+' (vs :: [ModTupFldElt_FldPadExact])
-> ModTupFldElt_FldPadExact
Negation, addition, subtraction, sum of vectors.
'-' (m :: ModMatFldElt_FldPadExact)
'+' (m :: ModMatFldElt_FldPadExact, n :: ModMatFldElt_FldPadExact)
'-' (m :: ModMatFldElt_FldPadExact, n :: ModMatFldElt_FldPadExact)
'&+' (ms :: [ModMatFldElt_FldPadExact])
-> ModMatFldElt_FldPadExact
Negation, addition, subtraction, sum of matrices.
Scalar multiplication
'*' (v :: ModTupFldElt_FldPadExact, x :: FldPadExactElt)
'*' (x :: FldPadExactElt, v :: ModTupFldElt_FldPadExact)
'/' (v :: ModTupFldElt_FldPadExact, x :: FldPadExactElt)
-> ModTupFldElt_FldPadExact
Scalar multiplication and division of vectors.
Parameters
Safe := false
: (Divide only.) When true, this may be used as an intermediate variable inWithDependencies
with theFast
option.
'*' (m :: ModMatFldElt_FldPadExact, x :: FldPadExactElt)
'*' (x :: FldPadExactElt, m :: ModMatFldElt_FldPadExact)
'/' (m :: ModMatFldElt_FldPadExact, x :: FldPadExactElt)
-> ModMatFldElt_FldPadExact
Scalar multiplication and division of matrices.
Parameters
Safe := false
: (Divide only.) When true, this may be used as an intermediate variable inWithDependencies
with theFast
option.
Matrix multiplication
InnerProduct (v :: ModTupFldElt_FldPadExact, w :: ModTupFldElt_FldPadExact)
Norm (v :: ModTupFldElt_FldPadExact)
-> ModTupFldElt_FldPadExact
Inner product and norm.
'*' (x :: ModTupFldElt_FldPadExact, y :: ModMatFldElt_FldPadExact)
-> ModTupFldElt_FldPadExact
Vector-matrix multiplication.
'*' (x :: ModMatFldElt_FldPadExact, y :: ModMatFldElt_FldPadExact)
-> ModMatFldElt_FldPadExact
Matrix multiplication.
'^' (x :: ModMatFldElt_FldPadExact, n :: RngIntElt)
-> ModMatFldElt_FldPadExact
Matrix power. Negative powers are allowed for invertible matrices.
Parameters
Safe := false
: When true, this may be used as an intermediate variable inWithDependencies
with theFast
option.
Transpose, determinant, inverse
Transpose (m :: ModMatFldElt_FldPadExact)
-> ModMatFldElt_FldPadExact
Transpose.
Determinant (m :: ModMatFldElt_FldPadExact)
-> FldPadExactElt
Determinant.
IsDefinitelyInvertible (m :: ModMatFldElt_FldPadExact)
-> BoolElt, ModMatFldElt_FldPadExact
True if m
is definitely invertible. If so, also returns the inverse.
Parameters
Safe := false
: When true, the inverse may be used as an intermediate variable inWithDependencies
with theFast
option.