Vector spaces
RadiiPolynomial defines a variety of vector spaces to represent the Banach space on which one applies the Radii Polynomial Theorem.
All spaces mentioned below are a subtype of the abstract type VectorSpace.
VectorSpace
├─ CartesianSpace
│ ├─ CartesianPower
│ └─ CartesianProduct
├─ ScalarSpace
└─ SequenceSpace
├─ BaseSpace
│ ├─ Chebyshev
│ ├─ Fourier
│ └─ Taylor
└─ TensorSpaceScalar space
A ScalarSpace represents the commutative field of a parameter. This is the standard space to use for a number in $\mathbb{R}$ or $\mathbb{C}$.
julia> 𝒫 = ScalarSpace()𝕂julia> dimension(𝒫)1julia> indices(𝒫)Base.OneTo(1)Sequence space
SequenceSpace is the abstract type for all sequence spaces.
SequenceSpace
├─ BaseSpace
│ ├─ Chebyshev
│ ├─ Fourier
│ └─ Taylor
└─ TensorSpaceBaseSpace
BaseSpace is the abstract type for all sequence spaces that are not a TensorSpace but can be interlaced to form one.
BaseSpace
├─ Chebyshev
├─ Fourier
└─ TaylorTaylor
For a given order $K \in \mathbb{N}_0$, a Taylor sequence space is the span of $\{\phi_0, \dots, \phi_K\}$ where $\phi_k(t) \bydef t^k$ for $k = 0, \dots, K$.
julia> 𝒯 = Taylor(1)Taylor(1)julia> order(𝒯)1julia> dimension(𝒯)2julia> indices(𝒯)0:1Fourier
For a given order $K \in \mathbb{N}_0$ and frequency $\omega \in (0, \infty)$, a Fourier sequence space is the span of $\{\phi_{-K}, \dots, \phi_K\}$ where $\phi_k(t) \bydef e^{\mathrm{i} \omega k t}$ for $k = -K, \dots, K$.
julia> ℱ = Fourier(1, 1.0)Fourier(1, 1.0)julia> order(ℱ)1julia> frequency(ℱ)1.0julia> dimension(ℱ)3julia> indices(ℱ)-1:1Chebyshev
For a given order $K \in \mathbb{N}_0$, a Chebyshev sequence space is the span of $\{\phi_0, \phi_1, \dots, \phi_K\}$ where $\phi_0(t) \bydef 1$, $\phi_1(t) \bydef t$ and $\phi_k(t) \bydef 2 t \phi_{k-1}(t) - \phi_{k-2}(t)$ for $k = 2, \dots, K$.
It is important to note that the coefficients $\{a_0, a_1, \dots, a_K}$ associated with a Chebyshev space are normalized in the library such that $\{a_0, 2a_1, \dots, 2a_K\}$ are the standard Chebyshev coefficients.
julia> 𝒞 = Chebyshev(1)Chebyshev(1)julia> order(𝒞)1julia> dimension(𝒞)2julia> indices(𝒞)0:1Tensor space
A TensorSpace is the tensor product of some BaseSpace. The standard constructor for TensorSpace is the ⊗ (\otimes<tab>) operator.
julia> 𝒯_otimes_ℱ_otimes_𝒞 = Taylor(1) ⊗ Fourier(1, 1.0) ⊗ Chebyshev(1) # TensorSpace((Taylor(1), Fourier(1, 1.0), Chebyshev(1)))Taylor(1) ⊗ Fourier(1, 1.0) ⊗ Chebyshev(1)julia> nspaces(𝒯_otimes_ℱ_otimes_𝒞)3julia> order(𝒯_otimes_ℱ_otimes_𝒞)(1, 1, 1)julia> frequency(𝒯_otimes_ℱ_otimes_𝒞, 2)1.0julia> dimension(𝒯_otimes_ℱ_otimes_𝒞)12julia> dimensions(𝒯_otimes_ℱ_otimes_𝒞)(2, 3, 2)julia> indices(𝒯_otimes_ℱ_otimes_𝒞)TensorIndices{Tuple{UnitRange{Int64}, UnitRange{Int64}, UnitRange{Int64}}}((0:1, -1:1, 0:1))Cartesian space
CartesianSpace is the abstract type for all cartesian spaces.
CartesianSpace
├─ CartesianPower
└─ CartesianProductCartesian power
A CartesianPower is the cartesian product of an identical VectorSpace. The standard constructor for CartesianPower is the ^ operator.
julia> 𝒯² = Taylor(1) ^ 2 # CartesianPower(Taylor(1), 2)Taylor(1)²julia> nspaces(𝒯²)2julia> dimension(𝒯²)4julia> indices(𝒯²)Base.OneTo(4)Cartesian product
A CartesianProduct is the cartesian product of some VectorSpace. The standard constructor for CartesianProduct is the × (\times<tab>) operator.
julia> 𝒫_times_𝒯 = ScalarSpace() × Taylor(1) # CartesianProduct((ScalarSpace(), Taylor(1)))𝕂 × Taylor(1)julia> nspaces(𝒫_times_𝒯)2julia> dimension(𝒫_times_𝒯)3julia> indices(𝒫_times_𝒯)Base.OneTo(3)Symmetric space
A SymmetricSpace restricts a SequenceSpace to the subspace invariant under a group of symmetries, storing one coefficient per orbit rather than one per index. Norms account for the multiplicity of each orbit, so a norm computed in the symmetric space agrees with the norm of the same function written out in full.
The common restrictions have shorthands:
evensymcorresponds to the invariance $u(-t) = u(t)$.oddsymcorresponds to the invariance $-u(-t) = u(t)$.d4symimposes the symmetries of the square on $u(x, y)$, with $u$ a periodic function.
For Fourier, evensym yields cosine series and oddsym yields sine series:
julia> indices(evensym(Fourier(3, 1.0)))0:1:3julia> indices(oddsym(Fourier(3, 1.0))) # k = 0 is not a valid representative1:1:3julia> indices(d4sym(Fourier(2, 1.0) ⊗ Fourier(2, 1.0)))6-element Vector{Tuple{Int64, Int64}}: (0, 0) (1, 0) (2, 0) (1, 1) (2, 1) (2, 2)For Taylor and Chebyshev, evensym and oddsym select the even and odd orders, respectively:
julia> indices(evensym(Taylor(4)))0:2:4julia> indices(oddsym(Taylor(4)))1:2:3symmetry returns the symmetry group of the space and desymmetrize strips the symmetry and returns the full space:
julia> symmetry(evensym(Fourier(3, 1.0)))Group{1, ExactReal{Rational{Int64}}}(Set(GroupElement{1, ExactReal{Rational{Int64}}}[GroupElement{1, ExactReal{Rational{Int64}}}(LatticeAut{1}([1;;]), Cocycle{1, ExactReal{Rational{Int64}}}(ExactReal{Rational{Int64}}(1//1), Rational{Int64}[0])), GroupElement{1, ExactReal{Rational{Int64}}}(LatticeAut{1}([-1;;]), Cocycle{1, ExactReal{Rational{Int64}}}(ExactReal{Rational{Int64}}(1//1), Rational{Int64}[0]))]), 0x249ff1c4dae243db)julia> desymmetrize(evensym(Fourier(3, 1.0)))Fourier(3, 1.0)Arbitrary symmetries are available by building a Group out of the generators, each represented by a GroupElement that pairs a LatticeAut $\beta_g$ on the indices with a Cocycle $\alpha_g$ on the coefficients, acting by $(g \cdot a)_k = \alpha_g(k) a_{\beta_g(k)}$.
API
RadiiPolynomial.BaseSpace — Type
BaseSpace <: SequenceSpaceAbstract type for all sequence spaces that are not a TensorSpace but can be interlaced to form one.
RadiiPolynomial.CartesianPower — Type
CartesianPower{T<:VectorSpace} <: CartesianSpaceCartesian space resulting from the cartesian product of the same VectorSpace.
Fields:
space :: Tn :: Int
Constructors:
CartesianPower(::VectorSpace, ::Int)^(::VectorSpace, ::Int): equivalent toCartesianPower(::VectorSpace, ::Int)
See also: ^(::VectorSpace, ::Int), CartesianProduct and ×.
Examples
julia> s = CartesianPower(Taylor(1), 3)Taylor(1)³julia> space(s)Taylor(1)julia> nspaces(s)3RadiiPolynomial.CartesianProduct — Type
CartesianProduct{T<:Tuple{Vararg{VectorSpace}}} <: CartesianSpaceCartesian space resulting from the cartesian product of some VectorSpace.
Field:
spaces :: T
Constructors:
CartesianProduct(::Tuple{Vararg{VectorSpace}})CartesianProduct(spaces::VectorSpace...): equivalent toCartesianProduct(spaces)×(s₁::VectorSpace, s₂::VectorSpace): equivalent toCartesianProduct((s₁, s₂))×(s₁::CartesianProduct, s₂::CartesianProduct): equivalent toCartesianProduct((s₁.spaces..., s₂.spaces...))×(s₁::CartesianProduct, s₂::VectorSpace): equivalent toCartesianProduct((s₁.spaces..., s₂))×(s₁::VectorSpace, s₂::CartesianProduct): equivalent toCartesianProduct((s₁, s₂.spaces...))
See also: ×, CartesianPower, ^(::VectorSpace, ::Int).
Examples
julia> s = CartesianProduct(Taylor(1), Fourier(2, 1.0), Chebyshev(3))Taylor(1) × Fourier(2, 1.0) × Chebyshev(3)julia> spaces(s)(Taylor(1), Fourier(2, 1.0), Chebyshev(3))julia> nspaces(s)3RadiiPolynomial.CartesianSpace — Type
CartesianSpace <: VectorSpaceAbstract type for all cartesian spaces.
RadiiPolynomial.Chebyshev — Type
Chebyshev <: BaseSpaceSequence space whose elements are Chebyshev sequences of a prescribed order.
Field:
order :: Int
Constructor:
Chebyshev(order::Int)
Examples
julia> s = Chebyshev(2)Chebyshev(2)julia> order(s)2RadiiPolynomial.Fourier — Type
Fourier{T<:Real} <: BaseSpaceSequence space whose elements are Fourier sequences of a prescribed order and frequency.
Fields:
order :: Intfrequency :: T
Constructor:
Fourier(order::Int, frequency::Real)
See also: Taylor and Chebyshev.
Examples
julia> s = Fourier(2, 1.0)Fourier(2, 1.0)julia> order(s)2julia> frequency(s)1.0RadiiPolynomial.ScalarSpace — Type
ScalarSpace <: VectorSpaceParameter space corresponding to a commutative field.
Example
julia> ScalarSpace()𝕂RadiiPolynomial.SequenceSpace — Type
SequenceSpace <: VectorSpaceAbstract type for all sequence spaces.
RadiiPolynomial.Taylor — Type
Taylor <: BaseSpaceSequence space whose elements are Taylor sequences of a prescribed order.
Field:
order :: Int
Constructor:
Taylor(order::Int)
See also: Fourier and Chebyshev.
Examples
julia> s = Taylor(2)Taylor(2)julia> order(s)2RadiiPolynomial.TensorIndices — Type
TensorIndices{T<:Tuple{Vararg{AbstractRange}}}Multidimentional rectangular range of indices for some TensorSpace.
Examples
julia> TensorIndices((0:2, -1:1))TensorIndices{Tuple{UnitRange{Int64}, UnitRange{Int64}}}((0:2, -1:1))julia> indices(Taylor(2) ⊗ Fourier(1, 1.0))TensorIndices{Tuple{UnitRange{Int64}, UnitRange{Int64}}}((0:2, -1:1))RadiiPolynomial.TensorSpace — Type
TensorSpace{T<:Tuple{Vararg{BaseSpace}}} <: SequenceSpaceSequence space resulting from the tensor product of some BaseSpace.
Field:
spaces :: T
Constructors:
TensorSpace(spaces::Tuple{Vararg{BaseSpace}})TensorSpace(spaces::BaseSpace...)⊗(s₁::BaseSpace, s₂::BaseSpace): equivalent toTensorSpace((s₁, s₂))⊗(s₁::TensorSpace, s₂::TensorSpace): equivalent toTensorSpace((s₁.spaces..., s₂.spaces...))⊗(s₁::TensorSpace, s₂::BaseSpace): equivalent toTensorSpace((s₁.spaces..., s₂))⊗(s₁::BaseSpace, s₂::TensorSpace): equivalent toTensorSpace((s₁, s₂.spaces...))
See also: ⊗.
Examples
julia> s = TensorSpace(Taylor(1), Fourier(2, 1.0), Chebyshev(3))Taylor(1) ⊗ Fourier(2, 1.0) ⊗ Chebyshev(3)julia> spaces(s)(Taylor(1), Fourier(2, 1.0), Chebyshev(3))RadiiPolynomial.UndefSpace — Type
UndefSpace <: VectorSpaceSentinel vector space flagging an undetermined space, e.g. as returned by domain when an operator has no domain on the given space.
Example
julia> UndefSpace()undefjulia> LinearOperator(UndefSpace(), UndefSpace(), [;;])LinearOperator : undef → undef with coefficients Matrix{Any}:RadiiPolynomial.VectorSpace — Type
VectorSpaceAbstract type for all vector spaces.
LinearAlgebra.:× — Method
×(::VectorSpace, ::VectorSpace)
×(::CartesianProduct, ::CartesianProduct)
×(::CartesianProduct, ::VectorSpace)
×(::VectorSpace, ::CartesianProduct)Create a CartesianProduct from the cartesian product of some VectorSpace.
See also: CartesianProduct, CartesianPower and ^(::VectorSpace, ::Int).
Examples
julia> Taylor(1) × Fourier(2, 1.0)Taylor(1) × Fourier(2, 1.0)julia> Taylor(1) × Fourier(2, 1.0) × Chebyshev(3)Taylor(1) × Fourier(2, 1.0) × Chebyshev(3)julia> (Taylor(1) × Fourier(2, 1.0)) × Chebyshev(3)Taylor(1) × Fourier(2, 1.0) × Chebyshev(3)julia> Taylor(1) × (Fourier(2, 1.0) × Chebyshev(3))Taylor(1) × Fourier(2, 1.0) × Chebyshev(3)julia> ScalarSpace()^2 × ((Taylor(1) ⊗ Fourier(2, 1.0)) × Chebyshev(3))^3𝕂² × ((Taylor(1) ⊗ Fourier(2, 1.0)) × Chebyshev(3))³RadiiPolynomial.:⊗ — Method
⊗(s₁::BaseSpace, s₂::BaseSpace)
⊗(s₁::TensorSpace, s₂::TensorSpace)
⊗(s₁::TensorSpace, s₂::BaseSpace)
⊗(s₁::BaseSpace, s₂::TensorSpace)Create a TensorSpace from the tensor product of some SequenceSpace.
See also: TensorSpace.
Examples
julia> Taylor(1) ⊗ Fourier(2, 1.0)Taylor(1) ⊗ Fourier(2, 1.0)julia> Taylor(1) ⊗ Fourier(2, 1.0) ⊗ Chebyshev(3)Taylor(1) ⊗ Fourier(2, 1.0) ⊗ Chebyshev(3)julia> Taylor(1) ⊗ (Fourier(2, 1.0) ⊗ Chebyshev(3))Taylor(1) ⊗ Fourier(2, 1.0) ⊗ Chebyshev(3)julia> (Taylor(1) ⊗ Fourier(2, 1.0)) ⊗ Chebyshev(3)Taylor(1) ⊗ Fourier(2, 1.0) ⊗ Chebyshev(3)RadiiPolynomial.Cocycle — Type
Cocycle(amplitude::Number, phase::AbstractVector{Rational{Int}})The factor $\alpha_g(k) = \rho e^{i\pi\langle\varphi,k\rangle}$ given by an amplitude $\rho$ and a phase $\varphi$ (measured in units of $\pi$ and stored modulo 2).
Together with a LatticeAut $\beta_g$ it defines the right action
\[(g \cdot a)_k = \alpha_g(k) \, a_{\beta_g(k)},\]
under which $\alpha$ is not itself a group action but a 1-cocycle: $\alpha_{gh}(k) = \alpha_g(\beta_h(k))\,\alpha_h(k)$. Since a finite group forces $\alpha_g(k)^{|G|} = 1$, amplitude should be a root of unity.
Fields:
amplitude :: Tphase :: SVector{N,Rational{Int}}
See also: LatticeAut and GroupElement.
RadiiPolynomial.Group — Type
Group(g::GroupElement, h::GroupElement...)The group generated by the given elements. It is closed under composition at construction, so elements returns every element and not only the generators.
See also: GroupElement and SymmetricSpace.
RadiiPolynomial.GroupElement — Type
GroupElement(lattice_aut::LatticeAut, cocycle::Cocycle)Combine a LatticeAut $\beta_g$ with the Cocycle $\alpha_g$ so that g defines the right action on a sequence
\[(g \cdot a)_k = \alpha_g(k) \, a_{\beta_g(k)}.\]
Elements compose with ∘.
Fields:
lattice_aut :: LatticeAut{N}cocycle :: Cocycle{N,T}
See also: LatticeAut, Cocycle, Group and SymmetricSpace.
RadiiPolynomial.LatticeAut — Type
LatticeAut(a::AbstractMatrix{Int})The automorphism of the index lattice induced by a symmetry, given by an integer matrix. Callable on an index or a tuple of indices.
See also: Cocycle and GroupElement.
RadiiPolynomial.SymmetricSpace — Type
SymmetricSpace(space::SequenceSpace, sym::Group)
SymmetricSpace(space::SequenceSpace)Restriction of space to the subspace invariant under sym, storing one coefficient per orbit. With no group given, the trivial one is used.
indices returns the orbit representatives, so dimension shrinks accordingly, and norms account for the multiplicity of each orbit. Some symmetries are available through evensym, oddsym and d4sym; build a Group directly for anything else.
Fields:
space :: Ssymmetry :: G
See also: desymmetrize, symmetry and Group.
RadiiPolynomial.d4sym — Method
d4sym(s::TensorSpace{<:Tuple{<:Fourier,<:Fourier}})Restrict a two-dimensional Fourier space to the subspace invariant under the dihedral group $D_4$, i.e., the symmetries of the square, generated by a quarter turn and a diagonal reflection.
Examples
julia> s = Fourier(2, 1.0) ⊗ Fourier(2, 1.0)Fourier(2, 1.0) ⊗ Fourier(2, 1.0)julia> indices(d4sym(s))6-element Vector{Tuple{Int64, Int64}}: (0, 0) (1, 0) (2, 0) (1, 1) (2, 1) (2, 2)See also: evensym, oddsym and SymmetricSpace.
RadiiPolynomial.desymmetrize — Method
desymmetrize(s::VectorSpace)Return the underlying space of s without its symmetry. Acts as the identity on a space that carries no symmetry.
Examples
julia> desymmetrize(evensym(Fourier(3, 1.0)))Fourier(3, 1.0)julia> desymmetrize(Taylor(2))Taylor(2)See also: SymmetricSpace and symmetry.
RadiiPolynomial.elements — Method
elements(g::Group)Return the set of GroupElements of g. The group is closed under composition at construction, so this is the full group and not just the generators it was built from.
RadiiPolynomial.evensym — Method
evensym(s::BaseSpace)Restrict s to the subspace of sequences invariant under the natural involution of its basis:
Fourier: identifies the modeskand-k, keepingk ≥ 0(cosine series).TaylorandChebyshev: keeps the even orders only.
Examples
julia> collect(indices(evensym(Fourier(3, 1.0))))4-element Vector{Int64}: 0 1 2 3julia> collect(indices(evensym(Taylor(4))))3-element Vector{Int64}: 0 2 4See also: oddsym, d4sym and SymmetricSpace.
RadiiPolynomial.oddsym — Method
oddsym(s::BaseSpace)Restrict s to the subspace of sequences anti-invariant under the natural involution of its basis:
Fourier: identifies the modeskand-ktogether with a sign flip, keepingk > 0(since series).TaylorandChebyshev: keeps the odd orders only.
Examples
julia> collect(indices(oddsym(Fourier(3, 1.0))))3-element Vector{Int64}: 1 2 3julia> collect(indices(oddsym(Taylor(4))))2-element Vector{Int64}: 1 3See also: evensym, d4sym and SymmetricSpace.
RadiiPolynomial.symmetry — Method
symmetry(s::VectorSpace)Return the Group that s is invariant under. A space carrying no symmetry returns the trivial group.
See also: SymmetricSpace, desymmetrize and elements.
Base.:^ — Method
^(s::VectorSpace, n::Int)Create a CartesianPower from n cartesian product(s) of s.
See also: CartesianPower, CartesianProduct, ×.
Examples
julia> Taylor(1)^3Taylor(1)³julia> (Taylor(1)^3)^2(Taylor(1)³)²