Skip to content

[pull] master from MRChemSoft:master - #54

Open
pull[bot] wants to merge 56 commits into
stigrj:masterfrom
MRChemSoft:master
Open

pull[bot] wants to merge 56 commits into
stigrj:masterfrom
MRChemSoft:master

Conversation

@pull

@pull pull Bot commented Mar 10, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added the ⤵️ pull label Mar 10, 2025
gitpeterwind and others added 27 commits November 18, 2025 14:39
* Copy CompFunction into complex type

* Copy OrbitalVector into complex type

* make real density from complex CompFunction

* remove deprecated warning

* allow Ncomp()=0 in add
Allow to add a Real and a Complex CompFunction
* removed all warnings; tested with clang21 on macOS 26 on M4 processor

* fixed failing tests

* included suggestion; fix for compiling mrchem+mrcpp on mac
* added possibility for population analysis based on grid

* minor cleanup

* also works if rootBox is not centered around 0,0,0

* moved documentation; added small unit test

* renamed the new integrate function for more clarity

* fixed test
* added compile scripts for Saga, Betzy and Olivia, similar to those for MRChem

* updated versions in saga.env

* make unit tests work in the compile scripts

---------

Co-authored-by: Niklas Göllmann <ngoel@uan02.head.cm.americas.sgi.com>
Small refactoring of the CopyTreeToComplex and CopyTreeToReal methods.

Generalized for D=1,2,3
Changed the signature
To be done:
switch from raw pointers to unique_pointers but this requires a refactoring of CompFunction

* Generalizes CopyTreeToComplex and CopyTreeToReal
* Updates all calls of CopyTreeToComplex
* Adds instantiations of CopyTreeToComplex and CopyTreeToReal
* Adds missing flag settings and pointer deletions after CopyTreeToComplex
Adds constructor of complex function tree from two real function trees, passed as input to the constructor.

The new constructor uses SFINAE to make sure it is defined only for CompexDouble as the second template parameter

The current solution is not ideal as it relies on a pre-existing function, which converted a real tree to a (real part only) complex tree. Ideally this part should be incorporated in the constructor and the operation a+ib carried node-by-node in the constructor directly.

It also provides a test file for the FunctionTreeconstructors.

Minor fixes:
* Updates all calls of CopyTreeToComplex
* Adds missing flag settings and pointer deletions after CopyTreeToComplex
* Fixes failing test for Complex FunctionTree
- reintroduced CopyToComplex in CompFunction
- fixed small bugs in CompFunction regarding deletion of real trees
- added license headers to CompFunction.h/cpp

This fixes compilation with MRChem, as well as two failing tests in
MRChem.
…284)

Forgot one template line in #283, added it here.
This version compiles now with current MRChem master.
Function mapping for complex-valued functions.

It is now possible to compose functions g(f(x)) where 
x belongs to R^d (d=1, 2, 3)
f(x) is either a function from R^d to R or from R^d to C (complex-valued)
g(f) is either a mapping from R to R or from C to C
it is not currently possible to map from R to C or from C to R.

Note: "mrcpp::map" has been renamed throughout to "mrcpp::treeMap" to make the name more mrcpp-specific and to avoid confusion with  std::map.
Complementary to this [MRChem
PR](MRChemSoft/mrchem#560)

Modernizing MRCPP

- [x] clean-up cmake
  - more user-accessible cmake options
  - "unify" cmake files (make different cmake files more similar)
  - remove warnings with cmake 4.x.x
  - more cmake output (progress / status)
- [x] locking current upper versioning in libraries 
  - [x] cmake
- [x] compilers (Intel a bit unclear, as "classic" ICC compilers are no
longer updated)
  - [x] Eigen3
  - [x] Catch
 - [x] Updating install documentation
 - [x] Switch to CPM

---------

Co-authored-by: MarcusTL12 <marcuspaafjellet@gmail.com>
this hopefully fixes the code coverage pipeline.
Problem most likely stems from lcov update.
- Change `if(BEHAVIOUR STREQUAL` into `if("${BEHAVIOUR}" STREQUAL` which
makes the if actually work
- Update catch2 to v3.16.0 and add find_behaviour for catch2 as well

---------

Co-authored-by: Niklas Göllmann <153195865+msnik1999@users.noreply.github.com>
Give a trace back in standard output when abort is called.
background: sometimes, the cod would crash in the FunctionNode<D,
T>::createChildren function. This appears to happen seldom but randomly,
and is not systematically reproducible. This would give some information
of where this can happen.
The standard error output seems not always to be taken care of,
therefore we write directly into standard output.

---------

Co-authored-by: Niklas Göllmann <153195865+msnik1999@users.noreply.github.com>
I was making templates for native complex TimeEvolution and then
updating TimeEvolution to be natively complex. Now instead of 2 trees
for real and imaginary we have one complex tree. I also added other
changes - I changed MSG_ERROR to MSG_ABORT because MSG_ERROR did not
stop the process on error, it just printed the error and then executed
return *this->oper_exp[i][d];.

 !GENERAL RULE: before it was like this:
 
mrcpp::TimeEvolutionOperator<1> ReExp(MRA, prec, delta_t, finest_scale,
false);
mrcpp::TimeEvolutionOperator<1> ImExp(MRA, prec, delta_t, finest_scale,
true);

auto Re_f = [&](const mrcpp::Coord<1> &r) -> double { return psi(r[0],
t).real(); };
auto Im_f = [&](const mrcpp::Coord<1> &r) -> double { return psi(r[0],
t).imag(); };

mrcpp::FunctionTree<1> Re_f_tree(MRA), Im_f_tree(MRA);
mrcpp::project<1, double>(prec, Re_f_tree, Re_f);
mrcpp::project<1, double>(prec, Im_f_tree, Im_f);
mrcpp::FunctionTree<1> Re_out(MRA), Im_out(MRA);

mrcpp::ComplexObject<mrcpp::ConvolutionOperator<1>> E(ReExp, ImExp);
mrcpp::ComplexObject<mrcpp::FunctionTree<1>> input(Re_f_tree,
Im_f_tree);
mrcpp::ComplexObject<mrcpp::FunctionTree<1>> output(Re_out, Im_out);

mrcpp::apply(prec, output, E, input); 

Now it will become like this:

mrcpp::TimeEvolutionOperator<1> Exp(MRA, prec, delta_t, finest_scale);

auto f = [&](const mrcpp::Coord<1> &r) -> ComplexDouble { return
psi(r[0], t); };

mrcpp::FunctionTree<1, ComplexDouble> f_tree(MRA), out(MRA);
mrcpp::project<1, ComplexDouble>(prec, f_tree, f);

mrcpp::apply<1, ComplexDouble>(prec, out, Exp, f_tree);

!NOTE FOR BACKWARD COMPATIBILITY: if you still need to access real or
imaginary parts, use this:
std::unique_ptr<mrcpp::FunctionTree<1, double>> re(out.Real());
std::unique_ptr<mrcpp::FunctionTree<1, double>> im(out.Imag());

---------

Co-authored-by: Valentyn <valentyn@local>
Co-authored-by: Valentyn <v@local>
Co-authored-by: vaabr5727 <vaabr5727@uit.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants