SciML / SciML/DataDrivenDiffEq.jl

truncated_svd() is unable to handle complex matrices

Open
#367 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
430
Forks
58
Avg merge
6h 29m
Merged PRs (30d)
28

Description

truncated_svd appears to be unable to handle complex matrices (both with the method of truncation by explicit rank or tolerance). The following code which uses truncated_svd() via DMDSVD() fails.

using DataDrivenDiffEq
freq1 = 2
freq2 = 3
freq3 = 11

dt = 0.1
t = 0:dt:30

x = exp.(1im*freq1*t);
y = exp.(1im*freq2*t);
z = exp.(1im*freq3*t);

X = hcat(x,y,z)';

problem = DiscreteDataDrivenProblem(X, t);
res = solve(problem, DMDSVD());

with errors:

 [1] min(x::Float64, y::ComplexF64)
   @ Base ./operators.jl:433
 [2] truncated_svd(A::Matrix{ComplexF64}, truncation::Float64)
   @ DataDrivenDiffEq ~/.julia/packages/DataDrivenDiffEq/s9jl3/src/koopman/algorithms.jl:3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in koopman/algorithms.jl at truncated_svd, then reproduce the failure with the supplied complex-matrix example through DMDSVD(). Check both explicit-rank and tolerance truncation paths; done means the example completes without the shown type error for complex matrices.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.