wrong eigh eigenvectors for complex valued matrix
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start by reproducing the provided complex-valued matrix example and trace the implementation behind eigh with UPLO::Lower. Compare the eigenvector result for the matrix and its Hermitian conjugate, then add a regression test based on the shown assertions; done means the original matrix's eigenvectors satisfy the eigenvalue equation.
Written by the indexing model from the issue text.
Description
The resulting eigenvectors for eigh of complex valued matrix is wrong.
If eigh is called with the hermitian conjugate of the matrix,
the resulting eigenvectors are the eigenvectors of the original matrix.
let values = vec![
c64::new(1.0, 0.0), c64::new(0.0, -2.0),
c64::new(0.0, 2.0), c64::new(5.0, 0.0),
];
let matrix = Array2::<c64>::from_shape_vec([2; 2], values).unwrap();
// assertion passed
let (eigvalues, eigvecs) = matrix.t().mapv(|v| v.conj()).eigh(UPLO::Lower).unwrap();
for i in 0 .. 2 {
let dot = matrix.dot(&eigvecs.column(i));
let mul = &eigvecs.column(i).mapv(|c| c*eigvalues[i]);
assert_close_l2!(&dot, &mul, 1.0e-10);
}
// assertion failed.
let (eigvalues, eigvecs) = matrix.eigh(UPLO::Lower).unwrap();
for i in 0 .. 2 {
let dot = matrix.dot(&eigvecs.column(i));
let mul = &eigvecs.column(i).mapv(|c| c*eigvalues[i]);
assert_close_l2!(&dot, &mul, 1.0e-10);
}
- Dominant language
- Rust
- Stars
- 452
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray-linalg
-
Thin SVD Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
rust-ndarray/ndarray-linalg#413 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-ndarray/ndarray-linalg#404 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#402 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#401 · 2 reactions ·
All issues in rust-ndarray/ndarray-linalg
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100