From 0a5b53883e2aa1293bfbdb1906d129edde597946 Mon Sep 17 00:00:00 2001 From: gitpeterwind Date: Wed, 14 Feb 2024 09:44:57 +0100 Subject: [PATCH] bug fix and remove MPI_CXX type --- src/utils/ComplexFunction.cpp | 4 ++-- src/utils/parallel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/ComplexFunction.cpp b/src/utils/ComplexFunction.cpp index e78d39c1f..512e57f4a 100644 --- a/src/utils/ComplexFunction.cpp +++ b/src/utils/ComplexFunction.cpp @@ -1999,7 +1999,7 @@ DoubleMatrix calc_norm_overlap_matrix(MPI_FuncVector &BraKet) { * */ void orthogonalize(double prec, MPI_FuncVector &Bra, MPI_FuncVector &Ket) { - // TODO: generalize for cases where Bra functions are not orthogonal to each other? + // TODO: generalize for cases where Ket functions are not orthogonal to each other? ComplexMatrix S = mpifuncvec::calc_overlap_matrix(Bra, Ket); int N = Bra.size(); int M = Ket.size(); @@ -2011,7 +2011,7 @@ void orthogonalize(double prec, MPI_FuncVector &Bra, MPI_FuncVector &Ket) { ComplexMatrix rmat = ComplexMatrix::Zero(M, N); for (int j = 0; j < N; j++) { for (int i = 0; i < M; i++) { - rmat(i,j) = 0.0 - S(j,i)/Ketnorms(i); + rmat(i,j) = 0.0 - S.conjugate()(j,i)/Ketnorms(i); } } MPI_FuncVector rotatedKet(N); diff --git a/src/utils/parallel.cpp b/src/utils/parallel.cpp index 7500de6f4..2877d12e9 100644 --- a/src/utils/parallel.cpp +++ b/src/utils/parallel.cpp @@ -292,7 +292,7 @@ void mpi::allreduce_vector(DoubleVector &vec, MPI_Comm comm) { void mpi::allreduce_vector(ComplexVector &vec, MPI_Comm comm) { #ifdef MRCPP_HAS_MPI int N = vec.size(); - MPI_Allreduce(MPI_IN_PLACE, vec.data(), N, MPI_CXX_DOUBLE_COMPLEX, MPI_SUM, comm); + MPI_Allreduce(MPI_IN_PLACE, vec.data(), N, MPI_C_DOUBLE_COMPLEX, MPI_SUM, comm); #endif } @@ -316,7 +316,7 @@ void mpi::allreduce_matrix(DoubleMatrix &mat, MPI_Comm comm) { void mpi::allreduce_matrix(ComplexMatrix &mat, MPI_Comm comm) { #ifdef MRCPP_HAS_MPI int N = mat.size(); - MPI_Allreduce(MPI_IN_PLACE, mat.data(), N, MPI_CXX_DOUBLE_COMPLEX, MPI_SUM, comm); + MPI_Allreduce(MPI_IN_PLACE, mat.data(), N, MPI_C_DOUBLE_COMPLEX, MPI_SUM, comm); #endif }