Code Monkey home page Code Monkey logo

greenx's People

Contributors

alexbuccheri avatar arfon avatar aziziph avatar dgolze avatar fdelesma avatar gmatteo avatar gonzex avatar jwilhelm avatar manoarphy avatar minyez avatar moritzleucke avatar panadestein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

greenx's Issues

MiniMax: makefile Support

For the time-being, we are considering support make, as well as Cmake. The minimax library therefore needs its makefile updating, such that minimax is compiled as a library and links to the test binary.

We should also consider adding the makefile build to the CI

Tentatively tagged @gmatteo and @dgolze in this

Answer to the referee's comment about the example

Dear all,
Could you please write your comments here to decide about answering Dario's comment?
Here is the comment:
"I suggest you to include here at lest a simple example illustrating the efficiency of the minimax grids. Maybe it could be done by integrating a toy function, but I also would like to see if you can get an estimate of how much it is reduced the prefactor of low-scaling MP2/RPA/GW calculations to justify the exclusive use of this particular quadrature.

Another related question. In line 150 of the pdf you specify that the number of time/frequency points in the library ranges from 2 to 64, how are these values related to the final accuracy of correlation and quasi-particle energies?"

As we discussed, Here is my answer:

As the length of the paper is already long, we can provide here an example which is public and accessible to all.
rpa
Here, the evaluation of the RPA total energy with the GL, mod-GL and minimax imaginary frequency grids for the a) water molecule and the b) MgO are shown. All the values are in eV. As it is clear, using 16 grid points, the results obtained by GX-TimeFrequncy are converged.

@gonzex @JWilhelm @dgolze @fdelesma @Panadestein @AlexBuccheri @gulans @claudia-draxl @PatrickRinke @gmatteo

Style Guide

GreenX should have a style guide defined. In analogy to clangformat, we should consider putting our preferred formatting into fprettify (CP2K fork).

Some documentation may also need to be written

Extend Input Parameters for Minimax Grid Test

GX-TimeFrequency/test/test_gx_minimax_grid.py currently tests gx_minimax_grid using only one choice of Min/Max transtion energies, specifically (2., 30.). This can be extended to sweep some range of values using pytest's paramterize fixture.

In particular, (0,0), (1, 0), (0, 1) should be tested to check for error-handling.

Very large transition ratio should also be used.

MiniMax: Data file header restructure

Reformat the minimax grid data to contain the grid sizes in the header, for simpler parsing.

Header should contain a) Number of blocks and b) block length in an easily-parsable manner

Doxygen Support

Add doxygen support:

  • CMake needs to find doxygen
  • CMake needs to be able to be able to build the documentation
  • Documentation building should be added to the CI

"make test" failed : ModuleNotFoundError: No module named 'python'

cd greenX/build
make test
Running tests...
Test project /root/WorkSpace/greenX/build
    Start 1: REG_TEST_test_minimax
1/1 Test #1: REG_TEST_test_minimax ............***Failed    0.45 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.45 sec

The following tests FAILED:
	  1 - REG_TEST_test_minimax (Failed)
Errors while running CTest
make: *** [Makefile:95: test] Error 8

In the Testing/Temporary/LastTest.log, we found :

ImportError while importing test module '/root/WorkSpace/greenX/GX-TimeFrequency/tests/test_minimax/test_minimax.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
GX-TimeFrequency/tests/test_minimax/test_minimax.py:13: in <module>
    from python.run import BinaryRunner, BuildType
E   ModuleNotFoundError: No module named 'python'

Try to modify CMakeLists.txt with :

set(ENV{PYTHONPATH} "${CMAKE_CURRENT_SOURCE_DIR}/python")

or

list(APPEND PYTHONPATH "${CMAKE_CURRENT_SOURCE_DIR}/python")

without success

working with :

export PYTHONPATH="${PYTHONPATH}:../python"

Repo Structure: GreenX Core

Certain modules should be consistent for all libraries in GreenX. Move these to a GreenX Core. For example:

  • Kinds and constants
  • Parser utilities

MiniMax: Verify MiniMax grids have been corrected copied from CP2K

Need some verification that the grid data has been correctly copy-pasted from CP2K. This could be:
a) An application test that parses and asserts on the grid size
b) Put back into CP2K and confirm the results don;'t change
c) Add some checking when parsing in fortran

Documentation compilation disabled by default

In the README.md, "GreenX is documented using Doxygen, and documentation support is enabled by default."
But in the cmake file it seems to be disabled by default. I could only build the documentations by manually switching it to ON.

requirement of pygreenx for unittest should be added to README.md

It is not clear from the documentation that pygreenx should be installed for the unit tests. And the way to install it should be added too, although the source code can be found in the python directory. Indeed without knowing that the unit tests 2 and 3 will fail.

Unit test 3 fails

I run the unit tests and it seems the test3 failed. I attach the log below.
FYI, I tested on ubuntu23.04/gfortran 12.2/ openblas 0.3.21 /AMD Ryzen 3500U.

Log:

Test project /home/hexu/projects/greenX/build
Start 1: UNITTEST_test_pade_approximant
1/3 Test #1: UNITTEST_test_pade_approximant ... Passed 0.00 sec
Start 2: test_gx_minimax_grid
2/3 Test #2: test_gx_minimax_grid ............. Passed 1.78 sec
Start 3: test_gx_tabulate_minimax
3/3 Test #3: test_gx_tabulate_minimax .........***Failed 6.40 sec
============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /home/hexu/projects/greenX/build
plugins: xonsh-0.13.4
collected 1 item

test_gx_tabulate_minimax.py Binary source: /home/hexu/projects/greenX/build/bin/gx_tabulate_grids.exe
FTestdir: /tmp/pytest-of-hexu/pytest-3/test_tabulate_gx_minimax_grid0

=================================== FAILURES ===================================
________________________ test_tabulate_gx_minimax_grid _________________________

fortran_binary = PosixPath('/home/hexu/projects/greenX/build/bin/gx_tabulate_grids.exe')

def test_tabulate_gx_minimax_grid(fortran_binary):

    e_trans = ETrans(0.4, 100.0)

    ref_errors_small_grid = np.array([[6,  0, 2.51200821E-04, 1.88667240E-03, 6.86380679E-03, 5.56242714E-02, 2.50000000E+02],
                                      [8,  0, 9.26518238E-04, 7.02310800E-04, 8.97132915E-04, 1.49383520E-02, 2.50000000E+02],
                                      [10, 0, 2.93904398E-02, 4.15097815E-04, 9.85375147E-04, 3.87442807E-03, 2.50000000E+02],
                                      [12, 0, 1.22980779E-03, 5.40966369E-05, 3.23113268E-05, 9.86318209E-04, 2.50000000E+02],
                                      [14, 0, 1.23655331E-03, 1.47661838E-05, 6.49328520E-06, 2.46521564E-04, 2.50000000E+02],
                                      [16, 0, 3.23839478E-03, 4.75444516E-06, 7.88188993E-07, 7.70304736E-05, 2.50000000E+02],
                                      [18, 0, 6.23300174E-03, 1.34768466E-06, 3.45186001E-07, 1.94942501E-05, 2.50000000E+02],
                                      [20, 0, 2.62469251E-03, 2.86296043E-07, 3.67016068E-08, 4.88850816E-06, 2.50000000E+02],
                                      [22, 0, 1.90928278E-02, 6.87320737E-08, 2.59110779E-07, 2.68402248E-07, 2.50000000E+02]])

    ref_errors_big_grid = np.array([[24, 0, 2.49244180E-02, 1.41793908E-08, 1.44000650E-08, 1.31534820E-07, 2.50000000E+02],
                                    [26, 0, 2.64119033E-01, 4.12358436E-09, 4.74668548E-09, 3.78405299E-08, 2.50000000E+02],
                                    [28, 0, 4.13766945E+04, 3.93976513E-09, 5.94764298E-09, 4.30436032E-08, 2.50000000E+02],
                                    [30, 0, 1.24498840E+06, 4.50563448E-09, 3.15970462E-08, 5.14232632E-08, 2.50000000E+02],
                                    [32, 0, 1.29256892E+06, 4.17286994E-09, 6.30107694E-08, 4.94132290E-08, 2.50000000E+02],
                                    [34, 0, 1.32139161E+06, 8.10191277E-09, 3.86664983E-07, 6.66088501E-08, 2.50000000E+02]])

    tabulated_errors = get_tabulated_errors(fortran_binary, e_trans)
    tabulated_errors_small_grids = tabulated_errors[0:9, :]
    tabulated_errors_large_grids = tabulated_errors[9:, :]

    # Grids for which values do not get large or very small
    assert np.allclose(tabulated_errors_small_grids[:, Column.CosFTDualityError.value],
                       ref_errors_small_grid[:, Column.CosFTDualityError.value])

    assert np.allclose(tabulated_errors_small_grids[:, Column.MaxErrCosFTTimeToFreq.value],
                       ref_errors_small_grid[:, Column.MaxErrCosFTTimeToFreq.value])

    assert np.allclose(tabulated_errors_small_grids[:, Column.MaxErrCosFTFreqToTime.value],
                       ref_errors_small_grid[:, Column.MaxErrCosFTFreqToTime.value])

    assert np.allclose(tabulated_errors_small_grids[:, Column.MaxErrSinFTimeToFreq.value],
                       ref_errors_small_grid[:, Column.MaxErrSinFTimeToFreq.value])

    # Grids for which values do get large or very small
    assert np.allclose(tabulated_errors_large_grids[:, Column.MaxErrCosFTTimeToFreq.value],
                       ref_errors_big_grid[:, Column.MaxErrCosFTTimeToFreq.value],
                       atol=1.e-7)
  assert np.allclose(tabulated_errors_large_grids[:, Column.MaxErrCosFTFreqToTime.value],
                       ref_errors_big_grid[:, Column.MaxErrCosFTFreqToTime.value],
                       atol=1.e-7)

