Tensors

    TensorDec.tensorFunction
    tensor(w, Xi, V, d) -> Polynomial{true,T} 

    Compute $∑ wᵢ (ξ_{i,1} V₁ + ... + ξ_{i,n} Vₙ)ᵈ$ where

    • Xi is a column-wise matrix of r points,
    • V is a vector of variables,
    • d is a degree.

    Example

    using TensorDec, DynamicPolynomials
    X = @polyvar x0 x1 x2
    w = rand(5)
    Xi = rand(3,5)
    tensor(w,Xi,X,4)
    source
    tensor(w, Xi, V, d) -> MultivariatePolynomial

    Compute $∑ wᵢ Π_j(ξ_{i,j,1} V[j][1] + ... + ξ_{i,j,n_j} V[j][n_j])^d[j]$ where

    • Xi is a vector of matrices of points,
    • V is a vector of vectors of variables,
    • d is a vector of degrees.

    Example

    using TensorDec, DynamicPolynomials
    X = @polyvar x0 x1 x2
    Y = @polyvar y0 y1
    w = rand(5)
    Xi0 = rand(3,5)
    Xi1 = rand(2,5)
    tensor(w,[Xi0,Xi1],[X,Y],[4,2])
    source
    tensor(H, L1, L2) -> MultivariatePolynomial

    Compute the symmetric tensor or homogeneous polynomial which Hankel matrix in the bases L1, L2 is H.

    source
    tensor(s, X, d) -> MultivariatePolynomial

    Compute the symmetric tensor or homogeneous polynomial in the variables X corresponding to the series s. The coefficients $s_{\alpha}$ are multiplied by $binomial(d,\alpha)$. The monomials are homogenised in degree d with respect to the last variable of X0.

    source
    tensor(A, B, C) -> Array{K,3}

    Compute the trilinear tensor $T=(∑_{l=1}^{length(w)} A[i,l]*B[j,l]*C[k,l])_{i,j,k}$.

    source
    tensor(w, A, B, C) -> Array{K,3}

    Compute the trilinear tensor $T=(∑_{l=1}^{length(w)} w[l]*A[i,l]*B[j,l]*C[k,l])_{i,j,k}$.

    source
    TensorDec.multilinearFunction
    multilinear(T, X, Y, Z) -> Polynomial{true,C}

    Compute the multilinear polynomial $T=(∑_{i,j,k} T[i,j,k]*X[i]*Y[j]*Z[k]$.

    source
    TensorDec.apolarproFunction
    apolarpro(P,Q) -> ComplexF64

    The apolar product of two homogeneous polynomials P=∑{|α|=d} binom{d}{α} pα x^α and Q=∑{|α|=d} binom{d}{α} qα x^α, of degree d in n variables is given by ⟨P,Q⟩d=∑{|α|=d} binom{d}{α}̅conj(pα) qα.

    Example

    julia> X= @polyvar x1 x2
    2-element Array{PolyVar{true},1}:
     x1
     x2
    
    julia> P=x1^2+2*im*x1*x2+x2^2
    x1² + (0 + 2im)x1x2 + x2²
    
    julia> Q=2*x1^2+3*x1*x2+6x2^2
    2x1² + 3x1x2 + 6x2²
    
    julia> apolarpro(P,Q)
    8.0 - 3.0im
    source
    TensorDec.norm_apolarFunction
    norm_apolar(P) -> Float64

    Gives the apolar norm of a homogeneous polynomial P=∑{|α|=d} binom{d}{α} pα x^α as: normapolar(P)=∑{|α|=d} binom{d}{α} pα*̄pα.

    ```

    source