Skip to content

mat_eigen fails with matrices of TPS64 objects #48

Open
@afossa

Description

@afossa

The function mat_eigen fails when called on Matrix{TPS64{Dynamic}} objects.

MWE

using GTPSA
using NonlinearNormalForm

nv = 2
no = 1
nm = binomial(nv + no, nv)

d = Descriptor(nv, no)

M = [TPS() for i in 1:nv, j in 1:nv]
for i in 1:nv
    for j in 1:nv
        for k in 0:nm-1
            M[i, j][k] = randn()
        end
    end
end

F = mat_eigen(M)

Stacktrace

ERROR: LoadError: MethodError: no method matching eigen!(::Matrix{TPS64{GTPSA.Dynamic}}; permute::Bool, scale::Bool, sortby::typeof(LinearAlgebra.eigsortby))
The function `eigen!` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  eigen!(::AbstractMatrix, ::LinearAlgebra.Cholesky; sortby) got unsupported keyword arguments "permute", "scale"
   @ LinearAlgebra ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/symmetriceigen.jl:180
  eigen!(::StridedMatrix{T}, ::LinearAlgebra.LU{T, <:StridedMatrix{T} where T}; sortby) where T got unsupported keyword arguments "permute", "scale"
   @ LinearAlgebra ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/symmetriceigen.jl:215
  eigen!(::SkewLinearAlgebra.SkewHermitian{var"#s27", S} where {var"#s27"<:Real, S<:(AbstractMatrix{<:var"#s27"})}) got unsupported keyword arguments "permute", "scale", "sortby"
   @ SkewLinearAlgebra ~/.julia/packages/SkewLinearAlgebra/pOgQe/src/eigen.jl:94
  ...

Stacktrace:
 [1] _eigen(A::Matrix{TPS64{GTPSA.Dynamic}}; permute::Bool, scale::Bool, sortby::Function)
   @ LinearAlgebra ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/eigen.jl:252
 [2] _eigen
   @ ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/eigen.jl:247 [inlined]
 [3] #eigen#94
   @ ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/eigen.jl:239 [inlined]
 [4] eigen
   @ ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/eigen.jl:238 [inlined]
 [5] #mat_eigen#76
   @ ~/.julia/packages/NonlinearNormalForm/EXqdL/src/matrix.jl:22 [inlined]
 [6] mat_eigen(mat::Matrix{TPS64{GTPSA.Dynamic}})
   @ NonlinearNormalForm ~/.julia/packages/NonlinearNormalForm/EXqdL/src/matrix.jl:21
 [7] top-level scope
   @ ~/Developer/gtpsa-eigen/test_eigen.jl:19
in expression starting at ~/Developer/gtpsa-eigen/test_eigen.jl:19

The same error occurs both on the main and on the morecoast branches.

Tested on Julia v1.11.5 Apple aarch64 with environment:

Status `~/Developer/gtpsa-eigen/Project.toml`
  [b27dd330] GTPSA v1.4.2
  [05e19671] NonlinearNormalForm v1.0.0-DEV `https://github.com/bmad-sim/NonlinearNormalForm.jl.git#morecoast`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions