edrixs 0.1.2__tar.gz → 0.1.3__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 (110) hide show
  1. {edrixs-0.1.2 → edrixs-0.1.3}/PKG-INFO +11 -7
  2. {edrixs-0.1.2 → edrixs-0.1.3}/README.rst +7 -5
  3. {edrixs-0.1.2 → edrixs-0.1.3}/docs/Makefile +5 -1
  4. edrixs-0.1.3/docs/source/user/installation.rst +97 -0
  5. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/usedocker.rst +4 -2
  6. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/tests/test_utils.py +36 -34
  7. edrixs-0.1.3/edrixs/tests/test_wannier_ham.py +21 -0
  8. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/utils.py +79 -101
  9. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/wannier_ham.py +1 -1
  10. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs.egg-info/PKG-INFO +11 -7
  11. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs.egg-info/SOURCES.txt +1 -0
  12. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs.egg-info/requires.txt +1 -1
  13. {edrixs-0.1.2 → edrixs-0.1.3}/pyproject.toml +1 -1
  14. {edrixs-0.1.2 → edrixs-0.1.3}/requirements.txt +1 -1
  15. {edrixs-0.1.2 → edrixs-0.1.3}/setup.py +18 -0
  16. edrixs-0.1.2/docs/source/user/installation.rst +0 -182
  17. {edrixs-0.1.2 → edrixs-0.1.3}/AUTHORS.rst +0 -0
  18. {edrixs-0.1.2 → edrixs-0.1.3}/CONTRIBUTING.rst +0 -0
  19. {edrixs-0.1.2 → edrixs-0.1.3}/LICENSE +0 -0
  20. {edrixs-0.1.2 → edrixs-0.1.3}/MANIFEST.in +0 -0
  21. {edrixs-0.1.2 → edrixs-0.1.3}/docs/make.bat +0 -0
  22. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/conf.py +0 -0
  23. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/index.rst +0 -0
  24. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/angular_momentum.rst +0 -0
  25. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/basis_transform.rst +0 -0
  26. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/coulomb_utensor.rst +0 -0
  27. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/fit_hyb.rst +0 -0
  28. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/fock_basis.rst +0 -0
  29. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/index.rst +0 -0
  30. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/iostream.rst +0 -0
  31. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/manybody_operator.rst +0 -0
  32. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/photon_transition.rst +0 -0
  33. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/plot_spectrum.rst +0 -0
  34. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/rixs_utils.rst +0 -0
  35. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/soc.rst +0 -0
  36. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/solvers.rst +0 -0
  37. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/utils.rst +0 -0
  38. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/reference/wannier_ham.rst +0 -0
  39. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/release-history.rst +0 -0
  40. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/basics.ed.rst +0 -0
  41. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/basics.rixs.rst +0 -0
  42. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/basics.rst +0 -0
  43. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/basics.xas.rst +0 -0
  44. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/devcontainer.rst +0 -0
  45. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/examples.rst +0 -0
  46. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/index.rst +0 -0
  47. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/papers.rst +0 -0
  48. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/pythontips.rst +0 -0
  49. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/quickstart.rst +0 -0
  50. {edrixs-0.1.2 → edrixs-0.1.3}/docs/source/user/whatisedrixs.rst +0 -0
  51. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/__init__.py +0 -0
  52. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/_version.py +0 -0
  53. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/angular_momentum.py +0 -0
  54. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Co.json +0 -0
  55. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Cr.json +0 -0
  56. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Cu.json +0 -0
  57. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Fe.json +0 -0
  58. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Ir.json +0 -0
  59. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Mn.json +0 -0
  60. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Ni.json +0 -0
  61. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Os.json +0 -0
  62. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Pu.json +0 -0
  63. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Re.json +0 -0
  64. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Sm.json +0 -0
  65. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/Ti.json +0 -0
  66. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/U.json +0 -0
  67. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/atom_data/V.json +0 -0
  68. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/basis_transform.py +0 -0
  69. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/coulomb_utensor.py +0 -0
  70. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/fit_hyb.py +0 -0
  71. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/fock_basis.py +0 -0
  72. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/iostream.py +0 -0
  73. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/manybody_operator.py +0 -0
  74. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/photon_transition.py +0 -0
  75. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/plot_spectrum.py +0 -0
  76. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/rixs_utils.py +0 -0
  77. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/scripts.py +0 -0
  78. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/soc.py +0 -0
  79. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/solvers.py +0 -0
  80. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/tests/__init__.py +0 -0
  81. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/tests/conftest.py +0 -0
  82. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/tests/test_examples.py +0 -0
  83. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs/tests/test_fortran.py +0 -0
  84. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs.egg-info/dependency_links.txt +0 -0
  85. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs.egg-info/entry_points.txt +0 -0
  86. {edrixs-0.1.2 → edrixs-0.1.3}/edrixs.egg-info/top_level.txt +0 -0
  87. {edrixs-0.1.2 → edrixs-0.1.3}/setup.cfg +0 -0
  88. {edrixs-0.1.2 → edrixs-0.1.3}/src/arpack.f90 +0 -0
  89. {edrixs-0.1.2 → edrixs-0.1.3}/src/ed_driver.f90 +0 -0
  90. {edrixs-0.1.2 → edrixs-0.1.3}/src/ed_main.f90 +0 -0
  91. {edrixs-0.1.2 → edrixs-0.1.3}/src/fock.f90 +0 -0
  92. {edrixs-0.1.2 → edrixs-0.1.3}/src/full_diag.f90 +0 -0
  93. {edrixs-0.1.2 → edrixs-0.1.3}/src/ham.f90 +0 -0
  94. {edrixs-0.1.2 → edrixs-0.1.3}/src/io.f90 +0 -0
  95. {edrixs-0.1.2 → edrixs-0.1.3}/src/lanczos.f90 +0 -0
  96. {edrixs-0.1.2 → edrixs-0.1.3}/src/linsys.f90 +0 -0
  97. {edrixs-0.1.2 → edrixs-0.1.3}/src/m_constants.f90 +0 -0
  98. {edrixs-0.1.2 → edrixs-0.1.3}/src/m_control.f90 +0 -0
  99. {edrixs-0.1.2 → edrixs-0.1.3}/src/m_global.f90 +0 -0
  100. {edrixs-0.1.2 → edrixs-0.1.3}/src/m_types.f90 +0 -0
  101. {edrixs-0.1.2 → edrixs-0.1.3}/src/opavg_driver.f90 +0 -0
  102. {edrixs-0.1.2 → edrixs-0.1.3}/src/opavg_main.f90 +0 -0
  103. {edrixs-0.1.2 → edrixs-0.1.3}/src/pyapi.f90 +0 -0
  104. {edrixs-0.1.2 → edrixs-0.1.3}/src/rixs_driver.f90 +0 -0
  105. {edrixs-0.1.2 → edrixs-0.1.3}/src/rixs_main.f90 +0 -0
  106. {edrixs-0.1.2 → edrixs-0.1.3}/src/spmv.f90 +0 -0
  107. {edrixs-0.1.2 → edrixs-0.1.3}/src/utils.f90 +0 -0
  108. {edrixs-0.1.2 → edrixs-0.1.3}/src/xas_driver.f90 +0 -0
  109. {edrixs-0.1.2 → edrixs-0.1.3}/src/xas_main.f90 +0 -0
  110. {edrixs-0.1.2 → edrixs-0.1.3}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edrixs
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: An open source toolkit for simulating RIXS spectra based on ED
5
5
  Home-page: https://github.com/NSLS-II/edrixs
