qupled 1.0.2__tar.gz → 1.1.0__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.1.0/.devcontainer/Dockerfile +25 -0
- qupled-1.1.0/.devcontainer/devcontainer.json +16 -0
- {qupled-1.0.2 → qupled-1.1.0}/.gitignore +7 -5
- {qupled-1.0.2 → qupled-1.1.0}/PKG-INFO +11 -10
- {qupled-1.0.2 → qupled-1.1.0}/README.md +5 -5
- {qupled-1.0.2 → qupled-1.1.0}/dev/devtool.py +40 -40
- qupled-1.1.0/dev/requirements-apt.txt +10 -0
- qupled-1.1.0/dev/requirements-brew.txt +9 -0
- {qupled-1.0.2 → qupled-1.1.0}/docs/conf.py +1 -1
- qupled-1.1.0/docs/contribute.rst +61 -0
- qupled-1.1.0/docs/examples.rst +110 -0
- {qupled-1.0.2 → qupled-1.1.0}/docs/introduction.rst +6 -3
- qupled-1.1.0/docs/qupled.rst +240 -0
- qupled-1.1.0/docs/requirements.txt +2 -0
- qupled-1.0.2/examples/docs/fixedAdrQstls.py → qupled-1.1.0/examples/docs/fixed_adr.py +10 -13
- qupled-1.0.2/examples/docs/initialGuessStls.py → qupled-1.1.0/examples/docs/initial_guess_stls.py +6 -6
- qupled-1.1.0/examples/docs/solve_quantum_schemes.py +27 -0
- qupled-1.0.2/examples/docs/solveQVSStls.py → qupled-1.1.0/examples/docs/solve_qvsstls.py +7 -10
- qupled-1.1.0/examples/docs/solve_rpa_and_esa.py +37 -0
- qupled-1.1.0/examples/docs/solve_stls.py +21 -0
- qupled-1.0.2/examples/docs/solveStlsIet.py → qupled-1.1.0/examples/docs/solve_stls_iet.py +5 -5
- qupled-1.1.0/examples/docs/solve_vsstls.py +23 -0
- {qupled-1.0.2 → qupled-1.1.0}/examples/readme/create_cover.py +55 -100
- {qupled-1.0.2 → qupled-1.1.0}/examples/readme/qupled_animation_dark.svg +444 -236
- {qupled-1.0.2 → qupled-1.1.0}/examples/readme/qupled_animation_light.svg +496 -288
- qupled-1.1.0/examples/tests/test_examples.py +73 -0
- {qupled-1.0.2 → qupled-1.1.0}/pyproject.toml +4 -4
- qupled-1.1.0/src/qupled/database.py +640 -0
- qupled-1.1.0/src/qupled/esa.py +27 -0
- qupled-1.1.0/src/qupled/hf.py +263 -0
- qupled-1.1.0/src/qupled/mpi.py +72 -0
- qupled-1.1.0/src/qupled/native/include/database.hpp +18 -0
- qupled-1.1.0/src/qupled/native/include/esa.hpp +86 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/free_energy.hpp +4 -4
- qupled-1.1.0/src/qupled/native/include/hf.hpp +191 -0
- qupled-1.1.0/src/qupled/native/include/iet.hpp +95 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/input.hpp +79 -107
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/internal_energy.hpp +4 -7
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/logger.hpp +5 -2
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/num_util.hpp +3 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/python_wrappers.hpp +57 -22
- qupled-1.1.0/src/qupled/native/include/qstls.hpp +305 -0
- qupled-1.1.0/src/qupled/native/include/qstlsiet.hpp +160 -0
- qupled-1.0.2/src/qupled/native/include/qvs.hpp → qupled-1.1.0/src/qupled/native/include/qvsstls.hpp +7 -11
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/rdf.hpp +6 -12
- qupled-1.1.0/src/qupled/native/include/rpa.hpp +136 -0
- qupled-1.1.0/src/qupled/native/include/stls.hpp +102 -0
- qupled-1.1.0/src/qupled/native/include/stlsiet.hpp +84 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/vsbase.hpp +12 -18
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/vsstls.hpp +2 -5
- qupled-1.1.0/src/qupled/native/src/CMakeLists.txt +88 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/esa.cpp +41 -38
- qupled-1.1.0/src/qupled/native/src/free_energy.cpp +10 -0
- qupled-1.0.2/src/qupled/native/src/rpa.cpp → qupled-1.1.0/src/qupled/native/src/hf.cpp +51 -121
- qupled-1.1.0/src/qupled/native/src/iet.cpp +186 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/input.cpp +24 -170
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/internal_energy.cpp +3 -3
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/python_modules.cpp +95 -80
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/python_wrappers.cpp +63 -45
- qupled-1.1.0/src/qupled/native/src/qstls.cpp +441 -0
- qupled-1.1.0/src/qupled/native/src/qstlsiet.cpp +354 -0
- qupled-1.0.2/src/qupled/native/src/qvs.cpp → qupled-1.1.0/src/qupled/native/src/qvsstls.cpp +38 -59
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/rdf.cpp +5 -5
- qupled-1.1.0/src/qupled/native/src/rpa.cpp +139 -0
- qupled-1.1.0/src/qupled/native/src/stls.cpp +145 -0
- qupled-1.1.0/src/qupled/native/src/stlsiet.cpp +120 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/thermo_util.cpp +12 -7
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/vsbase.cpp +4 -33
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/vsstls.cpp +2 -32
- qupled-1.1.0/src/qupled/output.py +92 -0
- qupled-1.1.0/src/qupled/qstls.py +151 -0
- qupled-1.1.0/src/qupled/qstlsiet.py +42 -0
- qupled-1.1.0/src/qupled/qvsstls.py +73 -0
- qupled-1.1.0/src/qupled/rpa.py +27 -0
- qupled-1.1.0/src/qupled/stls.py +94 -0
- qupled-1.1.0/src/qupled/stlsiet.py +58 -0
- qupled-1.1.0/src/qupled/vsstls.py +203 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled.egg-info/PKG-INFO +11 -10
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled.egg-info/SOURCES.txt +54 -36
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled.egg-info/requires.txt +2 -2
- qupled-1.1.0/tests/native/conftest.py +11 -0
- {qupled-1.0.2/tests → qupled-1.1.0/tests/native}/test_esa_native.py +9 -13
- qupled-1.1.0/tests/native/test_hf_native.py +38 -0
- qupled-1.1.0/tests/native/test_qstls_iet_native.py +47 -0
- qupled-1.1.0/tests/native/test_qstls_native.py +46 -0
- qupled-1.1.0/tests/native/test_qvsstls_native.py +56 -0
- {qupled-1.0.2/tests → qupled-1.1.0/tests/native}/test_rpa_native.py +8 -12
- qupled-1.1.0/tests/native/test_stls_iet_native.py +36 -0
- qupled-1.1.0/tests/native/test_stls_native.py +42 -0
- qupled-1.1.0/tests/native/test_vsstls_native.py +42 -0
- qupled-1.1.0/tests/test_database.py +673 -0
- qupled-1.1.0/tests/test_esa.py +27 -0
- qupled-1.1.0/tests/test_hf.py +217 -0
- qupled-1.1.0/tests/test_mpi.py +63 -0
- qupled-1.1.0/tests/test_output.py +39 -0
- qupled-1.1.0/tests/test_qstls.py +149 -0
- qupled-1.1.0/tests/test_qstlsiet.py +56 -0
- qupled-1.1.0/tests/test_qvsstls.py +66 -0
- qupled-1.1.0/tests/test_rpa.py +42 -0
- qupled-1.1.0/tests/test_stls.py +101 -0
- qupled-1.1.0/tests/test_stlsiet.py +45 -0
- qupled-1.1.0/tests/test_vsstls.py +201 -0
- {qupled-1.0.2 → qupled-1.1.0}/tox.ini +8 -1
- qupled-1.0.2/docs/contribute.rst +0 -34
- qupled-1.0.2/docs/examples.rst +0 -151
- qupled-1.0.2/docs/qupled.rst +0 -533
- qupled-1.0.2/docs/requirements.txt +0 -4
- qupled-1.0.2/examples/docs/fixedAdrQVSStls.py +0 -27
- qupled-1.0.2/examples/docs/fixedAdrQstlsIet.py +0 -27
- qupled-1.0.2/examples/docs/initialGuessQstls.py +0 -19
- qupled-1.0.2/examples/docs/initialGuessQstlsIet.py +0 -20
- qupled-1.0.2/examples/docs/solveQuantumSchemes.py +0 -30
- qupled-1.0.2/examples/docs/solveRpaAndESA.py +0 -49
- qupled-1.0.2/examples/docs/solveStls.py +0 -28
- qupled-1.0.2/examples/docs/solveVSStls.py +0 -30
- qupled-1.0.2/examples/docs/tests/test_examples.py +0 -85
- qupled-1.0.2/src/qupled/classic.py +0 -494
- qupled-1.0.2/src/qupled/native/include/bin_util.hpp +0 -58
- qupled-1.0.2/src/qupled/native/include/esa.hpp +0 -59
- qupled-1.0.2/src/qupled/native/include/qstls.hpp +0 -389
- qupled-1.0.2/src/qupled/native/include/rpa.hpp +0 -291
- qupled-1.0.2/src/qupled/native/include/stls.hpp +0 -200
- qupled-1.0.2/src/qupled/native/src/CMakeLists.txt +0 -82
- qupled-1.0.2/src/qupled/native/src/free_energy.cpp +0 -10
- qupled-1.0.2/src/qupled/native/src/qstls.cpp +0 -818
- qupled-1.0.2/src/qupled/native/src/stls.cpp +0 -447
- qupled-1.0.2/src/qupled/quantum.py +0 -301
- qupled-1.0.2/src/qupled/util.py +0 -330
- qupled-1.0.2/tests/test_esa.py +0 -31
- qupled-1.0.2/tests/test_hdf.py +0 -175
- qupled-1.0.2/tests/test_plot.py +0 -32
- qupled-1.0.2/tests/test_qstls.py +0 -79
- qupled-1.0.2/tests/test_qstls_iet.py +0 -125
- qupled-1.0.2/tests/test_qstls_input.py +0 -126
- qupled-1.0.2/tests/test_qstls_native.py +0 -89
- qupled-1.0.2/tests/test_qvs.py +0 -140
- qupled-1.0.2/tests/test_qvs_input.py +0 -178
- qupled-1.0.2/tests/test_qvs_native.py +0 -63
- qupled-1.0.2/tests/test_rpa.py +0 -108
- qupled-1.0.2/tests/test_rpa_input.py +0 -190
- qupled-1.0.2/tests/test_stls.py +0 -75
- qupled-1.0.2/tests/test_stls_iet.py +0 -67
- qupled-1.0.2/tests/test_stls_input.py +0 -154
- qupled-1.0.2/tests/test_stls_native.py +0 -90
- qupled-1.0.2/tests/test_vsstls.py +0 -81
- qupled-1.0.2/tests/test_vsstls_input.py +0 -164
- qupled-1.0.2/tests/test_vsstls_native.py +0 -51
- {qupled-1.0.2 → qupled-1.1.0}/.clang-format +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/.github/workflows/build-and-test-base.yml +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/.github/workflows/build-and-test.yml +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/.github/workflows/formatting.yml +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/.github/workflows/release.yml +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/.readthedocs.yaml +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/LICENSE +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/MANIFEST.in +0 -0
- /qupled-1.0.2/dev/requirements.txt → /qupled-1.1.0/dev/requirements-pip.txt +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/devtool +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/docs/_static/css/rdt_theme_python_properties.css +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/docs/index.rst +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/docs/make.bat +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/setup.cfg +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/setup.py +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/__init__.py +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/chemical_potential.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/dual.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/mpi_util.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/numerics.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/python_util.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/thermo_util.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/vector2D.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/vector3D.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/include/vector_util.hpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/chemical_potential.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/logger.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/mpi_util.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/num_util.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/numerics.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/python_util.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/vector2D.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/vector3D.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled/native/src/vector_util.cpp +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled.egg-info/dependency_links.txt +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled.egg-info/not-zip-safe +0 -0
- {qupled-1.0.2 → qupled-1.1.0}/src/qupled.egg-info/top_level.txt +0 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
|
2
|
+
|
3
|
+
# Install Python and clean up
|
4
|
+
RUN apt-get update && apt-get install -y \
|
5
|
+
python3 python3-venv python3-pip && \
|
6
|
+
rm -rf /var/lib/apt/lists/*
|
7
|
+
|
8
|
+
# Set up Python environment
|
9
|
+
ENV PYTHON_VENV_ROOT=/workspaces/qupled_venv
|
10
|
+
RUN python3 -m venv $PYTHON_VENV_ROOT && \
|
11
|
+
chown -R vscode:vscode $PYTHON_VENV_ROOT
|
12
|
+
|
13
|
+
# Copy project files, set permissions, and install dependencies
|
14
|
+
ENV SETUP_DIR=/setup_dir
|
15
|
+
COPY dev $SETUP_DIR/dev/
|
16
|
+
COPY devtool $SETUP_DIR/devtool
|
17
|
+
WORKDIR $SETUP_DIR
|
18
|
+
RUN chmod +x devtool && \
|
19
|
+
. $PYTHON_VENV_ROOT/bin/activate && \
|
20
|
+
./devtool install-deps
|
21
|
+
WORKDIR /
|
22
|
+
RUN rm -rf $SETUP_DIR
|
23
|
+
|
24
|
+
# Automatically activate the Python environment on container start
|
25
|
+
RUN echo "source $PYTHON_VENV_ROOT/bin/activate" >> /etc/bash.bashrc
|
@@ -1,19 +1,19 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: qupled
|
3
|
-
Version: 1.0
|
3
|
+
Version: 1.1.0
|
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
|
+
License-Expression: GPL-3.0-or-later
|
6
7
|
Classifier: Programming Language :: Python :: 3.10
|
7
8
|
Classifier: Operating System :: MacOS
|
8
9
|
Classifier: Operating System :: POSIX :: Linux
|
9
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
10
10
|
Requires-Python: <3.14,>=3.10
|
11
11
|
Description-Content-Type: text/markdown
|
12
12
|
License-File: LICENSE
|
13
|
+
Requires-Dist: blosc2~=3.2
|
13
14
|
Requires-Dist: matplotlib~=3.7
|
14
15
|
Requires-Dist: numpy<2.0
|
15
|
-
Requires-Dist:
|
16
|
-
Requires-Dist: tables~=3.10
|
16
|
+
Requires-Dist: SQLAlchemy~=2.0
|
17
17
|
Provides-Extra: testing
|
18
18
|
Requires-Dist: pytest~=8.0; extra == "testing"
|
19
19
|
Requires-Dist: pytest-mock~=3.12; extra == "testing"
|
@@ -26,6 +26,7 @@ Requires-Dist: sphinxcontrib-jquery~=4.1; extra == "docs"
|
|
26
26
|
Requires-Dist: sphinxcontrib-jsmath~=1.0.1; extra == "docs"
|
27
27
|
Requires-Dist: sphinxcontrib-qthelp~=2.0.0; extra == "docs"
|
28
28
|
Requires-Dist: sphinxcontrib-serializinghtml~=2.0.0; extra == "docs"
|
29
|
+
Dynamic: license-file
|
29
30
|
|
30
31
|
# Qupled
|
31
32
|
|
@@ -41,18 +42,18 @@ Qupled is a Python package designed for calculating the properties of quantum pl
|
|
41
42
|
|
42
43
|
## Running
|
43
44
|
|
44
|
-
After [installation](https://qupled.readthedocs.io/en/latest/introduction.html#installing-qupled) qupled can be used as a regular Python package
|
45
|
+
After [installation](https://qupled.readthedocs.io/en/latest/introduction.html#installing-qupled) qupled can be used as a regular Python package.
|
45
46
|
|
46
47
|
```python
|
47
48
|
# Solve the stls dielectric scheme for coupling = 10 and degeneracy 1.0
|
48
|
-
|
49
|
-
inputs =
|
50
|
-
Stls().compute(inputs)
|
49
|
+
import qupled.stls as stls
|
50
|
+
inputs = stls.Input(10.0, 1.0)
|
51
|
+
stls.Stls().compute(inputs)
|
51
52
|
```
|
52
53
|
|
53
54
|
## Documentation
|
54
55
|
|
55
|
-
More detailed information on the package together with a list of examples is available in the [documentation](http://qupled.readthedocs.io/)
|
56
|
+
More detailed information on the package together with a list of examples is available in the [documentation](http://qupled.readthedocs.io/).
|
56
57
|
|
57
58
|
## Publications
|
58
59
|
|
@@ -12,18 +12,18 @@ Qupled is a Python package designed for calculating the properties of quantum pl
|
|
12
12
|
|
13
13
|
## Running
|
14
14
|
|
15
|
-
After [installation](https://qupled.readthedocs.io/en/latest/introduction.html#installing-qupled) qupled can be used as a regular Python package
|
15
|
+
After [installation](https://qupled.readthedocs.io/en/latest/introduction.html#installing-qupled) qupled can be used as a regular Python package.
|
16
16
|
|
17
17
|
```python
|
18
18
|
# Solve the stls dielectric scheme for coupling = 10 and degeneracy 1.0
|
19
|
-
|
20
|
-
inputs =
|
21
|
-
Stls().compute(inputs)
|
19
|
+
import qupled.stls as stls
|
20
|
+
inputs = stls.Input(10.0, 1.0)
|
21
|
+
stls.Stls().compute(inputs)
|
22
22
|
```
|
23
23
|
|
24
24
|
## Documentation
|
25
25
|
|
26
|
-
More detailed information on the package together with a list of examples is available in the [documentation](http://qupled.readthedocs.io/)
|
26
|
+
More detailed information on the package together with a list of examples is available in the [documentation](http://qupled.readthedocs.io/).
|
27
27
|
|
28
28
|
## Publications
|
29
29
|
|
@@ -5,9 +5,9 @@ import shutil
|
|
5
5
|
from pathlib import Path
|
6
6
|
|
7
7
|
|
8
|
-
def build(
|
8
|
+
def build(no_mpi, native_only):
|
9
9
|
# Build without MPI
|
10
|
-
if
|
10
|
+
if no_mpi:
|
11
11
|
os.environ["USE_MPI"] = "OFF"
|
12
12
|
# Set environment variable for OpenMP on macOS
|
13
13
|
if os.name == "posix" and shutil.which("brew"):
|
@@ -46,8 +46,11 @@ def run_tox(environment):
|
|
46
46
|
subprocess.run(["tox", "-e", environment], check=True)
|
47
47
|
|
48
48
|
|
49
|
-
def test():
|
50
|
-
|
49
|
+
def test(no_native):
|
50
|
+
if no_native:
|
51
|
+
run_tox("no_native")
|
52
|
+
else:
|
53
|
+
run_tox("test")
|
51
54
|
|
52
55
|
|
53
56
|
def examples():
|
@@ -83,49 +86,39 @@ def clean():
|
|
83
86
|
def install():
|
84
87
|
wheel_file = get_wheel_file()
|
85
88
|
if wheel_file is not None:
|
86
|
-
subprocess.run(["pip", "
|
89
|
+
subprocess.run(["pip", "uninstall", "-y", wheel_file], check=True)
|
90
|
+
subprocess.run(["pip", "install", wheel_file], check=True)
|
87
91
|
|
88
92
|
|
89
93
|
def install_dependencies():
|
90
94
|
print("Installing dependencies...")
|
95
|
+
script_dir = Path(__file__).resolve().parent
|
96
|
+
pip_requirements = script_dir / "requirements-pip.txt"
|
91
97
|
if os.name == "posix":
|
92
98
|
if shutil.which("apt-get"):
|
93
|
-
|
94
|
-
subprocess.run(
|
95
|
-
[
|
96
|
-
"sudo",
|
97
|
-
"apt-get",
|
98
|
-
"install",
|
99
|
-
"-y",
|
100
|
-
"cmake",
|
101
|
-
"libboost-all-dev",
|
102
|
-
"libopenmpi-dev",
|
103
|
-
"libgsl-dev",
|
104
|
-
"libomp-dev",
|
105
|
-
"libfmt-dev",
|
106
|
-
"python3-dev",
|
107
|
-
],
|
108
|
-
check=True,
|
109
|
-
)
|
99
|
+
_install_with_apt(script_dir / "requirements-apt.txt")
|
110
100
|
elif shutil.which("brew"):
|
111
|
-
|
112
|
-
subprocess.run(
|
113
|
-
[
|
114
|
-
"brew",
|
115
|
-
"install",
|
116
|
-
"cmake",
|
117
|
-
"gsl",
|
118
|
-
"libomp",
|
119
|
-
"openmpi",
|
120
|
-
"fmt",
|
121
|
-
"boost-python3",
|
122
|
-
],
|
123
|
-
check=True,
|
124
|
-
)
|
101
|
+
_install_with_brew(script_dir / "requirements-brew.txt")
|
125
102
|
else:
|
126
103
|
print("Unsupported package manager. Please install dependencies manually.")
|
127
104
|
else:
|
128
105
|
print("Unsupported operating system. Please install dependencies manually.")
|
106
|
+
subprocess.run(["pip", "install", "-r", str(pip_requirements)], check=True)
|
107
|
+
|
108
|
+
|
109
|
+
def _install_with_apt(apt_requirements):
|
110
|
+
subprocess.run(["sudo", "apt-get", "update"], check=True)
|
111
|
+
with apt_requirements.open("r") as apt_file:
|
112
|
+
subprocess.run(
|
113
|
+
["xargs", "sudo", "apt-get", "install", "-y"],
|
114
|
+
stdin=apt_file,
|
115
|
+
check=True,
|
116
|
+
)
|
117
|
+
|
118
|
+
|
119
|
+
def _install_with_brew(brew_requirements):
|
120
|
+
subprocess.run(["brew", "update"], check=True)
|
121
|
+
subprocess.run(["brew", "bundle", f"--file={brew_requirements}"], check=True)
|
129
122
|
|
130
123
|
|
131
124
|
def update_version(build_version):
|
@@ -154,7 +147,7 @@ def run():
|
|
154
147
|
# Build command
|
155
148
|
build_parser = subparsers.add_parser("build", help="Build the qupled package")
|
156
149
|
build_parser.add_argument(
|
157
|
-
"--
|
150
|
+
"--no_mpi",
|
158
151
|
action="store_true",
|
159
152
|
help="Build without MPI support (default: False).",
|
160
153
|
)
|
@@ -164,6 +157,14 @@ def run():
|
|
164
157
|
help="Build only native code in C++ (default: False).",
|
165
158
|
)
|
166
159
|
|
160
|
+
# Test command
|
161
|
+
test_parser = subparsers.add_parser("test", help="Run tests")
|
162
|
+
test_parser.add_argument(
|
163
|
+
"--no-native",
|
164
|
+
action="store_true",
|
165
|
+
help="Exclude the tests for the native classes (default: False).",
|
166
|
+
)
|
167
|
+
|
167
168
|
# Update version command
|
168
169
|
version_parser = subparsers.add_parser(
|
169
170
|
"update-version", help="Update package version"
|
@@ -177,12 +178,11 @@ def run():
|
|
177
178
|
subparsers.add_parser("format", help="Format the source code")
|
178
179
|
subparsers.add_parser("install", help="Install the qupled package")
|
179
180
|
subparsers.add_parser("install-deps", help="Install system dependencies")
|
180
|
-
subparsers.add_parser("test", help="Run tests")
|
181
181
|
|
182
182
|
args = parser.parse_args()
|
183
183
|
|
184
184
|
if args.command == "build":
|
185
|
-
build(args.
|
185
|
+
build(args.no_mpi, args.native_only)
|
186
186
|
elif args.command == "clean":
|
187
187
|
clean()
|
188
188
|
elif args.command == "docs":
|
@@ -194,7 +194,7 @@ def run():
|
|
194
194
|
elif args.command == "install":
|
195
195
|
install()
|
196
196
|
elif args.command == "test":
|
197
|
-
test()
|
197
|
+
test(args.no_native)
|
198
198
|
elif args.command == "install-deps":
|
199
199
|
install_dependencies()
|
200
200
|
elif args.command == "update-version":
|
@@ -23,7 +23,7 @@ extensions = ["sphinx.ext.napoleon", "sphinx.ext.autodoc", "sphinx.ext.mathjax"]
|
|
23
23
|
templates_path = ["_templates"]
|
24
24
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
25
25
|
autodoc_member_order = "bysource"
|
26
|
-
autodoc_mock_imports = ["qupled.native"]
|
26
|
+
autodoc_mock_imports = ["qupled.native", "sqlalchemy", "blosc2"]
|
27
27
|
|
28
28
|
# -- Options for HTML output -------------------------------------------------
|
29
29
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
@@ -0,0 +1,61 @@
|
|
1
|
+
How to contribute
|
2
|
+
=================
|
3
|
+
|
4
|
+
The following guidelines explain how to contribute to both the codebase and the documentation.
|
5
|
+
|
6
|
+
Setup the development environment
|
7
|
+
---------------------------------
|
8
|
+
|
9
|
+
There are two options for setting up your development environment:
|
10
|
+
|
11
|
+
1. **The Easy Option: Use the Development Container**
|
12
|
+
|
13
|
+
This project includes a pre-configured development container to simplify the setup process.
|
14
|
+
The development container provides all necessary tools, including an up-to-date version of Git,
|
15
|
+
Python, and other dependencies.
|
16
|
+
|
17
|
+
To use the development container, ensure you have Docker and Visual Studio Code installed.
|
18
|
+
Then, open the project in Visual Studio Code and follow these steps:
|
19
|
+
|
20
|
+
- Install the `Remote - Containers` extension if you haven't already.
|
21
|
+
- When prompted, reopen the project in the container.
|
22
|
+
|
23
|
+
Once the container is running, all tools and dependencies will be available in the environment.
|
24
|
+
You can start developing immediately without additional setup.
|
25
|
+
|
26
|
+
2. **The DIY Option: Manual Setup**
|
27
|
+
|
28
|
+
If you prefer to set up the environment manually, start by installing the required Python
|
29
|
+
packages with the following command:
|
30
|
+
|
31
|
+
.. code-block:: console
|
32
|
+
|
33
|
+
pip install -r dev/requirements.txt
|
34
|
+
|
35
|
+
Additionally, ensure that you have all the necessary :ref:`external dependencies <external_dependencies>`
|
36
|
+
installed.
|
37
|
+
|
38
|
+
Formatting
|
39
|
+
----------
|
40
|
+
|
41
|
+
To maintain consistent code formatting across the C++ and Python codebases, we use
|
42
|
+
`clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_ and
|
43
|
+
`black <https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html>`_.
|
44
|
+
The formatting is automatically checked every time new code is pushed to the repository.
|
45
|
+
To manually ensure the correct formatting is applied, run:
|
46
|
+
|
47
|
+
.. code-block:: console
|
48
|
+
|
49
|
+
./devtool format
|
50
|
+
|
51
|
+
Documentation
|
52
|
+
-------------
|
53
|
+
|
54
|
+
The documentation is stored in the ``docs`` directory, and changes can be made by editing the ``.rst`` files within it.
|
55
|
+
Once you've made your changes, you can verify and build the documentation using:
|
56
|
+
|
57
|
+
.. code-block:: console
|
58
|
+
|
59
|
+
./devtool docs
|
60
|
+
|
61
|
+
The generated output can be viewed by opening ``docs/_build/index.html`` in your browser.
|
@@ -0,0 +1,110 @@
|
|
1
|
+
Examples
|
2
|
+
========
|
3
|
+
|
4
|
+
The following examples present some common use cases that show how to run qupled and how to post-process the results.
|
5
|
+
|
6
|
+
Setup a scheme and analyze the output
|
7
|
+
-------------------------------------
|
8
|
+
|
9
|
+
This example sets up all the necessary objects to solve the RPA and ESA schemes and
|
10
|
+
shows how to access the information stored in the output files produced at the
|
11
|
+
end of the calculations
|
12
|
+
|
13
|
+
.. literalinclude:: ../examples/docs/solve_rpa_and_esa.py
|
14
|
+
:language: python
|
15
|
+
|
16
|
+
A simple STLS solution
|
17
|
+
----------------------
|
18
|
+
|
19
|
+
This example sets up a simple STLS calculation and plots some of the results
|
20
|
+
that are produced once the calculation are completed. There are two ways to access
|
21
|
+
the results of the calculation: Directly from the object used to perform the calculation
|
22
|
+
or from the output file created at the end of the run. The example illustrates how
|
23
|
+
the static structure factor can be accessed with both these methods. Other quantities
|
24
|
+
can be accessed in the same way.
|
25
|
+
|
26
|
+
.. literalinclude:: ../examples/docs/solve_stls.py
|
27
|
+
:language: python
|
28
|
+
|
29
|
+
Solving the classical IET schemes
|
30
|
+
----------------------------------
|
31
|
+
|
32
|
+
This example shows how to solve two classical STLS-IET schemes: the STLS-HNC and
|
33
|
+
the STLS-LCT schemes. The schemes are solved one after the other by simply
|
34
|
+
updating the properties of the solution object.
|
35
|
+
|
36
|
+
.. literalinclude:: ../examples/docs/solve_stls_iet.py
|
37
|
+
:language: python
|
38
|
+
|
39
|
+
.. _solvingQuantumSchemes:
|
40
|
+
|
41
|
+
Solving the quantum schemes
|
42
|
+
---------------------------
|
43
|
+
|
44
|
+
This example shows how to solve the quantum dielectric schemes QSTLS and QSTLS-LCT.
|
45
|
+
Since these schemes can have a relatively high computational cost, in this example
|
46
|
+
we limit the number of matsubara frequencies to 16, we use 16 OMP threads to
|
47
|
+
speed up the calculation and we employ a segregated approach to solve the two-dimensional
|
48
|
+
integrals that appear in the schemes.
|
49
|
+
|
50
|
+
.. literalinclude:: ../examples/docs/solve_quantum_schemes.py
|
51
|
+
:language: python
|
52
|
+
|
53
|
+
Solving the VS schemes
|
54
|
+
----------------------
|
55
|
+
|
56
|
+
This example shows how to solve the classical VS-STLS scheme at finite temperature.
|
57
|
+
First the scheme is solved up to rs = 2, then the results are
|
58
|
+
plotted and then the calculation is resumed up to rs = 5. In the second
|
59
|
+
part of the calculation, the pre-computed value of the free energy integrand
|
60
|
+
available from the VS-STLS solution at rs = 2 is used in order to speed
|
61
|
+
up the calculation.
|
62
|
+
|
63
|
+
.. literalinclude:: ../examples/docs/solve_vsstls.py
|
64
|
+
:language: python
|
65
|
+
|
66
|
+
This example shows how to solve the quantum version of the VS-STLS scheme.
|
67
|
+
Following the same logic of the previous example we first solve the scheme
|
68
|
+
up to rs = 1.0 and then we resume the calculation up to rs = 2.0 while using
|
69
|
+
the pre-compute values of the free energy integrand.
|
70
|
+
|
71
|
+
.. literalinclude:: ../examples/docs/solve_qvsstls.py
|
72
|
+
:language: python
|
73
|
+
|
74
|
+
Define an initial guess
|
75
|
+
-----------------------
|
76
|
+
|
77
|
+
The following example shows how to define an initial guess for the STLS scheme. If
|
78
|
+
an initial guess is not specified the code will use the default, namely zero static
|
79
|
+
local field correction.
|
80
|
+
|
81
|
+
.. literalinclude:: ../examples/docs/initial_guess_stls.py
|
82
|
+
:language: python
|
83
|
+
|
84
|
+
For other schemes the initial guess can be specified in a similar manner.
|
85
|
+
|
86
|
+
Speed-up the quantum schemes
|
87
|
+
----------------------------
|
88
|
+
|
89
|
+
The quantum schemes can have a significant computational cost. There are two strategies
|
90
|
+
that can be employed to speed up the calculations:
|
91
|
+
|
92
|
+
* *Parallelization*: qupled supports both multithreaded calculations with OpenMP and
|
93
|
+
multiprocessors computations with MPI. The number of OpenMP threads
|
94
|
+
can be specified in input (as shown in :ref:`this example<solvingQuantumSchemes>`).
|
95
|
+
Multiprocessor computations can be performed by running qupled as an MPI application:
|
96
|
+
``mpirun -n <number_of_cores> python3 <script_using_qupled>``. OpenMP and MPI can be
|
97
|
+
used concurrently by setting both the number of threads and the number of cores.
|
98
|
+
|
99
|
+
* *Pre-computation*: The calculations for the quantum schemes can be made significantly
|
100
|
+
faster if part of the calculation of the auxiliary density response can be skipped.
|
101
|
+
Qupled will look into the database used to store the results to try to find the
|
102
|
+
necessary data to skip the full calculation of the auxiliary density response.
|
103
|
+
|
104
|
+
The following example shows the effect of pre-computation. The example first
|
105
|
+
computes the auxiliary density response for a given set of parameters and then
|
106
|
+
it uses the pre-computed data to speed up the calculation of the auxiliary density
|
107
|
+
response for a different set of parameters.
|
108
|
+
|
109
|
+
.. literalinclude:: ../examples/docs/fixed_adr.py
|
110
|
+
:language: python
|
@@ -37,14 +37,17 @@ is the Fermi energy and :math:`h` is Planck's constant.
|
|
37
37
|
Installing qupled
|
38
38
|
-----------------
|
39
39
|
|
40
|
+
.. _external_dependencies:
|
41
|
+
|
40
42
|
External dependencies
|
41
43
|
~~~~~~~~~~~~~~~~~~~~~
|
42
44
|
|
43
45
|
The installation of qupled may require compiling some C++ code, depending on the platform and installation method.
|
44
46
|
Therefore, ensure the following dependencies are met before attempting to install or run qupled:
|
45
47
|
|
46
|
-
- `CMake <https://cmake.org/download/>`_
|
47
48
|
- `Boost <https://www.boost.org/doc/libs/1_80_0/libs/python/doc/html/index.html>`_
|
49
|
+
- `CMake <https://cmake.org/download/>`_
|
50
|
+
- `fmt <https://github.com/fmtlib/fmt>`_
|
48
51
|
- `GNU Scientific Library <https://www.gnu.org/software/gsl/>`_
|
49
52
|
- `OpenMP <https://en.wikipedia.org/wiki/OpenMP>`_
|
50
53
|
- `Open-MPI <https://www.open-mpi.org/software/ompi/v5.0/>`_
|
@@ -53,13 +56,13 @@ For linux distributions all these dependencies can be installed with
|
|
53
56
|
|
54
57
|
.. code-block:: console
|
55
58
|
|
56
|
-
sudo apt-get install -y cmake libboost-all-dev libopenmpi-dev libgsl-dev libomp-dev libfmt-dev python3-dev
|
59
|
+
sudo apt-get install -y cmake libboost-all-dev libopenmpi-dev libgsl-dev libomp-dev libfmt-dev python3-dev libsqlite3-dev libsqlitecpp-dev
|
57
60
|
|
58
61
|
For macOS they can be installed directly from homebrew
|
59
62
|
|
60
63
|
.. code-block:: console
|
61
64
|
|
62
|
-
brew install cmake gsl libomp openmpi fmt boost-python3
|
65
|
+
brew install cmake gsl libomp openmpi fmt boost-python3 sqlite sqlitecpp
|
63
66
|
|
64
67
|
Install with pip
|
65
68
|
~~~~~~~~~~~~~~~~
|