Reference

Subspaces.SubspaceType
Subspace(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::Array

    An orthonormal basis for this subspace. The final index of this array indexes the basis vectors.

  • perp::Array

    An orthonormal basis for the perpendicular subspace.

  • tol::AbstractFloat

    The tolerance for determining whether vectors are linearly dependent.

julia> Subspace([[1, 2, 3], [4, 5, 6]]) == Subspace([ 1 4; 2 5; 3 6])
true
source
Subspaces.dimMethod
dim(S::Subspace) -> Integer

Returns the linear dimension of this subspace.

julia> dim(Subspace([ [1,2,3], [4,5,6] ]))
2
source
Subspaces.each_basis_elementMethod
each_basis_element(S::Subspace) -> Base.Generator{_A,_B} where _B where _A

Create a generator that iterates over orthonormal basis vectors of a subspace.

source
Subspaces.empty_subspaceFunction
empty_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 0
source
Subspaces.frombasisMethod
frombasis(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
true
source
Subspaces.frombasisMethod
frombasis(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.

source
Subspaces.frombasisMethod
frombasis(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.

source
Subspaces.full_subspaceMethod
full_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 12
source
Subspaces.perpMethod
perp(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
true
source
Subspaces.projectionMethod
projection(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.

source
Subspaces.projectionMethod
projection(S::Subspace{var"#s25",N} where var"#s25"<:Number, x::Convex.AbstractExpr) -> Union{Convex.MultiplyAtom, Convex.ReshapeAtom}

Projection of vector x onto suspace S.

source
Subspaces.random_hermitian_subspaceFunction
random_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'
true
source
Subspaces.random_subspaceFunction
random_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 2
source
Subspaces.tobasisMethod

Returns 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
true
source