6
6
  Author: Brookhaven National Lab
@@ -10,9 +10,10 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
10
10
  Classifier: Development Status :: 2 - Pre-Alpha
11
11
  Classifier: Natural Language :: English
12
12
  Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.10
13
14
  License-File: LICENSE
14
15
  License-File: AUTHORS.rst
15
- Requires-Dist: numpy<2
16
+ Requires-Dist: numpy>=1.26
16
17
  Requires-Dist: scipy
17
18
  Requires-Dist: sympy
18
19
  Requires-Dist: matplotlib
@@ -26,6 +27,7 @@ Dynamic: home-page
26
27
  Dynamic: license
27
28
  Dynamic: license-file
28
29
  Dynamic: requires-dist
30
+ Dynamic: requires-python
29
31
  Dynamic: summary
30
32
 
31
33
  ===============================
@@ -64,12 +66,14 @@ If you are using the EDRIXS code to do some studies and would like to publish yo
64
66
 
65
67
  Usage
66
68
  -----
67
- For Linux users we suggest installing with anaconda.
69
+ For Linux and macOS, we recommend installing the released edrixs package with
70
+ Mamba in a separate environment:
68
71
 
69
72
  .. code-block:: bash
70
73
 
71
- $ conda create --name edrixs_env python=3.10
72
- $ conda activate edrixs_env
73
- $ conda install -c conda-forge edrixs
74
+ mamba create --name edrixs_env -c conda-forge --strict-channel-priority \
75
+ edrixs matplotlib
76
+ conda activate edrixs_env
74
77
 
75
- For Windows and macOS machines, we suggest using docker. See https://edrixs.github.io/edrixs for more details.
78
+ For Windows, we recommend Docker. See https://edrixs.github.io/edrixs for the
79
+ complete installation, verification, requirements, and Docker instructions.
@@ -34,12 +34,14 @@ If you are using the EDRIXS code to do some studies and would like to publish yo
34
34
 
35
35
  Usage
36
36
  -----
37
- For Linux users we suggest installing with anaconda.
37
+ For Linux and macOS, we recommend installing the released edrixs package with
38
+ Mamba in a separate environment:
38
39
 
39
40
  .. code-block:: bash
40
41
 
41
- $ conda create --name edrixs_env python=3.10
42
- $ conda activate edrixs_env
43
- $ conda install -c conda-forge edrixs
42
+ mamba create --name edrixs_env -c conda-forge --strict-channel-priority \
43
+ edrixs matplotlib
44
+ conda activate edrixs_env
44
45
 
45
- For Windows and macOS machines, we suggest using docker. See https://edrixs.github.io/edrixs for more details.
46
+ For Windows, we recommend Docker. See https://edrixs.github.io/edrixs for the
47
+ complete installation, verification, requirements, and Docker instructions.
@@ -12,7 +12,11 @@ BUILDDIR = build
12
12
  help:
13
13
  @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
14
 
15
- .PHONY: help Makefile
15
+ .PHONY: help clean Makefile
16
+
17
+ clean:
18
+ @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
19
+ rm -rf "$(SOURCEDIR)/auto_examples"
16
20
 
17
21
  # Catch-all target: route all unknown targets to Sphinx using the new
18
22
  # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
@@ -0,0 +1,97 @@
1
+ ************
2
+ Installation
3
+ ************
4
+ For Linux and macOS, we recommend installation via Mamba. Windows users should use the :ref:`Docker instructions
5
+ <edrixsanddocker>`.
6
+
7
+
8
+ .. _AnacondaInstall:
9
+
10
+ Install the released package with Mamba on Linux and macOS
11
+ ==========================================================
12
+
13
+ A prebuilt conda package is available for Linux and macOS. First install `Miniforge
14
+ <https://github.com/conda-forge/miniforge>`_, which provides Conda and Mamba,
15
+ then create a separate environment for edrixs::
16
+
17
+ mamba create --name edrixs_env -c conda-forge --strict-channel-priority \
18
+ edrixs matplotlib
19
+ conda activate edrixs_env
20
+
21
+ edrixs will also run on `Google Colaboratory
22
+ <https://research.google.com/colaboratory/>`_, but is not installed there by
23
+ default. Install Conda and then edrixs from within a notebook cell::
24
+
25
+ !pip install -q condacolab
26
+ import condacolab
27
+ condacolab.install()
28
+ !conda install -c conda-forge edrixs
29
+
30
+ .. _MacOSInstall:
31
+ .. _SourceInstall:
32
+
33
+ Build the current source with Mamba on Linux or macOS
34
+ =====================================================
35
+
36
+ This is the recommended way to build the current source on Linux and macOS.
37
+ The same environment provides Python, OpenMPI, OpenBLAS, parallel ARPACK, and
38
+ gfortran, preventing incompatible system and conda libraries from being mixed.
39
+ On macOS, in particular, do not mix this environment with Homebrew or MacPorts
40
+ versions of these libraries, as that can cause linker or OpenMP runtime errors.
41
+
42
+ Install `Miniforge <https://github.com/conda-forge/miniforge>`_, then create
43
+ and activate the build environment::
44
+
45
+ mamba create --name edrixs_env -c conda-forge --strict-channel-priority \
46
+ python=3.14 "numpy>=2" scipy sympy matplotlib sphinx mpi4py \
47
+ "arpack=*=mpi_openmpi*" openmpi gfortran \
48
+ "libblas=*=*openblas" cmake ninja pip setuptools wheel
49
+ conda activate edrixs_env
50
+
51
+ Clone and install edrixs from the repository root::
52
+
53
+ git clone https://github.com/EDRIXS/edrixs.git
54
+ cd edrixs
55
+ python -m pip install --no-build-isolation --no-deps .
56
+
57
+ The ``--no-build-isolation`` option makes the extension use NumPy and the
58
+ compiler toolchain from the activated environment. The ``--no-deps`` option
59
+ prevents pip from replacing the compatible conda packages installed above.
60
+
61
+ Run these checks from outside the source directory so that Python imports the
62
+ installed package::
63
+
64
+ cd ..
65
+ python -c "from edrixs import fedrixs; print(fedrixs.__file__)"
66
+ mpirun -np 2 python -c "from mpi4py import MPI; from edrixs import fedrixs; print(MPI.COMM_WORLD.rank)"
67
+
68
+ The first command should print the path to a file ending in ``.so``. The
69
+ second should print ranks ``0`` and ``1``. On macOS, the linker may print
70
+ harmless ``compact unwind`` warnings while compiling the gfortran objects.
71
+
72
+ Requirements
73
+ ============
74
+ The Mamba command above installs compatible versions of all build and runtime
75
+ requirements. The supported versions and required components are:
76
+
77
+ * Python 3.10 or newer; Python 3.14 is used in the recommended environment
78
+ * NumPy 1.26 or newer at runtime; NumPy 2 or newer is used to build the
79
+ extension for compatibility with both NumPy 1.26 and 2.x
80
+ * SciPy, SymPy, Matplotlib, Sphinx, and numpydoc
81
+ * CMake 3.17.3 or newer and Ninja
82
+ * A Fortran compiler; the recommended environment currently uses gfortran
83
+ 16
84
+ * An MPI environment with Fortran and C compilers; OpenMPI 5 and its
85
+ ``mpif90`` and ``mpicc`` wrappers are used in the recommended environment
86
+ * mpi4py 4 or newer, built with the same MPI implementation used to build
87
+ edrixs
88
+ * BLAS and LAPACK; OpenBLAS 0.3 is used in the recommended environment
89
+ * `ARPACK-NG <https://github.com/opencollab/arpack-ng/>`_ 3.9 or newer,
90
+ built with MPI support
91
+
92
+ Install with Docker on Windows
93
+ ==============================
94
+
95
+ For Windows, we recommend using the maintained edrixs Docker image instead of
96
+ building the Fortran extension natively. See :ref:`edrixsanddocker` for the
97
+ image, Docker Compose configuration, and usage instructions.
@@ -7,7 +7,9 @@ edrixs and docker
7
7
  Run edrixs in a docker container
8
8
  --------------------------------
9
9
 
10
- To make life easier, we have built a docker image based on Ubuntu Linux (22.04) for edrixs, so you don't need to struggle with the installation anymore.
10
+ To make life easier, we have built a Docker image based on Ubuntu Linux 24.04
11
+ for edrixs, so you do not need to install its compiler toolchain yourself.
12
+ The image is published for both AMD64 and ARM64 systems.
11
13
  The docker image can be used on any OS as long as the `docker <https://www.docker.com/>`_ application is available.
12
14
  Follow these steps to use the docker image:
13
15
 
@@ -34,7 +36,7 @@ Follow these steps to use the docker image:
34
36
 
35
37
  docker compose up
36
38
 
37
- This will return a url, which you can open to connect to the jupyter session.
39
+ This will return a URL, which you can open to connect to the Jupyter session.
38
40
 
39
41
  * If you would like to access a terminal rather than jupyter run ::
40
42
 
@@ -3,42 +3,47 @@ import edrixs
3
3
 
4
4
 
5
5
  def test_CT_imp_bath():
6
- n, Delta, E_L, E_d, U_dd = sympy.symbols('n \\Delta, E_L, E_d, U_{dd}')
6
+ """CT_imp_bath solves for impurity (E_d) and bath (E_L) energies with no
7
+ core hole, using two conditions:
8
+ 1. E(d^{n+1} L^9) - E(d^n L^10) = Delta (charge-transfer energy)
9
+ 2. E(d^n L^10) = 0 (reference state)
10
+ The expected closed-form values are verified against the function output.
11
+ """
12
+ n = 8
13
+ Delta = 3
14
+ U_dd = 2
7
15
 
8
- Eq1 = sympy.Eq(10*E_L + n*E_d + n*(n - 1)*U_dd/2, rhs=0)
9
- Eq2 = sympy.Eq(9*E_L + (n+1)*E_d + (n + 1)*n*U_dd/2, rhs=Delta)
10
- Eq3 = sympy.Eq(8*E_L + (n+2)*E_d + (n + 1)*(n + 2)*U_dd/2, rhs=2*Delta + U_dd)
16
+ E_d_val = (10*Delta - n*(19 + n)*U_dd/2)/(10 + n)
17
+ E_L_val = n*((1 + n)*U_dd/2-Delta)/(10 + n)
11
18
 
12
- # from IPython.display import display
13
- # display(Eq1, Eq2, Eq3)
14
-
15
- answers = sympy.solve([Eq1, Eq2, Eq3], [E_d, E_L])
16
-
17
- E_d_eq = sympy.Eq(E_d, rhs=answers[E_d])
18
- E_L_eq = sympy.Eq(E_L, rhs=answers[E_L])
19
-
20
- # from IPython.display import display
21
- # display(E_d_eq, E_L_eq)
22
-
23
- n_val = 8
24
- Delta_val = 3
25
- U_dd_val = 2
26
-
27
- E_d_val = E_d_eq.rhs.evalf(subs={n: n_val,
28
- Delta: Delta_val,
29
- U_dd: U_dd_val})
30
-
31
- E_L_val = E_L_eq.rhs.evalf(subs={n: n_val,
32
- Delta: Delta_val,
33
- U_dd: U_dd_val})
34
-
35
- E_d_cal, E_L_cal = edrixs.CT_imp_bath(U_dd_val, Delta_val, n_val)
19
+ E_d_cal, E_L_cal = edrixs.CT_imp_bath(U_dd, Delta, n)
36
20
 
37
21
  assert E_d_val == E_d_cal
38
22
  assert E_L_val == E_L_cal
39
23
 
40
24
 
41
25
  def test_CT_imp_bath_core_hole():
26
+ """CT_imp_bath_core_hole solves for E_dc, E_Lc, E_p with a core hole
27
+ present, using three conditions:
28
+ 1. E(d^n L^10 p^6) = 0 (reference: full core, no ligand holes)
29
+ 2. E(d^{n+1} L^10 p^5) = 0 (reference: one core hole)
30
+ 3. E(d^{n+1} L^9 p^6) - E(d^n L^10 p^6) = Delta (same Delta as no-core)
31
+
32
+ The test constructs six independent transition-energy equations
33
+ symbolically (all d^n/d^{n+1}/d^{n+2} transitions for np=5 and np=6),
34
+ solves them as an overdetermined system, evaluates numerically, and
35
+ compares against the function.
36
+
37
+ With np=6 (full core):
38
+ Eq1: E(d^n L^10) = 0
39
+ Eq2: E(d^{n+1} L^9) = Delta
40
+ Eq3: E(d^{n+2} L^8) = 2*Delta + U_dd
41
+
42
+ With np=5 (one core hole):
43
+ Eq4: E(d^{n+1} L^10) = 0
44
+ Eq5: E(d^{n+2} L^9) = Delta + U_dd - U_pd
45
+ Eq6: E(d^{n+3} L^8) = 2*Delta + 3*U_dd - 2*U_pd
46
+ """
42
47
  n, Delta, E_Lc, E_dc, E_p, U_dd, U_pd = (
43
48
  sympy.symbols('n \\Delta E_{Lc} E_{dc} E_p U_{dd} U_{pd}'))
44
49
 
@@ -61,18 +66,12 @@ def test_CT_imp_bath_core_hole():
61
66
  5*E_p + 8*E_Lc + (n + 3)*E_dc + (n + 3)*(n + 2)*U_dd/2 + 5*(n + 3)*U_pd,
62
67
  rhs=2*Delta + 3*U_dd - 2*U_pd)
63
68
 
64
- # from IPython.display import display
65
- # display(Eq1, Eq2, Eq3, Eq4, Eq5, Eq6)
66
-
67
69
  answer = sympy.solve([Eq1, Eq2, Eq3, Eq4, Eq5, Eq6], [E_dc, E_Lc, E_p])
68
70
 
69
71
  E_dc_eq = sympy.Eq(E_dc, rhs=answer[E_dc])
70
72
  E_Lc_eq = sympy.Eq(E_dc, rhs=answer[E_Lc])
71
73
  E_p_eq = sympy.Eq(E_p, rhs=answer[E_p])
72
74
 
73
- # from IPython.display import display
74
- # display(E_dc_eq, E_Lc_eq, E_p_eq)
75
-
76
75
  n_val = 8
77
76
  Delta_val = 3
78
77
  U_dd_val = 2
@@ -95,6 +94,9 @@ def test_CT_imp_bath_core_hole():
95
94
 
96
95
 
97
96
  def test_get_atom_data():
97
+ """get_atom_data returns Hartree-Fock Slater integrals and SOC parameters
98
+ from the edrixs atomic database. Spot-checks F0, F2, F4 for Ni d^8.
99
+ """
98
100
  res = edrixs.get_atom_data('Ni', v_name='3d', v_noccu=8)
99
101
  slater_i = res['slater_i']
100
102
  assert slater_i[0][0] == 'F0_11'
@@ -0,0 +1,21 @@
1
+ import numpy as np
2
+
3
+ from edrixs.wannier_ham import HR
4
+
5
+
6
+ def test_hr_from_file(tmp_path):
7
+ wannier_file = tmp_path / "wannier90_hr.dat"
8
+ wannier_file.write_text(
9
+ "Generated for testing\n"
10
+ "1\n"
11
+ "1\n"
12
+ "1\n"
13
+ "0 0 0 1 1 2.0 -0.5\n"
14
+ )
15
+
16
+ result = HR.from_file(wannier_file)
17
+
18
+ assert result.nwann == 1
19
+ assert result.nrpt == 1
20
+ np.testing.assert_array_equal(result.deg_rpt, [1])
21
+ np.testing.assert_allclose(result.hr[0, 0, 0], 2.0 - 0.5j)
@@ -8,6 +8,7 @@ __all__ = ['beta_to_kelvin', 'kelvin_to_beta', 'boltz_dist', 'UJ_to_UdJH',
8
8
  import numpy as np
9
9
  import json
10
10
  from importlib.resources import files
11
+ from sympy import symbols, solve
11
12
 
12
13
 
13
14
  def beta_to_kelvin(beta):
@@ -276,6 +277,36 @@ def F0F2F4F6_to_UdJH(F0, F2, F4, F6):
276
277
  return Ud, JH
277
278
 
278
279
 
280
+ def _master_energy_level_eq():
281
+ """Define master equation relating Coulomb interactions, Delta,
282
+ and energy levels.
283
+
284
+ Notes
285
+ -----
286
+ We label the d-electrons $d$, ligand electrons $L$, and the core electrons $p$.
287
+
288
+ Electron count variables: $n_d$, $n_L$, $n_p$
289
+
290
+ Site energy: $E_d$, $E_L$, $E_p$
291
+
292
+ Coulomb energy between $d$ electrons: $U_{dd}$
293
+
294
+ Core hole potential $d$ electrons: $U_{dp}$
295
+
296
+ $n$ is the reference number of electrons. e.g. $n=8$ for NiO.
297
+
298
+ Note that we will ignore Coulomb interactions in the ligand levels and intra-core hole repulsion.
299
+ """
300
+ n, n_d, n_L, n_p = symbols('n, n_d, n_L, n_p')
301
+ E_d, E_L, E_p = symbols('E_d, E_L, E_p')
302
+ U_dd, U_dp = symbols('U_dd, U_dp')
303
+
304
+ master = (E_d*n_d + E_L*n_L + E_p*n_p
305
+ + n_d*(n_d - 1)*U_dd/2
306
+ + n_d*n_p*U_dp)
307
+ return master
308
+
309
+
279
310
  def CT_imp_bath(U_dd, Delta, n):
280
311
  """
281
312
  Compute energies of the impurity and bath for an
@@ -303,51 +334,23 @@ def CT_imp_bath(U_dd, Delta, n):
303
334
 
304
335
  Notes
305
336
  -----
306
- We credit our approach to Maurits Hakverkort,
307
- Heidelberg University.
308
- We define the state with a full set of bath orbitals to be zero
309
- energy and write the energy levels using the same definitions
310
- as [1]_ [2]_ [3]_.
311
-
312
- * :math:`d^{n}L^{10}` has energy :math:`0`
313
-
314
- * :math:`d^{n+1}L^9` has energy :math:`\\Delta`
315
-
316
- * :math:`d^{n+2}L^8` has energy :math:`2\\Delta + U_{dd}`
317
-
318
- Using this we can write and solve three linear equations to get
319
- :math:`E_d` and :math:`E_L` the energies of the impurity and bath.
320
-
321
- .. math::
322
- \\begin{aligned}
323
- 10 E_L + n E_d + n(n-1) \\frac{U_{dd}}{2} &= 0 \\\\
324
- 9 E_L + (n+1) E_d + (n+1)n \\frac{U_{dd}}{2} &= \\Delta \\\\
325
- 8 E_L + (n+2) E_d + (n+1)(n+2) \\frac{U_{dd}}{2}
326
- &= 2\\Delta + U_{dd}
327
- \\end{aligned}
337
+ We emit core electrons for initial state calculation which is done
338
+ by setting $n_p=0$. It is crucial to properly set the energy
339
+ splitting of $E_d$ and $E_L$ as defined by $\\Delta$.
340
+ The initial state energy is ill-defined to within an additive factor,
341
+ so we arbitrarily set the energy with no ligand holes to zero.
342
+ From there, obtain energies by solving the relevant linear equations.
343
+ """
344
+ master = _master_energy_level_eq()
345
+ E_d, E_L = symbols('E_d E_L')
346
+ master_no_core = master.subs({'n_p': 0})
347
+ cond0 = (master_no_core.subs({'n_d': n + 1, 'n_L': 10 - 1})
348
+ - master_no_core.subs({'n_d': n, 'n_L': 10}) - Delta)
349
+ cond1 = master_no_core.subs({'n_d': n, 'n_L': 10})
328
350
 
329
- The solutions are:
351
+ S = solve([cond0, cond1], [E_d, E_L])
330
352
 
331
- .. math::
332
- \\begin{aligned}
333
- E_d &=
334
- \\frac{10 \\Delta - n (19 + n) U_{dd}/2}{10 + n} \\\\
335
- E_L &=
336
- \\frac{n ((1+n) U_{dd}/2-\\Delta)}{10 + n}
337
- \\end{aligned}.
338
-
339
- References
340
- ----------
341
- .. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen
342
- `Phys. Rev. Lett. 55, 418 (1985) <https://doi.org/10.1103/PhysRevLett.55.418>`_
343
- .. [2] Maurits Haverkort et al.,
344
- `Phys. Rev. B 85, 165113 (2012) <https://doi.org/10.1103/PhysRevB.85.165113>`_
345
- .. [3] A. E. Bocquet et al.,
346
- `Phys. Rev. B 53, 1161 (1996) <https://doi.org/10.1103/PhysRevB.53.1161>`_
347
- """
348
- E_d = (10*Delta - n*(19 + n)*U_dd/2)/(10 + n)
349
- E_L = n*((1 + n)*U_dd/2-Delta)/(10 + n)
350
- return E_d, E_L
353
+ return float(S[E_d].subs({'U_dd': U_dd})), float(S[E_L].subs({'U_dd': U_dd}))
351
354
 
352
355
 
353
356
  def CT_imp_bath_core_hole(U_dd, U_pd, Delta, n):
@@ -355,10 +358,7 @@ def CT_imp_bath_core_hole(U_dd, U_pd, Delta, n):
355
358
  Compute energies of the impurity and bath for an
356
359
  Anderson impurity or charge-transfer model
357
360
  appropriate for a :math:`d`-shell transition metal compound
358
- with a core hole. Take note that this involves a
359
- re-definition of :math:`\\Delta` compared to the
360
- :code:`CT_imp_bath` function, which leaves out
361
- core hole effects.
361
+ with a core hole.
362
362
 
363
363
  Parameters
364
364
  ----------
@@ -384,60 +384,38 @@ def CT_imp_bath_core_hole(U_dd, U_pd, Delta, n):
384
384
 
385
385
  Notes
386
386
  -----
387
- We credit our approach to Maurits Hakverkort,
388
- Heidelberg University.
389
- We define the state with a full set of bath orbitals to be zero
390
- energy and write the energy levels using the same definitions as
391
- [1]_ [2]_ [3]_.
392
-
393
- * :math:`2p^5 d^{n}L^{10}` has energy :math:`0`
394
-
395
- * :math:`2p^5 d^{n+1}L^9` has energy :math:`\\Delta + U_{dd} - U_{pd}`
396
-
397
- * :math:`2p^5 d^{n+2}L^8` has energy :math:`2\\Delta + 3 U_{dd} - 2 U_{pd}`
398
-
399
- Using this we can write and solve linear equations to get
400
- :math:`E_{dc}`, :math:`E_{Lc}` and :math:`E_p` the energies of the
401
- impurity and bath with a core hole and the energy of the core hole.
402
-
403
- .. math::
404
- \\begin{aligned}
405
- 6 E_p + 10 E_{Lc} + n E_{dc} + n(n-1) \\frac{U_{dd}}{2}
406
- + 6 n U_{pd} &= 0 \\\\
407
- 6 E_p + 9 E_{Lc} + (n+1) E_{dc} + (n+1)n \\frac{U_{dd}}{2}
408
- + 6 (n+1) U_{pd} &= \\Delta \\\\
409
- 6 E_p + 8 E_{Lc} + (n+2) E_{d} + (n+1)(n+2) \\frac{U_{dd}}{2}
410
- + 6 (n+2) U_{pd} &= 2 \\Delta+U_{dd} \\\\
411
- 5 E_p + 10 E_{Lc} + (n+1) E_{d} + (n+1) n \\frac{U_{dd}}{2}
412
- + 5 (n+1) U_{pd} &= 0 \\\\
413
- 5 E_p + 9 E_{Lc} + (n+2) E_{dc} + (n+2)(n+1) \\frac{U_{dd}}{2}
414
- + 5 (n+2) U_{pd} &= \\Delta+U_{dd}-U_{pd} \\\\
415
- 5 E_p + 8 E_{Lc} + (n+3) E_{dc} + (n+3)(n+2) \\frac{U_{dd}}{2}
416
- + 5 (n+3) U_{pd} &= 2 \\Delta+3 U_{dd}-2 U_{pd}
417
- \\end{aligned}
418
-
419
- The solutions are:
420
-
421
- .. math::
422
- \\begin{aligned}
423
- E_{dc} &= \\frac{10 \\Delta - n (31+n) \\frac{U_{dd}}{2}-90 U_{pd}}{16+n} \\\\
424
- E_{Lc} &= \\frac{(1+n) (n \\frac{U_{dd}}{2}+6*U_{pd})-(6+n) \\Delta}{16+n} \\\\
425
- E_p &= \\frac{10 \\Delta + (1+n)(n\\frac{U_{dd}}{2}-(10+n)*U_{pd}}{16+n}
426
- \\end{aligned}
427
-
428
- References
429
- ----------
430
- .. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen
431
- `Phys. Rev. Lett. 55, 418 (1985) <https://doi.org/10.1103/PhysRevLett.55.418>`_
432
- .. [2] Maurits Haverkort et al.,
433
- `Phys. Rev. B 85, 165113 (2012) <https://doi.org/10.1103/PhysRevB.85.165113>`_
434
- .. [3] A. E. Bocquet et al.,
435
- `Phys. Rev. B 53, 1161 (1996) <https://doi.org/10.1103/PhysRevB.53.1161>`_
436
- """
437
- E_dc = (10*Delta - n*(31 + n)*U_dd/2 - 90*U_pd) / (16 + n)
438
- E_Lc = ((1 + n)*(n*U_dd/2 + 6*U_pd) - (6 + n)*Delta) / (16 + n)
439
- E_p = (10*Delta + (1 + n)*(n*U_dd/2 - (10 + n)*U_pd)) / (16 + n)
440
- return E_dc, E_Lc, E_p
387
+ For the XAS states, we need to introduce core states into
388
+ the Hamiltonian and account for their presence when setting
389
+ energies. It is crucial to define the charge transfer energy
390
+ in the same way as the intial states, as this affects the way
391
+ the d and ligand states interact. We do this by imposing the
392
+ same condition as before just accounting for the presence of
393
+ core electrons.
394
+
395
+ We now have two arbitrary choices. The overall energy is
396
+ ill-defined to within an additive factor. Since the core states
397
+ are not hybridized, we can also set those to whatever energy
398
+ we like (eventually, the core energy will be shifted to match
399
+ the experiment). Arbitrarily, we pick the same condition as
400
+ before with $d^n$ no core hole as zero, and we also set the
401
+ core state energy to make $d^{n+1}$ one core hole zero energy.
402
+ The relevant energies can be obtained by solving the resulting
403
+ linear equations.
404
+ """
405
+ master = _master_energy_level_eq()
406
+ E_d, E_L, E_p = symbols('E_d E_L E_p')
407
+
408
+ cond0 = (master.subs({'n_d': n + 1, 'n_L': 10 - 1, 'n_p': 6})
409
+ - master.subs({'n_d': n, 'n_L': 10, 'n_p': 6}) - Delta)
410
+ cond1 = master.subs({'n_d': n, 'n_L': 10, 'n_p': 6})
411
+ cond2 = master.subs({'n_d': n + 1, 'n_L': 10, 'n_p': 5})
412
+
413
+ S = solve([cond0, cond1, cond2], [E_d, E_L, E_p])
414
+
415
+ E_dc = float(S[E_d].subs({'U_dd': U_dd, 'U_dp': U_pd}))
416
+ E_Lc = float(S[E_L].subs({'U_dd': U_dd, 'U_dp': U_pd}))
417
+ E_p_val = float(S[E_p].subs({'U_dd': U_dd, 'U_dp': U_pd}))
418
+ return E_dc, E_Lc, E_p_val
441
419
 
442
420
 
443
421
  def info_atomic_shell():
@@ -57,7 +57,7 @@ class HR():
57
57
  tmp = []
58
58
  for i in range(nline):
59
59
  tmp.extend(f.readline().strip().split())
60
- tmp = [np.int(item) for item in tmp]
60
+ tmp = [int(item) for item in tmp]
61
61
  deg_rpt = np.array(tmp, dtype=int)
62
62
  # read hr for each r-point
63
63
  rpts = np.zeros((nrpt, 3), dtype=int)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edrixs
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: An open source toolkit for simulating RIXS spectra based on ED
5
5
  Home-page: https://github.com/NSLS-II/edrixs
6
6
  Author: Brookhaven National Lab
@@ -10,9 +10,10 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
10
10
  Classifier: Development Status :: 2 - Pre-Alpha
11
11
  Classifier: Natural Language :: English
12
12
  Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.10
13
14
  License-File: LICENSE
14
15
  License-File: AUTHORS.rst
15
- Requires-Dist: numpy<2
16
+ Requires-Dist: numpy>=1.26
16
17
  Requires-Dist: scipy
17
18
  Requires-Dist: sympy
18
19
  Requires-Dist: matplotlib
@@ -26,6 +27,7 @@ Dynamic: home-page
26
27
  Dynamic: license
27
28
  Dynamic: license-file
28
29
  Dynamic: requires-dist
30
+ Dynamic: requires-python
29
31
  Dynamic: summary
30
32
 
31
33
  ===============================
@@ -64,12 +66,14 @@ If you are using the EDRIXS code to do some studies and would like to publish yo
64
66
 
65
67
  Usage
66
68
  -----
67
- For Linux users we suggest installing with anaconda.
69
+ For Linux and macOS, we recommend installing the released edrixs package with
70
+ Mamba in a separate environment:
68
71
 
69
72
  .. code-block:: bash
70
73
 
71
- $ conda create --name edrixs_env python=3.10
72
- $ conda activate edrixs_env
73
- $ conda install -c conda-forge edrixs
74
+ mamba create --name edrixs_env -c conda-forge --strict-channel-priority \
75
+ edrixs matplotlib
76
+ conda activate edrixs_env
74
77
 
75
- For Windows and macOS machines, we suggest using docker. See https://edrixs.github.io/edrixs for more details.
78
+ For Windows, we recommend Docker. See https://edrixs.github.io/edrixs for the
79
+ complete installation, verification, requirements, and Docker instructions.
@@ -83,6 +83,7 @@ edrixs/tests/conftest.py
83
83
  edrixs/tests/test_examples.py
84
84
  edrixs/tests/test_fortran.py
85
85
  edrixs/tests/test_utils.py
86
+ edrixs/tests/test_wannier_ham.py
86
87
  src/arpack.f90
87
88
  src/ed_driver.f90
88
89
  src/ed_main.f90
@@ -1,4 +1,4 @@
1
- numpy<2
1
+ numpy>=1.26
2
2
  scipy
3
3
  sympy
4
4
  matplotlib
@@ -4,6 +4,6 @@ requires = [
4
4
  "wheel",
5
5
  "cmake",
6
6
  "ninja; platform_system!='Windows'",
7
- "numpy",
7
+ "numpy>=2.0",
8
8
  ]
9
9
  build-backend = "setuptools.build_meta"
@@ -1,5 +1,5 @@
1
1
  # List required packages in this file, one per line.
2
- numpy<2
2
+ numpy>=1.26
3
3
  scipy
4
4
  sympy
5
5
  matplotlib
@@ -65,6 +65,7 @@ class cmake_build_ext(build_ext):
65
65
 
66
66
  cmake_args = [
67
67
  "-DEDRIXS_PY_INTERFACE=ON",
68
+ "-DPython3_EXECUTABLE={}".format(sys.executable),
68
69
  # Ask CMake to place the resulting library in the directory containing the extension
69
70
  "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(extdir),
70
71
  # static libraries are placed in a temporary build directory
@@ -73,6 +74,22 @@ class cmake_build_ext(build_ext):
73
74
  "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY={}".format(self.build_temp),
74
75
  ]
75
76
 
77
+ # Keep compiled dependencies within one conda toolchain. Without
78
+ # this, CMake can accidentally mix conda libraries with libraries
79
+ # installed by Homebrew or MacPorts on macOS.
80
+ conda_prefix = os.getenv("CONDA_PREFIX")
81
+ if conda_prefix:
82
+ cmake_args.extend(
83
+ [
84
+ "-DCMAKE_PREFIX_PATH={}".format(conda_prefix),
85
+ "-DCMAKE_FIND_ROOT_PATH={}".format(conda_prefix),
86
+ "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY",
87
+ "-DARPACK_ROOT={}".format(
88
+ os.path.join(conda_prefix, "lib")
89
+ ),
90
+ ]
91
+ )
92
+
76
93
  configure_args = os.getenv("CMAKE_CONFIGURE_ARGS")
77
94
  if configure_args:
78
95
  cmake_args.extend(configure_args.split(" "))
@@ -94,6 +111,7 @@ setup(
94
111
  version=versioneer.get_version(),
95
112
  description="An open source toolkit for simulating RIXS spectra based on ED",
96
113
  long_description=readme,
114
+ python_requires=">=3.10",
97
115
  author="Brookhaven National Lab",
98
116
  author_email="yilinwang@bnl.gov",
99
117
  url="https://github.com/NSLS-II/edrixs",
@@ -1,182 +0,0 @@
1
- ************
2
- Installation
3
- ************
4
- For Linux users we suggest :ref:`installing with anaconda <AnacondaInstall>`. For Windows and macOS machines, we suggest using the :ref:`docker instructions <edrixsanddocker>`, which are relatively straightforward. In principle, you can also compile the code from the source for Linux, but this is quite involved and we recommend against this for standard use.
5
-
6
-
7
- .. _AnacondaInstall:
8
-
9
- Install and use edrixs via Anaconda
10
- ====================================================
11
- A conda package has been built for Linux. To use edrixs via Anaconda, you need first to install `Anaconda <https://www.anaconda.com/distribution/>`_ in your system.
12
- We recommend installing edrixs into a separate environment, for example, called ``edrixs_env``, together with any other packages you might want to use like this::
13
-
14
- conda create --name edrixs_env -c conda-forge python=3.13 edrixs matplotlib
15
-
16
- We endeavor to keep the conda-forge release up to date, but note that these builds will usually not correspond to the latest version of edrixs, which is available in the `master branch of edrixs <https://github.com/NSLS-II/edrixs>`_.
17
-
18
- edrixs will also run on `Google Colaboratory <https://research.google.com/colaboratory/>`_, but does not come installed as default. Installing it requires a you to install conda and then edrixs, which can be done by executing a cell::
19
-
20
- !pip install -q condacolab
21
- import condacolab
22
- condacolab.install()
23
- !conda install -c conda-forge edrixs
24
-
25
- from within a notebook cell.
26
-
27
- Requirements
28
- ============
29
- Several tools and libraries are required to build and install edrixs,
30
-
31
- * Fortran compiler: gfortran and ifort are supported
32
- * MPI environment: openmpi and mpich are tested
33
- * MPI Fortran and C compilers: mpif90, mpicc
34
- * BLAS and LAPACK libraries: `OpenBLAS <https://github.com/xianyi/OpenBLAS/>`_ with gfortran and MKL with ifort
35
- * ARPACK library: `arpack-ng <https://github.com/opencollab/arpack-ng/>`_ with mpi enabled
36
- * Only Python3 is supported
37
- * numpy, scipy, sympy, matplotlib, sphinx, numpydoc
38
- * mpi4py with the same MPI implementation libraries (``openmpi`` or ``mpich``) as building edrixs
39
-
40
- Build from source
41
- =================
42
- We will show how to build edrixs from source on Ubuntu Linux 20.04.
43
- We will use gcc, gfortran, openmpi and OpenBLAS in these examples.
44
- Building edrixs on other versions of Linux or with Intel's ifort+MKL will be similar.
45
-
46
- Ubuntu Linux 20.04
47
- ------------------
48
- Install compilers and tools::
49
-
50
- sudo apt-get update
51
- sudo apt-get install build-essential gfortran gcc
52
- sudo apt-get install git wget
53
- sudo apt-get install python3 libpython3-dev python3-pip python3-venv
54
-
55
- Create and activate a python virtual environment for edrixs::
56
-
57
- python3 -m venv VIRTUAL_ENV
58
- source VIRTUAL_ENV/bin/activate
59
-
60
- where ``VIRTUAL_ENV`` should be replaced by the directory where you wish to install edrixs.
61
-
62
- Alternatively create and activate a conda environment for edrixs::
63
-
64
- conda create --name edrixs_env python=3.8
65
- conda activate edrixs_env
66
-
67
- We will assume ``python`` and ``pip`` are pointing to the activated environment from now on.
68
- Check we are using the expected python and pip::
69
-
70
- which python
71
- which pip
72
- python --version
73
-
74
- Fetch the latest version of ``pip``::
75
-
76
- pip install --upgrade pip
77
-
78
- openmpi, OpenBLAS, ARPACK can be installed by ``apt-get``, but their versions are old and may not work properly.
79
- However, they can also be compiled from source easily. In the following, we will show both ways, but we always recommend to build newer ones from source.
80
-
81
- openmpi can be installed by::
82
-
83
- sudo apt-get install libopenmpi-dev
84
-
85
- or from newer version of source, for example v3.1.4::
86
-
87
- wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.4.tar.bz2
88
- tar -xjf openmpi-3.1.4.tar.bz2
89
- cd openmpi-3.1.4
90
- ./configure CC=gcc CXX=g++ FC=gfortran
91
- make
92
- sudo make install
93
-
94
- the compiling process will take a while.
95
-
96
- OpenBLAS can be installed by::
97
-
98
- sudo apt-get install libopenblas-dev
99
-
100
- or from a newer version of source::
101
-
102
- wget https://github.com/xianyi/OpenBLAS/archive/v0.3.6.tar.gz
103
- tar -xzf v0.3.6.tar.gz
104
- cd OpenBLAS-0.3.6
105
- make CC=gcc FC=gfortran
106
- sudo make PREFIX=/usr/local install
107
-
108
- ARPACK can be installed by::
109
-
110
- sudo apt-get install libarpack2-dev libparpack2-dev
111
-
112
- or from a newer version of source::
113
-
114
- wget https://github.com/opencollab/arpack-ng/archive/3.6.3.tar.gz
115
- tar -xzf 3.6.3.tar.gz
116
- cd arpack-ng-3.6.3
117
- ./bootstrap
118
- ./configure --enable-mpi --with-blas="-L/usr/local/lib/ -lopenblas" FC=gfortran F77=gfortran MPIFC=mpif90 MPIF77=mpif90
119
- make
120
- sudo make install
121
-
122
- mpi4py can be installed by::
123
-
124
- export MPICC=/usr/local/bin/mpicc
125
- sudo pip install --no-cache-dir mpi4py
126
-
127
- or from source::
128
-
129
- wget https://github.com/mpi4py/mpi4py/archive/3.0.1.tar.gz
130
- tar xzf 3.0.1.tar.gz
131
- cd mpi4py-3.0.1
132
-
133
- edit mpi.cfg to set MPI paths as following::
134
-
135
- [mpi]
136
- mpi_dir = /usr/local
137
- mpicc = %(mpi_dir)s/bin/mpicc
138
- mpicxx = %(mpi_dir)s/bin/mpicxx
139
- include_dirs = %(mpi_dir)s/include
140
- libraries = mpi
141
- library_dirs = %(mpi_dir)s/lib
142
- runtime_library_dirs = %(mpi_dir)s/lib
143
-
144
- and comment all other contents. Then, build and install by::
145
-
146
- python setup.py build
147
- sudo pip install .
148
-
149
- Check whether the MPI paths are correct by::
150
-
151
- python
152
- >>> import mpi4py
153
- >>> mpi4py.get_config()
154
- {'mpicc': '/usr/local/bin/mpicc',
155
- 'mpicxx': '/usr/local/bin/mpicxx',
156
- 'include_dirs': '/usr/local/include',
157
- 'libraries': 'mpi',
158
- 'library_dirs': '/usr/local/lib',
159
- 'runtime_library_dirs': '/usr/local/lib'}
160
-
161
- Now, we are ready to build edrixs::
162
-
163
- git clone https://github.com/NSLS-II/edrixs.git
164
- cd edrixs
165
- pip install -v .
166
-
167
- Start to play with edrixs by::
168
-
169
- python
170
- >>> import edrixs
171
- >>> edrixs.some_functions(...)
172
-
173
- or go to ``examples`` directory to run some examples::
174
-
175
- cd examples/more/ED/14orb
176
- ./get_inputs.py
177
- mpirun -np 2 ed.x
178
- mpirun -np 2 ./run_fedsolver.py
179
- cd ../../RIXS/LaNiO3_thin
180
- mpirun -np 2 ./run_rixs_fsolver.py
181
-
182
- if no errors, the installation is successful.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes