Reference
Subspaces.Subspace — TypeSubspace(basis::AbstractArray{AbstractArray{N}, 1}; tol::Real=1.0e-6)Create a subspace from the given basis, expressed as a list of basis vectors.
Subspace(basis::AbstractArray{N+1}; tol::Real=1.0e-6)Create a subspace from a basis given as a multi-dimensional array. The last array index enumerates the basis elements. E.g., if given a matrix this constructor will create a subspace representing the column span of that matrix.
The tol parameter sets the tolerance for determining whether vectors are linearly dependent.
basis::ArrayAn orthonormal basis for this subspace. The final index of this array indexes the basis vectors.
perp::ArrayAn orthonormal basis for the perpendicular subspace.
tol::AbstractFloatThe tolerance for determining whether vectors are linearly dependent.
julia> Subspace([[1, 2, 3], [4, 5, 6]]) == Subspace([ 1 4; 2 5; 3 6])
trueSubspaces.:⟂ — MethodCheck whether a is orthogonal to b.
Subspaces.dim — Methoddim(S::Subspace) -> Integer
Returns the linear dimension of this subspace.
julia> dim(Subspace([ [1,2,3], [4,5,6] ]))
2Subspaces.each_basis_element — Methodeach_basis_element(S::Subspace) -> Base.Generator{_A,_B} where _B where _A
Create a generator that iterates over orthonormal basis vectors of a subspace.
Subspaces.empty_subspace — Functionempty_subspace(T::Type, siz::Tuple) -> Subspace{_A,_B} where _B where _A
empty_subspace(T::Type, siz::Tuple, tol::Any) -> Subspace{_A,_B} where _B where _A
Create an empty subspace of dimension-siz vector space, on base field T.
julia> S = empty_subspace(ComplexF64, (3, 4))
Subspace{Complex{Float64}} size (3, 4) dim 0Subspaces.frombasis — Methodfrombasis(S::Subspace, x::AbstractArray{var"#s25",1} where var"#s25"<:Number) -> Any
Returns a vector from the given basis components in the basis S.basis.
See also: tobasis.
julia> S = random_subspace(ComplexF64, 2, 10)
Subspace{Complex{Float64}} size (10,) dim 2
julia> x = randn(2);
julia> size(frombasis(S, x))
(10,)
julia> norm( tobasis(S, frombasis(S, x)) - x ) < 1e-8
trueSubspaces.frombasis — Methodfrombasis(S::Subspace{var"#s25",1} where var"#s25"<:Number, x::Convex.AbstractExpr) -> Convex.MultiplyAtom
Returns a vector from the given basis components in the basis S.basis.
Subspaces.frombasis — Methodfrombasis(S::Subspace{var"#s25",2} where var"#s25"<:Number, x::Convex.AbstractExpr) -> Convex.ReshapeAtom
Returns a vector from the given basis components in the basis S.basis.
Subspaces.full_subspace — Methodfull_subspace(T::Type, siz::Tuple) -> Subspace{_A,_B} where _B where _A
Create an full subspace of dimension-siz vector space, on base field T.
julia> S = full_subspace(ComplexF64, (3, 4))
Subspace{Complex{Float64}} size (3, 4) dim 12Subspaces.hermitian_basis — MethodGiven a subspace satisfying S == S', returns a basis in which each basis element is Hermitian.
Subspaces.perp — Methodperp(S::Subspace) -> Subspace{_A,_B} where _B where _A
Returns the orthogonal subspace. Can also be written as ~S.
julia> S = Subspace([ [1,2,3], [4,5,6] ])
Subspace{Float64} size (3,) dim 2
julia> perp(S)
Subspace{Float64} size (3,) dim 1
julia> perp(S) == ~S
true
julia> perp(S) ⟂ S
trueSubspaces.projection — Methodprojection(S::Subspace{var"#s23",N} where var"#s23"<:Number, x::AbstractArray{var"#s22",N} where var"#s22"<:Number) -> Any
Projection of vector x onto suspace S.
Subspaces.projection — Methodprojection(S::Subspace{var"#s25",N} where var"#s25"<:Number, x::Convex.AbstractExpr) -> Union{Convex.MultiplyAtom, Convex.ReshapeAtom}
Projection of vector x onto suspace S.
Subspaces.random_element — Methodrandom_element(S::Subspace{T<:Number,N} where N) -> Any
Returns a random element of a subspace.
Subspaces.random_hermitian_subspace — Functionrandom_hermitian_subspace(T::Type, d::Int64, n::Int64) -> Subspace{_A,_B} where _B where _A
random_hermitian_subspace(T::Type, d::Int64, n::Int64, tol::Any) -> Subspace{_A,_B} where _B where _A
Random dimension-d subspace of n × n matrices on base field T, satisfying x ∈ S => x' ∈ S.
julia> S = random_hermitian_subspace(ComplexF64, 2, 3)
Subspace{Complex{Float64}} size (3, 3) dim 2
julia> S == S'
trueSubspaces.random_subspace — Functionrandom_subspace(T::Type, d::Int64, siz::Any) -> Subspace{_A,_B} where _B where _A
random_subspace(T::Type, d::Int64, siz::Any, tol::Any) -> Subspace{_A,_B} where _B where _A
Random dimension-d subspace of dimension-siz vector space, on base field T.
julia> S = random_subspace(ComplexF64, 2, (3, 4))
Subspace{Complex{Float64}} size (3, 4) dim 2Subspaces.tobasis — MethodReturns the basis components of x in the basis S.basis.
See also: frombasis.
julia> S = random_subspace(ComplexF64, 2, 10)
Subspace{Complex{Float64}} size (10,) dim 2
julia> x = randn(10);
julia> size(tobasis(S, x))
(2,)
julia> norm( frombasis(S, tobasis(S, x)) - projection(S, x) ) < 1e-8
trueSubspaces.tobasis — MethodReturns the basis components of x in the basis S.basis.
Subspaces.variable_in_space — MethodCreates a Convex.jl variable ranging over the given subspace.
Subspaces.variable_in_space — MethodCreates a Convex.jl variable ranging over the given subspace.