qupled 1.3.2__tar.gz → 1.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qupled-1.3.2 → qupled-1.3.4}/.github/workflows/build-macos-wheels.yml +16 -6
- {qupled-1.3.2 → qupled-1.3.4}/.github/workflows/release.yml +7 -1
- {qupled-1.3.2 → qupled-1.3.4}/.gitignore +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/PKG-INFO +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/docs/examples.rst +4 -5
- {qupled-1.3.2 → qupled-1.3.4}/docs/introduction.rst +20 -7
- {qupled-1.3.2 → qupled-1.3.4}/docs/qupled.rst +9 -9
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/fixed_adr.py +2 -5
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/initial_guess_stls.py +2 -3
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/solve_quantum_schemes.py +12 -11
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/solve_qvsstls.py +4 -7
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/solve_rpa_and_esa.py +2 -2
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/solve_stls.py +2 -3
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/solve_stls_iet.py +2 -4
- {qupled-1.3.2 → qupled-1.3.4}/examples/docs/solve_vsstls.py +2 -4
- {qupled-1.3.2 → qupled-1.3.4}/examples/readme/create_cover.py +5 -5
- {qupled-1.3.2 → qupled-1.3.4}/pyproject.toml +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/setup.py +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/database.py +66 -28
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/esa.py +11 -5
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/hf.py +134 -73
- qupled-1.3.4/src/qupled/mpi.py +104 -0
- qupled-1.3.4/src/qupled/native/include/format.hpp +40 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/logger.hpp +4 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/mpi_util.hpp +7 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/vsbase.hpp +1 -2
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/CMakeLists.txt +17 -3
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/hf.cpp +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/iet.cpp +13 -11
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/input.cpp +1 -1
- qupled-1.3.4/src/qupled/native/src/logger.cpp +14 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/mpi_util.cpp +16 -2
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/python_interface/native.cpp +0 -7
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/python_interface/schemes.cpp +13 -1
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/python_interface/utilities.cpp +1 -18
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/qstls.cpp +11 -10
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/qstlsiet.cpp +10 -4
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/qvsstls.cpp +10 -4
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/stls.cpp +4 -4
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/stlsiet.cpp +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/vsbase.cpp +7 -8
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/vsstls.cpp +0 -1
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/qstls.py +13 -10
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/qstlsiet.py +13 -10
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/qvsstls.py +13 -11
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/rpa.py +11 -7
- qupled-1.3.4/src/qupled/serialize.py +43 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/stls.py +29 -26
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/stlsiet.py +34 -25
- qupled-1.3.4/src/qupled/timer.py +33 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/vsstls.py +44 -42
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled.egg-info/PKG-INFO +1 -1
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled.egg-info/SOURCES.txt +3 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_database.py +48 -38
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_esa.py +4 -8
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_hf.py +16 -6
- qupled-1.3.4/tests/test_mpi.py +1 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_qstls.py +7 -11
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_qstlsiet.py +11 -12
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_qvsstls.py +8 -14
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_rpa.py +4 -8
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_stls.py +6 -12
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_stlsiet.py +11 -12
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_vsstls.py +15 -18
- qupled-1.3.2/src/qupled/mpi.py +0 -69
- qupled-1.3.2/src/qupled/native/src/logger.cpp +0 -11
- qupled-1.3.2/tests/test_mpi.py +0 -63
- {qupled-1.3.2 → qupled-1.3.4}/.clang-format +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.devcontainer/Dockerfile +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.devcontainer/devcontainer.json +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.github/workflows/build-and-test.yml +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.github/workflows/build-linux-wheels.yml +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.github/workflows/build-sdist.yml +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.github/workflows/formatting.yml +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/.readthedocs.yaml +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/LICENSE +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/MANIFEST.in +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/README.md +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/dev/devtool.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/dev/requirements-apt.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/dev/requirements-brew.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/dev/requirements-pip.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/devtool +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/docs/_static/css/rdt_theme_python_properties.css +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/docs/conf.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/docs/contribute.rst +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/docs/index.rst +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/docs/make.bat +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/docs/requirements.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/examples/readme/qupled_animation_dark.svg +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/examples/readme/qupled_animation_light.svg +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/examples/tests/test_examples.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/manylinux/Dockerfile.manylinux_2_28 +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/manylinux/build_manylinux_2_28 +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/setup.cfg +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/__init__.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/chemical_potential.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/database.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/dual.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/esa.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/free_energy.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/hf.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/iet.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/input.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/internal_energy.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/num_util.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/numerics.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/python_interface/inputs.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/python_interface/schemes.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/python_interface/util.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/python_interface/utilities.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/qstls.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/qstlsiet.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/qvsstls.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/rdf.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/rpa.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/stls.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/stlsiet.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/thermo_util.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/vector2D.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/vector3D.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/vector_util.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/include/vsstls.hpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/chemical_potential.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/esa.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/free_energy.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/internal_energy.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/num_util.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/numerics.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/python_interface/inputs.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/python_interface/util.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/rdf.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/rpa.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/thermo_util.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/vector2D.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/vector3D.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/native/src/vector_util.cpp +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled/output.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled.egg-info/dependency_links.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled.egg-info/not-zip-safe +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled.egg-info/requires.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/src/qupled.egg-info/top_level.txt +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/conftest.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_esa_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_hf_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_qstls_iet_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_qstls_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_qvsstls_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_rpa_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_stls_iet_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_stls_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/native/test_vsstls_native.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tests/test_output.py +0 -0
- {qupled-1.3.2 → qupled-1.3.4}/tox.ini +0 -0
@@ -4,9 +4,19 @@ on:
|
|
4
4
|
workflow_call:
|
5
5
|
|
6
6
|
jobs:
|
7
|
-
build-macos-wheels
|
8
|
-
name: Build macOS
|
9
|
-
|
7
|
+
build-macos-wheels:
|
8
|
+
name: Build macOS wheels (${{ matrix.arch }})
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
include:
|
12
|
+
- arch: arm64
|
13
|
+
runner: macos-latest
|
14
|
+
deployment_target: "14.0"
|
15
|
+
- arch: x86_64
|
16
|
+
runner: macos-13
|
17
|
+
deployment_target: "13.0"
|
18
|
+
|
19
|
+
runs-on: ${{ matrix.runner }}
|
10
20
|
|
11
21
|
steps:
|
12
22
|
- name: Checkout source code
|
@@ -35,11 +45,11 @@ jobs:
|
|
35
45
|
run: cibuildwheel --output-dir wheelhouse
|
36
46
|
env:
|
37
47
|
CIBW_PLATFORM: macos
|
38
|
-
CIBW_ARCHS_MACOS:
|
39
|
-
MACOSX_DEPLOYMENT_TARGET:
|
48
|
+
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
|
49
|
+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target }}
|
40
50
|
|
41
51
|
- name: Upload built wheels
|
42
52
|
uses: actions/upload-artifact@v4
|
43
53
|
with:
|
44
|
-
name: wheels-macos
|
54
|
+
name: wheels-macos-${{ matrix.arch }}
|
45
55
|
path: wheelhouse/*.whl
|
@@ -44,6 +44,12 @@ jobs:
|
|
44
44
|
name: wheels-linux-aarch64
|
45
45
|
path: temp-linux-wheels-aarch64
|
46
46
|
|
47
|
+
- name: Download macos wheels (x86_64)
|
48
|
+
uses: actions/download-artifact@v4
|
49
|
+
with:
|
50
|
+
name: wheels-macos-x86_64
|
51
|
+
path: temp-macos-wheels-x86_64
|
52
|
+
|
47
53
|
- name: Download macos wheels (arm64)
|
48
54
|
uses: actions/download-artifact@v4
|
49
55
|
with:
|
@@ -65,5 +71,5 @@ jobs:
|
|
65
71
|
source .venv/bin/activate
|
66
72
|
pip3 install --upgrade pip
|
67
73
|
pip3 install twine
|
68
|
-
twine check dist/*
|
74
|
+
twine check dist/*
|
69
75
|
twine upload dist/* --non-interactive
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qupled
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.4
|
4
4
|
Summary: qupled: a package to investigate quantum plasmas via the dielectric formalism
|
5
5
|
Author-email: Federico Lucco Castello <federico.luccocastello@gmail.com>
|
6
6
|
License-Expression: GPL-3.0-or-later
|
@@ -90,11 +90,10 @@ The quantum schemes can have a significant computational cost. There are two str
|
|
90
90
|
that can be employed to speed up the calculations:
|
91
91
|
|
92
92
|
* *Parallelization*: qupled supports both multithreaded calculations with OpenMP and
|
93
|
-
multiprocessors computations with MPI.
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
used concurrently by setting both the number of threads and the number of cores.
|
93
|
+
multiprocessors computations with MPI. OpenMP and MPI can be
|
94
|
+
used concurrently by setting both the number of threads and the number of cores in the
|
95
|
+
input dataclasses. Use `threads` to set the number of OMP threads and `processes` to
|
96
|
+
set the number of MPI processes.
|
98
97
|
|
99
98
|
* *Pre-computation*: The calculations for the quantum schemes can be made significantly
|
100
99
|
faster if part of the calculation of the auxiliary density response can be skipped.
|
@@ -51,25 +51,35 @@ This will also install all the python packages that are necessary for running th
|
|
51
51
|
Install with MPI support
|
52
52
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
53
53
|
|
54
|
-
If you need to use qupled with MPI support, install the :ref:`external_dependencies` and
|
55
|
-
source distribution with the following command:
|
54
|
+
If you need to use qupled with MPI support, first install the :ref:`external_dependencies` and then run
|
56
55
|
|
57
56
|
.. code-block:: console
|
58
57
|
|
59
|
-
pip install --no-binary=:all: qupled
|
58
|
+
USE_MPI=ON pip install --no-binary=:all: qupled
|
60
59
|
|
61
60
|
|
62
61
|
Install from source
|
63
62
|
~~~~~~~~~~~~~~~~~~~
|
64
63
|
|
65
64
|
If you want full control over your qupled installation, you can install it also directly from the source.
|
66
|
-
|
65
|
+
Start by cloning the respository
|
67
66
|
|
68
67
|
.. code-block:: console
|
69
68
|
|
70
69
|
git clone https://github.com/fedluc/qupled.git
|
71
70
|
cd qupled
|
71
|
+
|
72
|
+
|
73
|
+
Then Install the :ref:`external_dependencies` with
|
74
|
+
|
75
|
+
.. code-block:: console
|
76
|
+
|
72
77
|
./devtool install-deps
|
78
|
+
|
79
|
+
and finally build, test and install qupled with
|
80
|
+
|
81
|
+
.. code-block:: console
|
82
|
+
|
73
83
|
./devtool build
|
74
84
|
./devtool test
|
75
85
|
./devtool install
|
@@ -80,13 +90,16 @@ External dependencies
|
|
80
90
|
~~~~~~~~~~~~~~~~~~~~~
|
81
91
|
|
82
92
|
Installing qupled may require compiling some C++ code, depending on the platform and installation method.
|
83
|
-
The following dependencies must be met before attempting to build the C++ part of qupled
|
93
|
+
The following dependencies must be met before attempting to build the C++ part of qupled
|
84
94
|
|
85
95
|
- `CMake <https://cmake.org/download/>`_
|
86
|
-
- `fmt <https://github.com/fmtlib/fmt>`_
|
87
96
|
- `GNU Scientific Library <https://www.gnu.org/software/gsl/>`_
|
88
97
|
- `OpenMP <https://en.wikipedia.org/wiki/OpenMP>`_
|
89
|
-
- `
|
98
|
+
- `SQLiteCpp <https://github.com/SRombauts/SQLiteCpp>`_
|
99
|
+
- `Open-MPI <https://www.open-mpi.org/software/ompi/v5.0/>`_ (only if you want MPI support)
|
100
|
+
|
101
|
+
The installation of these dependencies can be done in different ways depending on the platform you are using.
|
102
|
+
For example, on Ubuntu, Debian-based and macOS systems, you can use the following commands:
|
90
103
|
|
91
104
|
**Ubuntu or Debian-based systems**
|
92
105
|
|
@@ -35,7 +35,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
35
35
|
After the solution is completed the results are stored in an object :obj:`qupled.hf.Result`
|
36
36
|
and written to the output database.
|
37
37
|
|
38
|
-
.. autoclass:: qupled.hf.
|
38
|
+
.. autoclass:: qupled.hf.Solver
|
39
39
|
:members:
|
40
40
|
|
41
41
|
.. autoclass:: qupled.hf.Input
|
@@ -55,7 +55,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
55
55
|
After the solution is completed the results are stored in an object :obj:`qupled.hf.Result`
|
56
56
|
and written to the output database.
|
57
57
|
|
58
|
-
.. autoclass:: qupled.rpa.
|
58
|
+
.. autoclass:: qupled.rpa.Solver
|
59
59
|
:show-inheritance:
|
60
60
|
:members:
|
61
61
|
|
@@ -72,7 +72,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
72
72
|
After the solution is completed the results are stored in an object :obj:`qupled.stls.Result`
|
73
73
|
and written to the output database.
|
74
74
|
|
75
|
-
.. autoclass:: qupled.stls.
|
75
|
+
.. autoclass:: qupled.stls.Solver
|
76
76
|
:show-inheritance:
|
77
77
|
:members:
|
78
78
|
|
@@ -97,7 +97,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
97
97
|
After the solution is completed the results are stored in an object :obj:`qupled.stlsiet.Result`
|
98
98
|
and written to the output database.
|
99
99
|
|
100
|
-
.. autoclass:: qupled.stlsiet.
|
100
|
+
.. autoclass:: qupled.stlsiet.Solver
|
101
101
|
:show-inheritance:
|
102
102
|
:members:
|
103
103
|
|
@@ -122,7 +122,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
122
122
|
After the solution is completed the results are stored in an object :obj:`qupled.vsstls.Result`
|
123
123
|
and written to the output database.
|
124
124
|
|
125
|
-
.. autoclass:: qupled.vsstls.
|
125
|
+
.. autoclass:: qupled.vsstls.Solver
|
126
126
|
:show-inheritance:
|
127
127
|
:members:
|
128
128
|
:exclude-members: get_free_energy_integrand
|
@@ -151,7 +151,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
151
151
|
After the solution is completed the results are stored in an object :obj:`qupled.hf.Result`
|
152
152
|
and written to the output database.
|
153
153
|
|
154
|
-
.. autoclass:: qupled.esa.
|
154
|
+
.. autoclass:: qupled.esa.Solver
|
155
155
|
:show-inheritance:
|
156
156
|
:members:
|
157
157
|
|
@@ -171,7 +171,7 @@ TThe solution parameters are specified with a dedicated class called :obj:`quple
|
|
171
171
|
After the solution is completed the results are stored in an object :obj:`qupled.qstls.Result`
|
172
172
|
and written to the output database.
|
173
173
|
|
174
|
-
.. autoclass:: qupled.qstls.
|
174
|
+
.. autoclass:: qupled.qstls.Solver
|
175
175
|
:show-inheritance:
|
176
176
|
:members:
|
177
177
|
:exclude-members: find_fixed_adr_in_database
|
@@ -190,7 +190,7 @@ The solution parameters are specified with a dedicated class called :obj:`qupled
|
|
190
190
|
After the solution is completed the results are stored in an object :obj:`qupled.qstlsiet.Result`
|
191
191
|
and written to the output database.
|
192
192
|
|
193
|
-
.. autoclass:: qupled.qstlsiet.
|
193
|
+
.. autoclass:: qupled.qstlsiet.Solver
|
194
194
|
:show-inheritance:
|
195
195
|
:members:
|
196
196
|
:exclude-members: find_fixed_adr_in_database
|
@@ -207,7 +207,7 @@ for the solution of the QVStls schemes. The solution parameters are specified wi
|
|
207
207
|
called :obj:`qupled.qvsstls.Input`. After the solution is completed the results are stored in an
|
208
208
|
object :obj:`qupled.qvsstls.Result` and written to the output database.
|
209
209
|
|
210
|
-
.. autoclass:: qupled.qvsstls.
|
210
|
+
.. autoclass:: qupled.qvsstls.Solver
|
211
211
|
:show-inheritance:
|
212
212
|
:members:
|
213
213
|
:exclude-members: get_free_energy_integrand
|
@@ -1,13 +1,10 @@
|
|
1
1
|
import qupled.qstls as qstls
|
2
2
|
|
3
3
|
# Define the object used to solve the scheme
|
4
|
-
scheme = qstls.
|
4
|
+
scheme = qstls.Solver()
|
5
5
|
|
6
6
|
# Define the input parameters
|
7
|
-
inputs = qstls.Input(10.0, 1.0)
|
8
|
-
inputs.mixing = 0.5
|
9
|
-
inputs.matsubara = 16
|
10
|
-
inputs.threads = 16
|
7
|
+
inputs = qstls.Input(10.0, 1.0, mixing=0.5, matsubara=16, threads=16)
|
11
8
|
|
12
9
|
# Solve the QSTLS scheme and store the internal energy (v1 calculation)
|
13
10
|
scheme.compute(inputs)
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import qupled.stls as stls
|
2
2
|
|
3
3
|
# Define the object used to solve the scheme
|
4
|
-
scheme = stls.
|
4
|
+
scheme = stls.Solver()
|
5
5
|
|
6
6
|
# Define the input parameters
|
7
|
-
inputs = stls.Input(10.0, 1.0)
|
8
|
-
inputs.mixing = 0.2
|
7
|
+
inputs = stls.Input(10.0, 1.0, mixing=0.2)
|
9
8
|
|
10
9
|
# Solve scheme
|
11
10
|
scheme.compute(inputs)
|
@@ -2,27 +2,28 @@ import qupled.qstls as qstls
|
|
2
2
|
import qupled.qstlsiet as qstlsiet
|
3
3
|
|
4
4
|
# Define a Qstls object to solve the QSTLS scheme
|
5
|
-
scheme = qstls.
|
5
|
+
scheme = qstls.Solver()
|
6
6
|
|
7
7
|
# Define the input parameters
|
8
|
-
inputs = qstls.Input(10.0, 1.0)
|
9
|
-
inputs.mixing = 0.5
|
10
|
-
inputs.matsubara = 16
|
11
|
-
inputs.threads = 16
|
8
|
+
inputs = qstls.Input(10.0, 1.0, mixing=0.5, matsubara=16, threads=16)
|
12
9
|
|
13
10
|
# Solve the QSTLS scheme
|
14
11
|
scheme.compute(inputs)
|
15
12
|
print(scheme.results.uint)
|
16
13
|
|
17
14
|
# Define a QstlsIet object to solve the QSTLS-IET scheme
|
18
|
-
scheme = qstlsiet.
|
15
|
+
scheme = qstlsiet.Solver()
|
19
16
|
|
20
17
|
# Define the input parameters for one of the QSTLS-IET schemes
|
21
|
-
inputs = qstlsiet.Input(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
inputs = qstlsiet.Input(
|
19
|
+
10.0,
|
20
|
+
1.0,
|
21
|
+
theory="QSTLS-LCT",
|
22
|
+
mixing=0.5,
|
23
|
+
matsubara=16,
|
24
|
+
threads=16,
|
25
|
+
integral_strategy="segregated",
|
26
|
+
)
|
26
27
|
|
27
28
|
# solve the QSTLS-IET scheme
|
28
29
|
scheme.compute(inputs)
|
@@ -1,15 +1,12 @@
|
|
1
1
|
import qupled.qvsstls as qvsstls
|
2
2
|
|
3
3
|
# Define the object used to solve the scheme
|
4
|
-
scheme = qvsstls.
|
4
|
+
scheme = qvsstls.Solver()
|
5
5
|
|
6
6
|
# Define the input parameters
|
7
|
-
inputs = qvsstls.Input(
|
8
|
-
|
9
|
-
|
10
|
-
inputs.alpha = [-0.2, 0.4]
|
11
|
-
inputs.iterations = 100
|
12
|
-
inputs.threads = 16
|
7
|
+
inputs = qvsstls.Input(
|
8
|
+
1.0, 1.0, mixing=0.5, matsubara=16, alpha=[-0.2, 0.4], iterations=100, threads=16
|
9
|
+
)
|
13
10
|
|
14
11
|
# Solve scheme for rs = 1.0
|
15
12
|
scheme.compute(inputs)
|
@@ -5,12 +5,12 @@ from qupled.output import DataBase
|
|
5
5
|
|
6
6
|
# Define an Rpa object to solve the RPA scheme
|
7
7
|
print("######### Solving the RPA scheme #########")
|
8
|
-
rpa_scheme = rpa.
|
8
|
+
rpa_scheme = rpa.Solver()
|
9
9
|
rpa_scheme.compute(rpa.Input(10.0, 1.0))
|
10
10
|
|
11
11
|
# Define an ESA object to solve the ESA scheme
|
12
12
|
print("######### Solving the ESA scheme #########")
|
13
|
-
esa_scheme = esa.
|
13
|
+
esa_scheme = esa.Solver()
|
14
14
|
esa_scheme.compute(esa.Input(10.0, 1.0))
|
15
15
|
|
16
16
|
# Retrieve information from the output files
|
@@ -2,11 +2,10 @@ import qupled.stls as stls
|
|
2
2
|
from qupled.output import DataBase
|
3
3
|
|
4
4
|
# Define the object used to solve the scheme
|
5
|
-
scheme = stls.
|
5
|
+
scheme = stls.Solver()
|
6
6
|
|
7
7
|
# Define the input parameters
|
8
|
-
inputs = stls.Input(10.0, 1.0)
|
9
|
-
inputs.mixing = 0.5
|
8
|
+
inputs = stls.Input(10.0, 1.0, mixing=0.5)
|
10
9
|
|
11
10
|
# Solve scheme
|
12
11
|
scheme.compute(inputs)
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import qupled.stlsiet as stlsiet
|
2
2
|
|
3
3
|
# Define the object used to solve the scheme
|
4
|
-
scheme = stlsiet.
|
4
|
+
scheme = stlsiet.Solver()
|
5
5
|
|
6
6
|
# Define the input parameters
|
7
|
-
inputs = stlsiet.Input(10.0, 1.0, "STLS-HNC")
|
8
|
-
inputs.mixing = 0.5
|
9
|
-
|
7
|
+
inputs = stlsiet.Input(10.0, 1.0, theory="STLS-HNC", mixing=0.5)
|
10
8
|
# Solve scheme with HNC bridge function
|
11
9
|
scheme.compute(inputs)
|
12
10
|
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import qupled.vsstls as vsstls
|
2
2
|
|
3
3
|
# Define the object used to solve the scheme
|
4
|
-
scheme = vsstls.
|
4
|
+
scheme = vsstls.Solver()
|
5
5
|
|
6
6
|
# Define the input parameters
|
7
|
-
inputs = vsstls.Input(2.0, 1.0)
|
8
|
-
inputs.mixing = 0.5
|
9
|
-
inputs.alpha = [-0.2, 0.2]
|
7
|
+
inputs = vsstls.Input(2.0, 1.0, mixing=0.5, alpha=[-0.2, 0.2])
|
10
8
|
|
11
9
|
# Compute
|
12
10
|
scheme.compute(inputs)
|
@@ -49,7 +49,7 @@ def create_svg_files():
|
|
49
49
|
|
50
50
|
|
51
51
|
def get_plot_data():
|
52
|
-
scheme: qstls.
|
52
|
+
scheme: qstls.Solver = None
|
53
53
|
error: list[float] = []
|
54
54
|
while scheme is None or scheme.results.error > 1e-5:
|
55
55
|
scheme = solve_qstls(scheme.run_id if scheme is not None else scheme)
|
@@ -57,7 +57,7 @@ def get_plot_data():
|
|
57
57
|
return scheme, error
|
58
58
|
|
59
59
|
|
60
|
-
def create_one_svg_file(darkmode: bool, scheme: qstls.
|
60
|
+
def create_one_svg_file(darkmode: bool, scheme: qstls.Solver, error: np.array):
|
61
61
|
# Get plot settings
|
62
62
|
settings = PlotSettings(darkmode)
|
63
63
|
# Set style
|
@@ -80,7 +80,7 @@ def create_one_svg_file(darkmode: bool, scheme: qstls.Qstls, error: np.array):
|
|
80
80
|
|
81
81
|
|
82
82
|
def solve_qstls(guess_run_id: int):
|
83
|
-
scheme = qstls.
|
83
|
+
scheme = qstls.Solver()
|
84
84
|
inputs = qstls.Input(coupling=15.0, degeneracy=1.0)
|
85
85
|
inputs.mixing = 0.3
|
86
86
|
inputs.resolution = 0.1
|
@@ -97,7 +97,7 @@ def solve_qstls(guess_run_id: int):
|
|
97
97
|
return scheme
|
98
98
|
|
99
99
|
|
100
|
-
def plot_density_response(plt: plt, scheme: qstls.
|
100
|
+
def plot_density_response(plt: plt, scheme: qstls.Solver, settings: PlotSettings):
|
101
101
|
results = scheme.results
|
102
102
|
inputs = scheme.inputs
|
103
103
|
wvg_squared = results.wvg[:, np.newaxis] ** 2
|
@@ -127,7 +127,7 @@ def plot_density_response(plt: plt, scheme: qstls.Qstls, settings: PlotSettings)
|
|
127
127
|
plt.yticks(fontsize=settings.ticksz)
|
128
128
|
|
129
129
|
|
130
|
-
def plot_ssf(plt: plt, scheme: qstls.
|
130
|
+
def plot_ssf(plt: plt, scheme: qstls.Solver, settings: PlotSettings):
|
131
131
|
results = scheme.results
|
132
132
|
plt.subplot(2, 2, 4)
|
133
133
|
plt.plot(results.wvg, results.ssf, color=settings.color, linewidth=settings.width)
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "qupled"
|
7
|
-
version = "v1.3.
|
7
|
+
version = "v1.3.4"
|
8
8
|
description = "qupled: a package to investigate quantum plasmas via the dielectric formalism"
|
9
9
|
readme = "README.md"
|
10
10
|
requires-python = ">=3.10, <3.14"
|
@@ -10,8 +10,6 @@ import sqlalchemy as sql
|
|
10
10
|
from sqlalchemy.dialects.sqlite import insert as sqlite_insert
|
11
11
|
import blosc2
|
12
12
|
|
13
|
-
from . import mpi
|
14
|
-
|
15
13
|
|
16
14
|
class DataBaseHandler:
|
17
15
|
"""
|
@@ -42,10 +40,9 @@ class DataBaseHandler:
|
|
42
40
|
SUCCESS = "SUCCESS"
|
43
41
|
FAILED = "FAILED"
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
43
|
+
class ConflictMode(Enum):
|
44
|
+
FAIL = "FAIL"
|
45
|
+
UPDATE = "UPDATE"
|
49
46
|
|
50
47
|
def __init__(self, database_name: str | None = None):
|
51
48
|
"""
|
@@ -76,7 +73,6 @@ class DataBaseHandler:
|
|
76
73
|
self.result_table = self._build_results_table()
|
77
74
|
self.run_id: int | None = None
|
78
75
|
|
79
|
-
@mpi.MPI.run_only_on_root
|
80
76
|
def insert_run(self, inputs):
|
81
77
|
"""
|
82
78
|
Inserts a new run into the database by storing the provided inputs and results.
|
@@ -91,7 +87,6 @@ class DataBaseHandler:
|
|
91
87
|
self._insert_run(inputs, self.RunStatus.RUNNING)
|
92
88
|
self.insert_inputs(inputs.__dict__)
|
93
89
|
|
94
|
-
@mpi.MPI.run_only_on_root
|
95
90
|
def insert_inputs(self, inputs: dict[str, any]):
|
96
91
|
"""
|
97
92
|
Inserts input data into the database for the current run.
|
@@ -114,8 +109,11 @@ class DataBaseHandler:
|
|
114
109
|
sql_mapping = lambda value: (self._to_json(value))
|
115
110
|
self._insert_from_dict(self.input_table, inputs, sql_mapping)
|
116
111
|
|
117
|
-
|
118
|
-
|
112
|
+
def insert_results(
|
113
|
+
self,
|
114
|
+
results: dict[str, any],
|
115
|
+
conflict_mode: ConflictMode = ConflictMode.FAIL,
|
116
|
+
):
|
119
117
|
"""
|
120
118
|
Inserts the given results into the database table associated with this instance.
|
121
119
|
|
@@ -130,7 +128,9 @@ class DataBaseHandler:
|
|
130
128
|
"""
|
131
129
|
if self.run_id is not None:
|
132
130
|
sql_mapping = lambda value: (self._to_bytes(value))
|
133
|
-
self._insert_from_dict(
|
131
|
+
self._insert_from_dict(
|
132
|
+
self.result_table, results, sql_mapping, conflict_mode
|
133
|
+
)
|
134
134
|
|
135
135
|
def inspect_runs(self) -> list[dict[str, any]]:
|
136
136
|
"""
|
@@ -149,26 +149,27 @@ class DataBaseHandler:
|
|
149
149
|
rows = self._execute(statement).mappings().all()
|
150
150
|
return [{key: row[key] for key in row.keys()} for row in rows]
|
151
151
|
|
152
|
-
def update_run_status(self, status:
|
152
|
+
def update_run_status(self, status: RunStatus) -> None:
|
153
153
|
"""
|
154
|
-
|
154
|
+
Update the status of a run in the database.
|
155
155
|
|
156
156
|
Args:
|
157
|
-
status (
|
158
|
-
code is not found in the INT_TO_RUN_STATUS mapping, the
|
159
|
-
status will default to RunStatus.FAILED.
|
157
|
+
status (RunStatus): The new status to set for the run.
|
160
158
|
|
161
159
|
Returns:
|
162
160
|
None
|
161
|
+
|
162
|
+
Notes:
|
163
|
+
This method updates the status of the run identified by `self.run_id` in the run table.
|
164
|
+
If `self.run_id` is None, no update is performed.
|
163
165
|
"""
|
164
166
|
if self.run_id is not None:
|
165
|
-
new_status = self.INT_TO_RUN_STATUS.get(status, self.RunStatus.FAILED)
|
166
167
|
statement = (
|
167
168
|
sql.update(self.run_table)
|
168
169
|
.where(
|
169
170
|
self.run_table.c[self.TableKeys.PRIMARY_KEY.value] == self.run_id
|
170
171
|
)
|
171
|
-
.values({self.TableKeys.STATUS.value:
|
172
|
+
.values({self.TableKeys.STATUS.value: status.value})
|
172
173
|
)
|
173
174
|
self._execute(statement)
|
174
175
|
|
@@ -241,8 +242,6 @@ class DataBaseHandler:
|
|
241
242
|
sql_mapping = lambda value: (self._from_bytes(value))
|
242
243
|
return self._get(self.result_table, run_id, names, sql_mapping)
|
243
244
|
|
244
|
-
@mpi.MPI.synchronize_ranks
|
245
|
-
@mpi.MPI.run_only_on_root
|
246
245
|
def delete_run(self, run_id: int) -> None:
|
247
246
|
"""
|
248
247
|
Deletes a run entry from the database based on the provided run ID.
|
@@ -390,16 +389,15 @@ class DataBaseHandler:
|
|
390
389
|
sql.PrimaryKeyConstraint(
|
391
390
|
self.TableKeys.RUN_ID.value, self.TableKeys.NAME.value
|
392
391
|
),
|
392
|
+
sql.Index(f"idx_{table_name}_run_id", self.TableKeys.RUN_ID.value),
|
393
|
+
sql.Index(f"idx_{table_name}_name", self.TableKeys.NAME.value),
|
393
394
|
)
|
394
395
|
self._create_table(table)
|
395
396
|
return table
|
396
397
|
|
397
|
-
@mpi.MPI.synchronize_ranks
|
398
|
-
@mpi.MPI.run_only_on_root
|
399
398
|
def _create_table(self, table):
|
400
399
|
table.create(self.engine, checkfirst=True)
|
401
400
|
|
402
|
-
@mpi.MPI.run_only_on_root
|
403
401
|
def _insert_run(self, inputs: any, status: RunStatus):
|
404
402
|
"""
|
405
403
|
Inserts a new run entry into the database.
|
@@ -454,11 +452,15 @@ class DataBaseHandler:
|
|
454
452
|
def _set_pragma(dbapi_connection, connection_record):
|
455
453
|
cursor = dbapi_connection.cursor()
|
456
454
|
cursor.execute("PRAGMA foreign_keys=ON")
|
455
|
+
cursor.execute("PRAGMA journal_mode=WAL")
|
457
456
|
cursor.close()
|
458
457
|
|
459
|
-
@mpi.MPI.run_only_on_root
|
460
458
|
def _insert_from_dict(
|
461
|
-
self,
|
459
|
+
self,
|
460
|
+
table,
|
461
|
+
data: dict[str, any],
|
462
|
+
sql_mapping: Callable[[any], any],
|
463
|
+
conflict_mode: ConflictMode = ConflictMode.FAIL,
|
462
464
|
) -> None:
|
463
465
|
"""
|
464
466
|
Inserts data into a specified table by mapping values through a provided SQL mapping function.
|
@@ -473,10 +475,46 @@ class DataBaseHandler:
|
|
473
475
|
"""
|
474
476
|
for name, value in data.items():
|
475
477
|
if mapped_value := sql_mapping(value):
|
476
|
-
self._insert(table, name, mapped_value)
|
478
|
+
self._insert(table, name, mapped_value, conflict_mode)
|
479
|
+
|
480
|
+
def _insert(
|
481
|
+
self,
|
482
|
+
table: sql.Table,
|
483
|
+
name: str,
|
484
|
+
value: any,
|
485
|
+
conflict_mode: ConflictMode = ConflictMode.FAIL,
|
486
|
+
):
|
487
|
+
"""
|
488
|
+
Inserts a record into the specified SQL table with the given name and value, handling conflicts according to the specified mode.
|
489
|
+
Args:
|
490
|
+
table (sql.Table): The SQLAlchemy table object where the record will be inserted.
|
491
|
+
name (str): The name/key associated with the value to insert.
|
492
|
+
value (any): The value to be inserted into the table.
|
493
|
+
conflict_mode (ConflictMode, optional): Specifies how to handle conflicts on unique constraints.
|
494
|
+
Defaults to ConflictMode.FAIL. If set to ConflictMode.UPDATE, existing records with the same
|
495
|
+
run_id and name will be updated with the new value.
|
496
|
+
Returns:
|
497
|
+
None
|
498
|
+
Raises:
|
499
|
+
Any exceptions raised by the underlying database execution.
|
500
|
+
"""
|
501
|
+
data = {
|
502
|
+
self.TableKeys.RUN_ID.value: self.run_id,
|
503
|
+
self.TableKeys.NAME.value: name,
|
504
|
+
self.TableKeys.VALUE.value: value,
|
505
|
+
}
|
506
|
+
statement = sqlite_insert(table).values(data)
|
507
|
+
if conflict_mode == self.ConflictMode.UPDATE:
|
508
|
+
statement = statement.on_conflict_do_update(
|
509
|
+
index_elements=[
|
510
|
+
self.TableKeys.RUN_ID.value,
|
511
|
+
self.TableKeys.NAME.value,
|
512
|
+
],
|
513
|
+
set_={self.TableKeys.VALUE.value: value},
|
514
|
+
)
|
515
|
+
self._execute(statement)
|
477
516
|
|
478
|
-
|
479
|
-
def _insert(self, table: sql.Table, name: str, value: any):
|
517
|
+
def _insert_with_update(self, table: sql.Table, name: str, value: any):
|
480
518
|
"""
|
481
519
|
Inserts a record into the specified SQL table or updates it if a conflict occurs.
|
482
520
|
|