This package supports Standard vector spaces over Number
.
A vector space is generated by one of the constructors:
VectorSpace([T,] n)
for the full space of dimensionn
(T^n)ZeroSpace([T,] n)
for the zero subspace in the space of dimensionn
VectorSpace(M::Matrix)
for a subspace of the space of dimensionsize(M, 1)
V'
for the orthogonal complement ofVectorSpace V
.
or derived from a (n, m)
abstract matrix M
:
image(M)
=VectorSpace(M)
kernel(M)
subspace ofVectorSpace(n)
M * V
=M(V)
the image ofV
under the mapping matrixM
M \ V
inverse image ofV
under the mappingM
An orthogonal basis is given by span(V::VectorSpace)
, which is a orthogonal
or unitary matrix of order dim(V), rank(V)
.
The following invariants are maintained:
image(span(V)) == V
rank(image(M)) == rank(M)
kernel(M') == image(M)'
kernel(M)' == image(M')
Binary operators with vector spaces are
V ∩ W
the vector space intersectionV ∪ W
the vector space sumV ⊆ W
subset relationv ∈ W
element relation for a vectorv
(...) pkg> add VectorSpaces
julia> using VectorSpaces
julia> F = rand(26, 5);
julia> VF = image(F)
VectorSpace{Float64, Matrix{Float64}} rank 5 dim 26
julia> G = F[:,3:4];
julia> G = [G ones(26)];
julia> VG = image(G)
VectorSpace{Float64, Matrix{Float64}} rank 3 dim 26
julia> VF ∩ VG
VectorSpace{Float64, Matrix{Float64}} rank 2 dim 26
julia> VF ∪ VG
VectorSpace{Float64, Matrix{Float64}} rank 6 dim 26
span(VF ∩ VG)
26×2 Matrix{Float64}:
...
julia> kernel(F')
VectorSpace{Float64, Matrix{Float64}} rank 21 dim 26
julia> kernel(F') == image(F)'
true
julia> H = [G G[:,1]+G[:,2]];
julia> rank(H) == rank(image(H))
true
julia> kernel(H)' == image(H')
true
Each space is represented by a dimension dim
and a rank rank
.
If the rank is not 0 and less than dim, a qr-factorization is used to define an
orthonormal (or unitary) basis.
The orthogonal complement V'
of a vector space V
is represented by
the same qr-factors and an additional indicator.