qupled 1.0.3__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.
Files changed (188) hide show
  1. qupled-1.1.0/.devcontainer/Dockerfile +25 -0
  2. qupled-1.1.0/.devcontainer/devcontainer.json +16 -0
  3. {qupled-1.0.3 → qupled-1.1.0}/.gitignore +7 -5
  4. {qupled-1.0.3 → qupled-1.1.0}/PKG-INFO +11 -10
  5. {qupled-1.0.3 → qupled-1.1.0}/README.md +5 -5
  6. {qupled-1.0.3 → qupled-1.1.0}/dev/devtool.py +40 -40
  7. qupled-1.1.0/dev/requirements-apt.txt +10 -0
  8. qupled-1.1.0/dev/requirements-brew.txt +9 -0
  9. {qupled-1.0.3 → qupled-1.1.0}/docs/conf.py +1 -1
  10. qupled-1.1.0/docs/contribute.rst +61 -0
  11. {qupled-1.0.3 → qupled-1.1.0}/docs/examples.rst +11 -49
  12. {qupled-1.0.3 → qupled-1.1.0}/docs/introduction.rst +6 -3
  13. qupled-1.1.0/docs/qupled.rst +240 -0
  14. qupled-1.1.0/docs/requirements.txt +2 -0
  15. qupled-1.0.3/examples/docs/fixed_adr_qstls.py → qupled-1.1.0/examples/docs/fixed_adr.py +10 -13
  16. {qupled-1.0.3 → qupled-1.1.0}/examples/docs/initial_guess_stls.py +6 -6
  17. {qupled-1.0.3 → qupled-1.1.0}/examples/docs/solve_quantum_schemes.py +8 -11
  18. {qupled-1.0.3 → qupled-1.1.0}/examples/docs/solve_qvsstls.py +6 -9
  19. qupled-1.1.0/examples/docs/solve_rpa_and_esa.py +37 -0
  20. qupled-1.1.0/examples/docs/solve_stls.py +21 -0
  21. {qupled-1.0.3 → qupled-1.1.0}/examples/docs/solve_stls_iet.py +5 -5
  22. {qupled-1.0.3 → qupled-1.1.0}/examples/docs/solve_vsstls.py +6 -12
  23. {qupled-1.0.3 → qupled-1.1.0}/examples/readme/create_cover.py +55 -100
  24. {qupled-1.0.3 → qupled-1.1.0}/examples/readme/qupled_animation_dark.svg +444 -236
  25. {qupled-1.0.3 → qupled-1.1.0}/examples/readme/qupled_animation_light.svg +496 -288
  26. {qupled-1.0.3 → qupled-1.1.0}/examples/tests/test_examples.py +15 -29
  27. {qupled-1.0.3 → qupled-1.1.0}/pyproject.toml +4 -4
  28. qupled-1.1.0/src/qupled/database.py +640 -0
  29. qupled-1.1.0/src/qupled/esa.py +27 -0
  30. qupled-1.1.0/src/qupled/hf.py +263 -0
  31. qupled-1.1.0/src/qupled/mpi.py +72 -0
  32. qupled-1.1.0/src/qupled/native/include/database.hpp +18 -0
  33. qupled-1.1.0/src/qupled/native/include/esa.hpp +86 -0
  34. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/free_energy.hpp +4 -4
  35. qupled-1.1.0/src/qupled/native/include/hf.hpp +191 -0
  36. qupled-1.1.0/src/qupled/native/include/iet.hpp +95 -0
  37. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/input.hpp +79 -107
  38. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/internal_energy.hpp +4 -7
  39. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/logger.hpp +5 -2
  40. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/num_util.hpp +3 -0
  41. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/python_wrappers.hpp +57 -22
  42. qupled-1.1.0/src/qupled/native/include/qstls.hpp +305 -0
  43. qupled-1.1.0/src/qupled/native/include/qstlsiet.hpp +160 -0
  44. qupled-1.0.3/src/qupled/native/include/qvs.hpp → qupled-1.1.0/src/qupled/native/include/qvsstls.hpp +7 -11
  45. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/rdf.hpp +6 -12
  46. qupled-1.1.0/src/qupled/native/include/rpa.hpp +136 -0
  47. qupled-1.1.0/src/qupled/native/include/stls.hpp +102 -0
  48. qupled-1.1.0/src/qupled/native/include/stlsiet.hpp +84 -0
  49. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/vsbase.hpp +12 -18
  50. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/vsstls.hpp +2 -5
  51. qupled-1.1.0/src/qupled/native/src/CMakeLists.txt +88 -0
  52. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/esa.cpp +41 -38
  53. qupled-1.1.0/src/qupled/native/src/free_energy.cpp +10 -0
  54. qupled-1.0.3/src/qupled/native/src/rpa.cpp → qupled-1.1.0/src/qupled/native/src/hf.cpp +51 -121
  55. qupled-1.1.0/src/qupled/native/src/iet.cpp +186 -0
  56. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/input.cpp +24 -170
  57. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/internal_energy.cpp +3 -3
  58. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/python_modules.cpp +80 -67
  59. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/python_wrappers.cpp +63 -45
  60. qupled-1.1.0/src/qupled/native/src/qstls.cpp +441 -0
  61. qupled-1.1.0/src/qupled/native/src/qstlsiet.cpp +354 -0
  62. qupled-1.0.3/src/qupled/native/src/qvs.cpp → qupled-1.1.0/src/qupled/native/src/qvsstls.cpp +38 -59
  63. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/rdf.cpp +5 -5
  64. qupled-1.1.0/src/qupled/native/src/rpa.cpp +139 -0
  65. qupled-1.1.0/src/qupled/native/src/stls.cpp +145 -0
  66. qupled-1.1.0/src/qupled/native/src/stlsiet.cpp +120 -0
  67. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/thermo_util.cpp +12 -7
  68. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/vsbase.cpp +4 -33
  69. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/vsstls.cpp +2 -32
  70. qupled-1.1.0/src/qupled/output.py +92 -0
  71. qupled-1.1.0/src/qupled/qstls.py +151 -0
  72. qupled-1.1.0/src/qupled/qstlsiet.py +42 -0
  73. qupled-1.1.0/src/qupled/qvsstls.py +73 -0
  74. qupled-1.1.0/src/qupled/rpa.py +27 -0
  75. qupled-1.1.0/src/qupled/stls.py +94 -0
  76. qupled-1.1.0/src/qupled/stlsiet.py +58 -0
  77. qupled-1.1.0/src/qupled/vsstls.py +203 -0
  78. {qupled-1.0.3 → qupled-1.1.0}/src/qupled.egg-info/PKG-INFO +11 -10
  79. {qupled-1.0.3 → qupled-1.1.0}/src/qupled.egg-info/SOURCES.txt +38 -29
  80. {qupled-1.0.3 → qupled-1.1.0}/src/qupled.egg-info/requires.txt +2 -2
  81. qupled-1.1.0/tests/native/conftest.py +11 -0
  82. {qupled-1.0.3/tests → qupled-1.1.0/tests/native}/test_esa_native.py +5 -8
  83. qupled-1.1.0/tests/native/test_hf_native.py +38 -0
  84. qupled-1.1.0/tests/native/test_qstls_iet_native.py +47 -0
  85. qupled-1.1.0/tests/native/test_qstls_native.py +46 -0
  86. qupled-1.1.0/tests/native/test_qvsstls_native.py +56 -0
  87. {qupled-1.0.3/tests → qupled-1.1.0/tests/native}/test_rpa_native.py +5 -8
  88. qupled-1.1.0/tests/native/test_stls_iet_native.py +36 -0
  89. qupled-1.1.0/tests/native/test_stls_native.py +42 -0
  90. {qupled-1.0.3/tests → qupled-1.1.0/tests/native}/test_vsstls_native.py +9 -17
  91. qupled-1.1.0/tests/test_database.py +673 -0
  92. qupled-1.1.0/tests/test_esa.py +27 -0
  93. qupled-1.1.0/tests/test_hf.py +217 -0
  94. qupled-1.1.0/tests/test_mpi.py +63 -0
  95. qupled-1.1.0/tests/test_output.py +39 -0
  96. qupled-1.1.0/tests/test_qstls.py +149 -0
  97. qupled-1.1.0/tests/test_qstlsiet.py +56 -0
  98. qupled-1.1.0/tests/test_qvsstls.py +66 -0
  99. qupled-1.1.0/tests/test_rpa.py +42 -0
  100. qupled-1.1.0/tests/test_stls.py +101 -0
  101. qupled-1.1.0/tests/test_stlsiet.py +45 -0
  102. qupled-1.1.0/tests/test_vsstls.py +201 -0
  103. {qupled-1.0.3 → qupled-1.1.0}/tox.ini +5 -1
  104. qupled-1.0.3/docs/contribute.rst +0 -34
  105. qupled-1.0.3/docs/qupled.rst +0 -533
  106. qupled-1.0.3/docs/requirements.txt +0 -4
  107. qupled-1.0.3/examples/docs/fixed_adr_qstls_iet.py +0 -27
  108. qupled-1.0.3/examples/docs/fixed_adr_qvsstls.py +0 -27
  109. qupled-1.0.3/examples/docs/initial_guess_qstls.py +0 -19
  110. qupled-1.0.3/examples/docs/initial_guess_qstls_iet.py +0 -20
  111. qupled-1.0.3/examples/docs/solve_rpa_and_esa.py +0 -49
  112. qupled-1.0.3/examples/docs/solve_stls.py +0 -28
  113. qupled-1.0.3/src/qupled/base.py +0 -268
  114. qupled-1.0.3/src/qupled/classic.py +0 -7
  115. qupled-1.0.3/src/qupled/esa.py +0 -41
  116. qupled-1.0.3/src/qupled/native/include/bin_util.hpp +0 -58
  117. qupled-1.0.3/src/qupled/native/include/esa.hpp +0 -59
  118. qupled-1.0.3/src/qupled/native/include/qstls.hpp +0 -389
  119. qupled-1.0.3/src/qupled/native/include/rpa.hpp +0 -291
  120. qupled-1.0.3/src/qupled/native/include/stls.hpp +0 -200
  121. qupled-1.0.3/src/qupled/native/src/CMakeLists.txt +0 -82
  122. qupled-1.0.3/src/qupled/native/src/free_energy.cpp +0 -10
  123. qupled-1.0.3/src/qupled/native/src/qstls.cpp +0 -818
  124. qupled-1.0.3/src/qupled/native/src/stls.cpp +0 -447
  125. qupled-1.0.3/src/qupled/qstls.py +0 -51
  126. qupled-1.0.3/src/qupled/qstlsiet.py +0 -107
  127. qupled-1.0.3/src/qupled/quantum.py +0 -5
  128. qupled-1.0.3/src/qupled/qvsstls.py +0 -109
  129. qupled-1.0.3/src/qupled/rpa.py +0 -72
  130. qupled-1.0.3/src/qupled/stls.py +0 -58
  131. qupled-1.0.3/src/qupled/stlsiet.py +0 -73
  132. qupled-1.0.3/src/qupled/util.py +0 -434
  133. qupled-1.0.3/src/qupled/vsstls.py +0 -103
  134. qupled-1.0.3/tests/test_esa.py +0 -29
  135. qupled-1.0.3/tests/test_hdf.py +0 -235
  136. qupled-1.0.3/tests/test_plot.py +0 -26
  137. qupled-1.0.3/tests/test_qstls.py +0 -83
  138. qupled-1.0.3/tests/test_qstls_iet.py +0 -142
  139. qupled-1.0.3/tests/test_qstls_input.py +0 -125
  140. qupled-1.0.3/tests/test_qstls_native.py +0 -88
  141. qupled-1.0.3/tests/test_qvs.py +0 -161
  142. qupled-1.0.3/tests/test_qvs_input.py +0 -177
  143. qupled-1.0.3/tests/test_qvs_native.py +0 -62
  144. qupled-1.0.3/tests/test_rpa.py +0 -110
  145. qupled-1.0.3/tests/test_rpa_input.py +0 -189
  146. qupled-1.0.3/tests/test_stls.py +0 -77
  147. qupled-1.0.3/tests/test_stls_iet.py +0 -65
  148. qupled-1.0.3/tests/test_stls_input.py +0 -153
  149. qupled-1.0.3/tests/test_stls_native.py +0 -90
  150. qupled-1.0.3/tests/test_vsstls.py +0 -86
  151. qupled-1.0.3/tests/test_vsstls_input.py +0 -163
  152. {qupled-1.0.3 → qupled-1.1.0}/.clang-format +0 -0
  153. {qupled-1.0.3 → qupled-1.1.0}/.github/workflows/build-and-test-base.yml +0 -0
  154. {qupled-1.0.3 → qupled-1.1.0}/.github/workflows/build-and-test.yml +0 -0
  155. {qupled-1.0.3 → qupled-1.1.0}/.github/workflows/formatting.yml +0 -0
  156. {qupled-1.0.3 → qupled-1.1.0}/.github/workflows/release.yml +0 -0
  157. {qupled-1.0.3 → qupled-1.1.0}/.readthedocs.yaml +0 -0
  158. {qupled-1.0.3 → qupled-1.1.0}/LICENSE +0 -0
  159. {qupled-1.0.3 → qupled-1.1.0}/MANIFEST.in +0 -0
  160. /qupled-1.0.3/dev/requirements.txt → /qupled-1.1.0/dev/requirements-pip.txt +0 -0
  161. {qupled-1.0.3 → qupled-1.1.0}/devtool +0 -0
  162. {qupled-1.0.3 → qupled-1.1.0}/docs/_static/css/rdt_theme_python_properties.css +0 -0
  163. {qupled-1.0.3 → qupled-1.1.0}/docs/index.rst +0 -0
  164. {qupled-1.0.3 → qupled-1.1.0}/docs/make.bat +0 -0
  165. {qupled-1.0.3 → qupled-1.1.0}/setup.cfg +0 -0
  166. {qupled-1.0.3 → qupled-1.1.0}/setup.py +0 -0
  167. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/__init__.py +0 -0
  168. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/chemical_potential.hpp +0 -0
  169. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/dual.hpp +0 -0
  170. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/mpi_util.hpp +0 -0
  171. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/numerics.hpp +0 -0
  172. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/python_util.hpp +0 -0
  173. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/thermo_util.hpp +0 -0
  174. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/vector2D.hpp +0 -0
  175. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/vector3D.hpp +0 -0
  176. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/include/vector_util.hpp +0 -0
  177. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/chemical_potential.cpp +0 -0
  178. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/logger.cpp +0 -0
  179. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/mpi_util.cpp +0 -0
  180. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/num_util.cpp +0 -0
  181. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/numerics.cpp +0 -0
  182. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/python_util.cpp +0 -0
  183. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/vector2D.cpp +0 -0
  184. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/vector3D.cpp +0 -0
  185. {qupled-1.0.3 → qupled-1.1.0}/src/qupled/native/src/vector_util.cpp +0 -0
  186. {qupled-1.0.3 → qupled-1.1.0}/src/qupled.egg-info/dependency_links.txt +0 -0
  187. {qupled-1.0.3 → qupled-1.1.0}/src/qupled.egg-info/not-zip-safe +0 -0
  188. {qupled-1.0.3 → 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
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "Development Container",
3
+ "build": {
4
+ "dockerfile": "Dockerfile",
5
+ "context": ".."
6
+ },
7
+ "customizations": {
8
+ "vscode": {
9
+ "settings": {},
10
+ "extensions": [
11
+ "ms-python.python",
12
+ "ms-python.vscode-pylance"
13
+ ]
14
+ }
15
+ }
16
+ }
@@ -1,11 +1,13 @@
1
- *~
2
- *#
3
- Makefile
4
- docs/_build
5
1
  *.DS_Store
6
- *__pycache__
2
+ *.db
7
3
  *.vscode
4
+ *#
5
+ *~
6
+ *__pycache__
7
+ .venv
8
8
  .tox
9
+ Makefile
9
10
  dist
10
11
  dist-native-only
12
+ docs/_build
11
13
  qupled.egg-info
@@ -1,19 +1,19 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: qupled
3
- Version: 1.0.3
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: pandas~=2.0
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
- from qupled.classic import Stls
49
- inputs = Stls.Input(10.0, 1.0)
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
- from qupled.classic import Stls
20
- inputs = Stls.Input(10.0, 1.0)
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(nompi, native_only):
8
+ def build(no_mpi, native_only):
9
9
  # Build without MPI
10
- if nompi:
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
- run_tox("test")
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", "install", "--force-reinstall", wheel_file], check=True)
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
- subprocess.run(["sudo", "apt-get", "update"], check=True)
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
- subprocess.run(["brew", "update"], check=True)
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
- "--nompi",
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.nompi, args.native_only)
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":
@@ -0,0 +1,10 @@
1
+ clang-format
2
+ cmake
3
+ libboost-all-dev
4
+ libopenmpi-dev
5
+ libgsl-dev
6
+ libomp-dev
7
+ libfmt-dev
8
+ python3-dev
9
+ libsqlite3-dev
10
+ libsqlitecpp-dev
@@ -0,0 +1,9 @@
1
+ brew "clang-format"
2
+ brew "cmake"
3
+ brew "gsl"
4
+ brew "libomp"
5
+ brew "open-mpi"
6
+ brew "fmt"
7
+ brew "boost-python3"
8
+ brew "sqlite"
9
+ brew "sqlitecpp"
@@ -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.
@@ -74,28 +74,14 @@ the pre-compute values of the free energy integrand.
74
74
  Define an initial guess
75
75
  -----------------------
76
76
 
77
- The following three examples show how to define an initial guess for the classical
78
- schemes (STLS and STLS-IET) and for the quantum schemes (QSTLS and QSTLS-IET). If
77
+ The following example shows how to define an initial guess for the STLS scheme. If
79
78
  an initial guess is not specified the code will use the default, namely zero static
80
- local field correction for the classical schemes and STLS static structure factor
81
- for the quantum schemes.
79
+ local field correction.
82
80
 
83
81
  .. literalinclude:: ../examples/docs/initial_guess_stls.py
84
82
  :language: python
85
83
 
86
- In the following example we solve the QSTLS scheme twice and the second time we
87
- specify the initial guess as the solution obtained from the first solution. Having
88
- provided a nearly exact initial guess the scheme converges in a single iteration.
89
-
90
- .. literalinclude:: ../examples/docs/initial_guess_qstls.py
91
- :language: python
92
-
93
- The QSTLS-IET scheme requires to specify an initial guess for the auxiliary density
94
- response and the number of matsubara frequencies corresponding to such initial guess.
95
- These specifications can be skipped in all other schemes.
96
-
97
- .. literalinclude:: ../examples/docs/initial_guess_qstls_iet.py
98
- :language: python
84
+ For other schemes the initial guess can be specified in a similar manner.
99
85
 
100
86
  Speed-up the quantum schemes
101
87
  ----------------------------
@@ -112,37 +98,13 @@ that can be employed to speed up the calculations:
112
98
 
113
99
  * *Pre-computation*: The calculations for the quantum schemes can be made significantly
114
100
  faster if part of the calculation of the auxiliary density response can be skipped.
115
- This can usually be done by passing in input the so-called 'fixed' component of the
116
- auxiliary density response. The fixed component of the auxiliary density response depends
117
- only on the degeneracy parameter and is printed to specific ouput files when a quantum
118
- scheme is solved. These output files can be used in successive calculations to avoid
119
- recomputing the fixed component and to speed-up the solution of the quantum schemes.
120
- The following two examples illustrate how this can be done for both the QSTLS and
121
- the QSTLS-IET schemes.
122
-
123
- For the QSTLS scheme it is sufficient to pass the name of binary file containing the fixed component.
124
- This allows to obtain identical results (compare the internal energies printed at the end of
125
- the example) in a fraction of the time. We can also recycle the same fixed component for
126
- different coupling parameters provided that the degeneracy parameter stays the same. On the
127
- other hand, when changing the degeneracy parameter the fixed component must also be updated
128
- otherwise the calculation fails as shown at the end of the example.
129
-
130
- .. literalinclude:: ../examples/docs/fixed_adr_qstls.py
131
- :language: python
132
-
133
- For the QSTLS-IET schemes we must pass the name of two files: the binary file with the
134
- fixed auxiliary density response from the QSTLS scheme and a zip file containing a collection
135
- of binary files representing the fixed component for the QSTLS-IET scheme. Here the fixed
136
- component depends only on the degeneracy parameter but not on the coupling
137
- parameter and not on the theory used for the bridge function.
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.
138
103
 
139
- .. literalinclude:: ../examples/docs/fixed_adr_qstls_iet.py
140
- :language: python
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.
141
108
 
142
- For the QVS-STLS scheme we must pass the name of one zip file containing the data for the
143
- fixed auxiliary density response. The same fixed component can be re-used for different
144
- coupling parameters provided that the degeneracy parameter and the degeneracy parameter
145
- resolution remain the same.
146
-
147
- .. literalinclude:: ../examples/docs/fixed_adr_qvsstls.py
148
- :language: python
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
  ~~~~~~~~~~~~~~~~