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

Support complex numbers in serial linear solvers, add BLAS zdot #6117

Merged
merged 8 commits into from
Jul 19, 2024

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Jun 25, 2024

Proposed changes

Adds complex numbers support to the serial linear solvers, which are used as preconditioners in the parallel linear solvers. Most notably, extends the GMRES algorithm to complex arithmetics, which involves the inner product on the vector space of complex numbers.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@nilsvu nilsvu force-pushed the complex_linsolv branch 3 times, most recently from 6f0bbed to 2e0a9e1 Compare June 25, 2024 22:40
@nilsvu nilsvu force-pushed the complex_linsolv branch 3 times, most recently from 548e8a0 to 2621cc6 Compare July 16, 2024 14:11
@nilsvu nilsvu requested a review from wthrowe July 16, 2024 14:19
@nilsvu
Copy link
Member Author

nilsvu commented Jul 16, 2024

@wthrowe would you be willing to review this one?

Copy link
Member

@wthrowe wthrowe left a comment

Choose a reason for hiding this comment

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

Looks overall OK, but it's not compiling, and it looks like the intermediate commits won't compile even after the overall problems are fixed.

double>);
static_assert(std::is_same_v<typename tt::get_complex_or_fundamental_type_t<
std::vector<std::complex<int>>>,
std::complex<int>>);
Copy link
Member

Choose a reason for hiding this comment

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

std::complex is only guaranteed to work for floating-point types.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to double

@@ -42,7 +42,7 @@ SPECTRE_TEST_CASE("Unit.LinearSolver.Serial.BuildMatrix",
{
INFO("Build a simple dense matrix");
const blaze::DynamicMatrix<double> matrix{{4., 1.}, {3., 1.}};
const helpers::ApplyMatrix linear_operator{matrix};
const helpers::ApplyMatrix<double> linear_operator{matrix};
Copy link
Member

Choose a reason for hiding this comment

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

Wrong commit?

@wthrowe
Copy link
Member

wthrowe commented Jul 16, 2024

Still doesn't compile.

@nilsvu nilsvu force-pushed the complex_linsolv branch 2 times, most recently from 42d9f40 to 6db96f4 Compare July 17, 2024 10:53
@nilsvu
Copy link
Member Author

nilsvu commented Jul 19, 2024

Should be fixed now!

@wthrowe wthrowe merged commit 817e13c into sxs-collaboration:develop Jul 19, 2024
22 checks passed
@nilsvu nilsvu deleted the complex_linsolv branch July 19, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants