Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shifted inverse iteration example #133

Merged
merged 2 commits into from
Sep 21, 2018
Merged

Shifted inverse iteration example #133

merged 2 commits into from
Sep 21, 2018

Conversation

gflegar
Copy link
Member

@gflegar gflegar commented Sep 19, 2018

As promised, here is an example which uses the newly added linear combination support (#131). It implements the shifted inverse iteration method which needs to solve a system with (A - zI) in each iteration. For the stopping criterion, we need multiplication with A, so both matrices are needed. To avoid storing the matrix twice (and enable the solution of a linear system no matter in what format A is stored), we use gko::Combination to represent (A - zI).

TODO:

@gflegar gflegar added the reg:example This is related to the examples. label Sep 19, 2018
@gflegar gflegar self-assigned this Sep 19, 2018
Copy link
Collaborator

@hartwiganzt hartwiganzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice job!

@hartwiganzt
Copy link
Collaborator

Not sure where, but I feel this would also be a nice general routine part of the library. Obviously, it does not really fit the "linear operator" scheme...

@gflegar
Copy link
Member Author

gflegar commented Sep 20, 2018

Not sure where, but I feel this would also be a nice general routine part of the library. Obviously, it does not really fit the "linear operator" scheme...

It may fit the factory scheme. If you look at the eigenvalue decomposition A V = V L, then A = V L V^-1, which means you could treat it as any other factorization algorithm, which will be represented as factories that produce a combined operator containing the factors. That's easy for normal matrices (A^*A = AA^*), where V^--1 = V^*, so there's no additional computation. If V is not full, but still normal, we could also do A -> V L V^*, where the resulting operator represents a low-rank approximation of A.

The only problem is what to do if the matrix is not normal, so V does not have to be orthogonal. Then, one could do a low-rank approximation as A ~ V L V^+, but computing the pseudo-inverse might be expensive. We'll have to think about it more when we decide to support such matrices.

Concerning inverse iterations specifically, not sure we want to have it - it's not a very robust algorithm. It can only find 1 eigenvalue, and only if it's unique. Do people actually need this in practice, or would you always do something a bit more advanced? The natural next step would be to iterate a multidimensional subspace (leading to QR iterations if adding the full domain, not sure if there's an equivalent for sparse).

I'll create an issue later today to have a place to discuss how we may introduce eigensolvers to Ginkgo.

@gflegar
Copy link
Member Author

gflegar commented Sep 20, 2018

I was afraid to test it, but everything seems to work like a charm in complex arithmetic (even though the unit tests only check double, something that should be on our TODO list).
So I updated it to use complex. At least then we then have an example of how to use complex with Ginkgo.

@tcojean tcojean merged commit 953755b into develop Sep 21, 2018
@gflegar gflegar deleted the inverse_iteration branch September 22, 2018 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reg:example This is related to the examples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants