Algebraic varieties

Abstract type for algebraic varieties is given by

AffineSpace

AlgebraicInterpolation.AffineSpaceType
AffineSpace <: AbstractAlgebraicVariety

An AbstractAlgebraicVariety that represents an affine space $\mathbb{C}^n$.

Constructors

AffineSpace(vars::AbstractVector{Variable})
AffineSpace(vars::AbstractArray)

Examples

julia> @var R[1:3,1:3] t[1:3]
(Variable[R₁₋₁ R₁₋₂ R₁₋₃; R₂₋₁ R₂₋₂ R₂₋₃; R₃₋₁ R₃₋₂ R₃₋₃], Variable[t₁, t₂, t₃])

julia> AffineSpace(t)
AffineSpace of dimension 3
 variables: t₁, t₂, t₃

julia> AffineSpace(R)
AffineSpace of dimension 9
 variables: R₁₋₁, R₂₋₁, R₃₋₁, R₁₋₂, R₂₋₂, R₃₋₂, R₁₋₃, R₂₋₃, R₃₋₃

julia> AffineSpace([R, t])
AffineSpace of dimension 12
 variables: R₁₋₁, R₂₋₁, R₃₋₁, R₁₋₂, R₂₋₂, R₃₋₂, R₁₋₃, R₂₋₃, R₃₋₃, t₁, t₂, t₃
source

AlgebraicVariety

AlgebraicInterpolation.AlgebraicVarietyType
AlgebraicVariety <: AbstractAlgebraicVariety

An AbstractAlgebraicVariety that represents basic algebraic variety defined by polynomial equations.

Constructors

AlgebraicVariety(
    exprs::AbstractVector{Expression},
    sample_generator::Function;
    variables::AbstractVector{Variable}
)
AlgebraicVariety(
    exprs::AbstractVector{Expression};
    variables::AbstractVector{Variable}
)
AlgebraicVariety(exprs::AbstractArray, sample_generator::Function; variables::AbstractArray)
AlgebraicVariety(exprs::AbstractArray; variables::AbstractArray)

Examples

julia> @var R[1:2,1:2] t[1:2]
(Variable[R₁₋₁ R₁₋₂; R₂₋₁ R₂₋₂], Variable[t₁, t₂])

julia> AlgebraicVariety([R'*R-I, det(R)-1]; variables=[R, t])
AlgebraicVariety X ⊂ ℂ⁶
 6 variables: R₁₋₁, R₂₋₁, R₁₋₂, R₂₋₂, t₁, t₂
 5 expressions: 
  -1 + R₁₋₁^2 + R₂₋₁^2
  R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
  R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
  -1 + R₁₋₂^2 + R₂₋₂^2
  -1 + R₁₋₁*R₂₋₂ - R₁₋₂*R₂₋₁
source

MapGraph

AlgebraicInterpolation.MapGraphType
MapGraph{T<:ExpressionMap} <: AbstractAlgebraicVariety

An AbstractAlgebraicVariety that represents a graph $\Gamma = \{(x, \varphi(x)) \;|\; x \in X\}$ of an ExpressionMap $\varphi \colon X \dashrightarrow \mathbb{C}^m$.

Constructor

MapGraph(φ::ExpressionMap)

Examples

julia> @var R[1:2,1:2] t[1:2] s[1:2]
(Variable[R₁₋₁ R₁₋₂; R₂₋₁ R₂₋₂], Variable[t₁, t₂], Variable[s₁, s₂])

julia> X = AlgebraicVariety([R'*R-I, det(R)-1]; variables=[R, t]);

julia> Γ = MapGraph(ExpressionMap(X, expressions=Pair(s, R*t)))
MapGraph Γ ⊂ ℂ⁶ × ℂ²
 domain part:
  AlgebraicVariety X ⊂ ℂ⁶
   6 variables: R₁₋₁, R₂₋₁, R₁₋₂, R₂₋₂, t₁, t₂
   5 expressions: 
    -1 + R₁₋₁^2 + R₂₋₁^2
    R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
    R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
    -1 + R₁₋₂^2 + R₂₋₂^2
    -1 + R₁₋₁*R₂₋₂ - R₁₋₂*R₂₋₁
 image part:
  s₁ = t₁*R₁₋₁ + t₂*R₁₋₂
  s₂ = t₁*R₂₋₁ + t₂*R₂₋₂
source

Methods

We will show the basic functionality of AbstractAlgebraicVariety on 2 concrete examples defined in AlgebraicVariety and MapGraph.

AlgebraicInterpolation.variablesMethod
variables(X::AbstractAlgebraicVariety) -> Vector{Variable}

Return the variables of X.

Examples

julia> variables(X)
6-element Vector{Variable}:
 R₁₋₁
 R₂₋₁
 R₁₋₂
 R₂₋₂
   t₁
   t₂

julia> variables(Γ)
8-element Vector{Variable}:
 R₁₋₁
 R₂₋₁
 R₁₋₂
 R₂₋₂
   t₁
   t₂
   s₁
   s₂
source
AlgebraicInterpolation.expressionsMethod
expressions(X::AbstractAlgebraicVariety) -> Vector{Expression}

Return the expressions of X.

Examples

julia> expressions(X)
5-element Vector{Expression}:
       -1 + R₁₋₁^2 + R₂₋₁^2
      R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
      R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
       -1 + R₁₋₂^2 + R₂₋₂^2
 -1 + R₁₋₁*R₂₋₂ - R₁₋₂*R₂₋₁

julia> expressions(Γ)
7-element Vector{Expression}:
       -1 + R₁₋₁^2 + R₂₋₁^2
      R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
      R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
       -1 + R₁₋₂^2 + R₂₋₂^2
 -1 + R₁₋₁*R₂₋₂ - R₁₋₂*R₂₋₁
   s₁ - (t₁*R₁₋₁ + t₂*R₁₋₂)
   s₂ - (t₁*R₂₋₁ + t₂*R₂₋₂)
source
AlgebraicInterpolation.generate_sampleFunction
generate_sample(X::AbstractAlgebraicVariety) -> Vector{ComplexF64}

Generate a sample from X.

Examples

julia> generate_sample(X)
6-element Vector{ComplexF64}:
 -0.8044679533846167 - 0.37355606563379196im
  0.7966605813908512 - 0.3772169611682977im
 -0.7966605813908512 + 0.3772169611682977im
 -0.8044679533846167 - 0.37355606563379196im
 -0.1653103992303188 - 0.014776408348405386im
  0.4869739603874435 - 0.8113780972782965im

julia> generate_sample(Γ)
8-element Vector{ComplexF64}:
  -0.9484588204432428 + 0.27190339385225026im
  -0.5995036004937357 - 0.4301711816163053im
   0.5995036004937357 + 0.43017118161630535im
  -0.9484588204432428 + 0.27190339385225026im
  -0.5638302344774876 - 0.3707771509690897im
  0.38660464552523993 + 0.4470517026250209im
   0.6750474426323179 + 0.6326747874590103im
 -0.30971285075613664 + 0.14593473983144623im
source
AlgebraicInterpolation.jacobianFunction
jacobian(X::AbstractAlgebraicVariety) -> Matrix{Expression}

Return the symbolic jacobian of X.

Examples

julia> jacobian(X)
5×6 Matrix{Expression}:
 2*R₁₋₁  2*R₂₋₁       0       0  0  0
   R₁₋₂    R₂₋₂    R₁₋₁    R₂₋₁  0  0
   R₁₋₂    R₂₋₂    R₁₋₁    R₂₋₁  0  0
      0       0  2*R₁₋₂  2*R₂₋₂  0  0
   R₂₋₂   -R₁₋₂   -R₂₋₁    R₁₋₁  0  0

julia> jacobian(Γ)
7×8 Matrix{Expression}:
 2*R₁₋₁  2*R₂₋₁       0       0      0      0  0  0
   R₁₋₂    R₂₋₂    R₁₋₁    R₂₋₁      0      0  0  0
   R₁₋₂    R₂₋₂    R₁₋₁    R₂₋₁      0      0  0  0
      0       0  2*R₁₋₂  2*R₂₋₂      0      0  0  0
   R₂₋₂   -R₁₋₂   -R₂₋₁    R₁₋₁      0      0  0  0
    -t₁       0     -t₂       0  -R₁₋₁  -R₁₋₂  1  0
      0     -t₁       0     -t₂  -R₂₋₁  -R₂₋₂  0  1
source
jacobian(X::AbstractAlgebraicVariety, x::AbstractVector{<:Number}) -> Matrix{<:Number}

Return the jacobian of X evaluated at x.

Examples

julia> x = generate_sample(X);

julia> jacobian(X, x)
5×6 Matrix{ComplexF64}:
  -1.53374+0.72824im    -1.62756-0.686261im        0.0+0.0im             0.0+0.0im       0.0+0.0im  0.0+0.0im
  0.813778+0.343131im  -0.766869+0.36412im   -0.766869+0.36412im   -0.813778-0.343131im  0.0+0.0im  0.0+0.0im
  0.813778+0.343131im  -0.766869+0.36412im   -0.766869+0.36412im   -0.813778-0.343131im  0.0+0.0im  0.0+0.0im
       0.0+0.0im             0.0+0.0im         1.62756+0.686261im   -1.53374+0.72824im   0.0+0.0im  0.0+0.0im
 -0.766869+0.36412im   -0.813778-0.343131im   0.813778+0.343131im  -0.766869+0.36412im   0.0+0.0im  0.0+0.0im

julia> x = generate_sample(Γ);

julia> jacobian(Γ, x)
7×8 Matrix{ComplexF64}:
   1.98004+0.441998im   1.01158-0.865159im        0.0+0.0im       …        0.0+0.0im             0.0+0.0im       0.0+0.0im  0.0+0.0im
 -0.505789+0.43258im   0.990022+0.220999im   0.990022+0.220999im           0.0+0.0im             0.0+0.0im       0.0+0.0im  0.0+0.0im
 -0.505789+0.43258im   0.990022+0.220999im   0.990022+0.220999im           0.0+0.0im             0.0+0.0im       0.0+0.0im  0.0+0.0im
       0.0+0.0im            0.0+0.0im        -1.01158+0.865159im           0.0+0.0im             0.0+0.0im       0.0+0.0im  0.0+0.0im
  0.990022+0.220999im  0.505789-0.43258im   -0.505789+0.43258im            0.0+0.0im             0.0+0.0im       0.0+0.0im  0.0+0.0im
  -0.85827+0.362656im       0.0+0.0im       -0.625043-0.817264im  …  -0.990022-0.220999im   0.505789-0.43258im   1.0+0.0im  0.0+0.0im
       0.0+0.0im       -0.85827+0.362656im        0.0+0.0im          -0.505789+0.43258im   -0.990022-0.220999im  0.0+0.0im  1.0+0.0im
source
AlgebraicInterpolation.tangent_spaceFunction
tangent_space(X::AbstractAlgebraicVariety, x::AbstractVector{<:Number}; <keyword arguments>) -> Matrix{<:Number}

Return the tangent space of X at x.

Keyword arguments

  • tols::Tolerances=Tolerances(): tolerances for numerical computations.

Examples

julia> x = generate_sample(X);

julia> tangent_space(X, x)
6×3 Matrix{ComplexF64}:
  0.326172+0.12926im   0.0-0.0im  0.0-0.0im
  0.597181-0.142401im  0.0-0.0im  0.0-0.0im
 -0.597181+0.142401im  0.0-0.0im  0.0-0.0im
  0.326172+0.12926im   0.0-0.0im  0.0-0.0im
      -0.0-0.0im       1.0-0.0im  0.0-0.0im
       0.0-0.0im       0.0-0.0im  1.0-0.0im

julia> x = generate_sample(Γ);

julia> tangent_space(Γ, x)
8×3 Matrix{ComplexF64}:
 0.0363119-0.652215im         0.0-0.0im              0.0-0.0im
 -0.242325-0.120728im         0.0-0.0im              0.0-0.0im
  0.242325+0.120728im         0.0-0.0im              0.0-0.0im
 0.0363119-0.652215im         0.0-0.0im              0.0-0.0im
      -0.0-0.0im              1.0-0.0im              0.0-0.0im
       0.0-0.0im              0.0-0.0im              1.0-0.0im
  0.421251+0.0796069im  -0.201566+0.390146im    -1.05694-0.0744038im
  0.458737-0.15848im      1.05694+0.0744038im  -0.201566+0.390146im
source
AlgebraicInterpolation.dimensionFunction
dimension(X::AbstractAlgebraicVariety; <keyword arguments>) -> Int

Computes the dimension of X.

Keyword arguments

  • sample::Union{AbstractVector{<:Number}, Nothing}=nothing: point that belongs to X.
  • tols::Tolerances=Tolerances(): tolerances for numerical computations.

Examples

julia> dimension(X)
3

julia> dimension(Γ)
3
source
AlgebraicInterpolation.finite_dominant_projectionFunction
finite_dominant_projection(X::AbstractAlgebraicVariety; <keyword arguments>) -> ExpressionMap

Returns a finite dominant projection from X to an affine space.

Keyword arguments

  • sample::Union{AbstractVector{<:Number}, Nothing}=nothing: point that belongs to X.
  • tols::Tolerances=Tolerances(): tolerances for numerical computations.

Examples

julia> finite_dominant_projection(X)
ExpressionMap: ℂ⁶ ⊇ X - - > ℂ³
 domain:
  AlgebraicVariety X ⊂ ℂ⁶
   6 variables: R₁₋₁, R₂₋₁, R₁₋₂, R₂₋₂, t₁, t₂
   5 expressions: 
    -1 + R₁₋₁^2 + R₂₋₁^2
    R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
    R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
    -1 + R₁₋₂^2 + R₂₋₂^2
    -1 + R₁₋₁*R₂₋₂ - R₁₋₂*R₂₋₁
 action:
  projection to R₁₋₁, t₁, t₂

julia> finite_dominant_projection(Γ)
ExpressionMap: ℂ⁸ ⊇ X - - > ℂ³
 domain:
  MapGraph Γ ⊂ ℂ⁶ × ℂ²
   domain part:
    AlgebraicVariety X ⊂ ℂ⁶
     6 variables: R₁₋₁, R₂₋₁, R₁₋₂, R₂₋₂, t₁, t₂
     5 expressions: 
      -1 + R₁₋₁^2 + R₂₋₁^2
      R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
      R₁₋₁*R₁₋₂ + R₂₋₁*R₂₋₂
      -1 + R₁₋₂^2 + R₂₋₂^2
      -1 + R₁₋₁*R₂₋₂ - R₁₋₂*R₂₋₁
   image part:
    s₁ = t₁*R₁₋₁ + t₂*R₁₋₂
    s₂ = t₁*R₂₋₁ + t₂*R₂₋₂
 action:
  projection to R₁₋₁, t₁, t₂
source