E assert False
E + where False = <function allclose at 0x7fb559e44a40>(array([1.44000655e-08, 4.74668609e-09, 5.94594904e-09, 7.14314387e-09,\n 1.21514300e-08, 6.46172347e-08]), array([1.44000650e-08, 4.74668548e-09, 5.94764298e-09, 3.15970462e-08,\n 6.30107694e-08, 3.86664983e-07]), atol=1e-07)
E + where <function allclose at 0x7fb559e44a40> = np.allclose

/home/hexu/projects/greenX/build/test/time-frequency/test_gx_tabulate_minimax.py:116: AssertionError
=========================== short test summary info ============================
FAILED test_gx_tabulate_minimax.py::test_tabulate_gx_minimax_grid - assert False
============================== 1 failed in 4.74s ===============================

67% tests passed, 1 tests failed out of 3

Total Test time (real) = 8.19 sec

The following tests FAILED:
3 - test_gx_tabulate_minimax (Failed)

TimeFrequency: Directory Structure

Assuming multiple grid routines will be present, structure TimeFrequency as:

GX-TimeFrequency/
   src/
      minimax/ 
          minimax.F90
          CMakeLists.txt
      contour/
          contour.f90
          CMakeLists.txt
   gx_timefrequency.f90
   tests/ 
      test_minimax/
          test_minimax.f90
          test_minimax.py
          input/
          ref/ 
      test_contour/
   data/
   CMakeLists.txt
   README.md

where gx_timefrequency.f90 is a module to expose the individual libs which comprise GX-TimeFrequency

Unit Test Framework

Add a unit test framework as an external dependency. Requires:

  • Finding with CMake
  • Potentially downloading/installing with CMake
  • Wrapping its API such that there is some robustness if we a) choose to change frameworks or b) its API changes

cmake error in GX-AnalyticContinuation without ENABLE_UNITTEST

Hi all! I am trying to build the GreenX minimax utility. When building at the GreenX root with command

FC=ifort cmake -B build

an error is thrown as follows

-- Python 3 interpreter version: 3.9.12
-- Analytic continuation unit tests written to: /home/minyez/software/greenX-github/build/unit_tests/analytic-continuation
CMake Error at GX-AnalyticContinuation/CMakeLists.txt:51 (create_unit_test_executable):
  Unknown CMake command "create_unit_test_executable".

IMO wrapping create_unit_test_executable with ENABLE_UNITTEST condition should fix it

diff --git a/GX-AnalyticContinuation/CMakeLists.txt b/GX-AnalyticContinuation/CMakeLists.txt
index a002a96..f369af1 100644
--- a/GX-AnalyticContinuation/CMakeLists.txt
+++ b/GX-AnalyticContinuation/CMakeLists.txt
@@ -47,6 +47,8 @@ message("-- Analytic continuation unit tests written to: ${UNIT_TEST_DIR}")
 set(LIBS_FOR_UNIT_TESTS LibGXAC)
 
 # For unit tests for many modules, put this in a loop
-create_unit_test_executable(TARGET_TEST_DIR ${UNIT_TEST_DIR}
-                            TEST_NAME "test_pade_approximant"
-                            REQUIRED_LIBS ${LIBS_FOR_UNIT_TESTS})
+if (${ENABLE_UNITTESTS})
+    create_unit_test_executable(TARGET_TEST_DIR ${UNIT_TEST_DIR}
+                                TEST_NAME "test_pade_approximant"
+                                REQUIRED_LIBS ${LIBS_FOR_UNIT_TESTS})
+endif()

Cheers
Minye Zhang

Add short description, tags, and possibly website to the repo

Hello, as the title suggest, it would be nice to add a short sentence summarizing what Green-X is, and also tags to the GitHub repository. We could also link the NOMAD website there (or ideally deploy a GitHub pages there). See the image below, this is empty in our repo:

image

This is a very common thing, and it helps to project gain visibility. Unfortunately, I do not have permission to do it myself. Can you take care of it @aziziph or @AlexBuccheri ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.