edrixs 0.2.0__tar.gz → 0.3.0.dev1__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.
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/PKG-INFO +27 -7
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/README.rst +24 -4
- edrixs-0.3.0.dev1/docs/source/reference/models.rst +15 -0
- edrixs-0.3.0.dev1/docs/source/reference/solvers.rst +17 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/release-history.rst +16 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/backend.rst +34 -6
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/backends/dense.rst +6 -1
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/backends/fortran.rst +5 -0
- edrixs-0.3.0.dev1/docs/source/user/backends/petsc.rst +140 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/backends/scipy.rst +13 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/conventions.rst +17 -11
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/installation.rst +7 -1
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/introduction.rst +20 -10
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/nio_siam_xas_rixs.rst +3 -0
- edrixs-0.3.0.dev1/edrixs/_numba_operator_kernels.py +264 -0
- edrixs-0.3.0.dev1/edrixs/_operator_builder.py +250 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/_solvers_helpers.py +0 -42
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/dense_backend/__init__.py +0 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/dense_backend/dense_backend.py +11 -8
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/fortran_backend/__init__.py +0 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/fortran_backend/fortran_backend.py +16 -15
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/fortran_backend/options.py +1 -1
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/models.py +8 -7
- edrixs-0.3.0.dev1/edrixs/petsc_backend/hash_basis_methods.py +184 -0
- edrixs-0.3.0.dev1/edrixs/petsc_backend/lanczos.py +81 -0
- edrixs-0.3.0.dev1/edrixs/petsc_backend/options.py +177 -0
- edrixs-0.3.0.dev1/edrixs/petsc_backend/petsc_backend.py +821 -0
- edrixs-0.3.0.dev1/edrixs/petsc_backend/petsc_shifted_pminres.py +174 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/scipy_backend/options.py +5 -3
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/scipy_backend/scipy_backend.py +28 -23
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/solvers.py +54 -86
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/utils.py +6 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs.egg-info/PKG-INFO +27 -7
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs.egg-info/SOURCES.txt +9 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/setup.py +2 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_backend_options.py +20 -3
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_basis_representation_routes.py +4 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_dense_backend.py +67 -19
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_ed_krylov.py +5 -3
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_ed_shift.py +53 -40
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_filled_core.py +5 -3
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_fortran_backend.py +23 -4
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_fortran_backend_mpi.py +8 -3
- edrixs-0.3.0.dev1/tests/test_lazy_operators.py +195 -0
- edrixs-0.3.0.dev1/tests/test_model_operator_routes.py +139 -0
- edrixs-0.3.0.dev1/tests/test_numba_cache.py +39 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_operator_route_consistency.py +6 -6
- edrixs-0.3.0.dev1/tests/test_petsc_backend.py +269 -0
- edrixs-0.3.0.dev1/tests/test_petsc_coo.py +107 -0
- edrixs-0.3.0.dev1/tests/test_petsc_filled_core.py +203 -0
- edrixs-0.3.0.dev1/tests/test_petsc_operator_lifetime.py +330 -0
- edrixs-0.3.0.dev1/tests/test_petsc_preallocation.py +97 -0
- edrixs-0.3.0.dev1/tests/test_rixs_solve_reuse.py +197 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_scipy_backend.py +20 -17
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_scipy_operator_construction.py +2 -2
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_solver_helpers.py +0 -13
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_solvers_dispatch.py +15 -26
- edrixs-0.2.0/docs/source/reference/models.rst +0 -16
- edrixs-0.2.0/docs/source/reference/solvers.rst +0 -4
- edrixs-0.2.0/docs/source/user/backends/petsc.rst +0 -27
- edrixs-0.2.0/edrixs/_operator_builder.py +0 -501
- edrixs-0.2.0/edrixs/petsc_backend/hash_basis_methods.py +0 -28
- edrixs-0.2.0/edrixs/petsc_backend/options.py +0 -19
- edrixs-0.2.0/edrixs/petsc_backend/petsc_backend.py +0 -86
- edrixs-0.2.0/tests/test_model_operator_routes.py +0 -106
- edrixs-0.2.0/tests/test_petsc_backend.py +0 -70
- edrixs-0.2.0/tests/test_rixs_solve_reuse.py +0 -107
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/AUTHORS.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/CONTRIBUTING.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/LICENSE +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/MANIFEST.in +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/Makefile +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/make.bat +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/_ext/backend_options_directive.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/conf.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/index.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/angular_momentum.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/basis_transform.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/coulomb_utensor.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/fit_hyb.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/fock_basis.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/index.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/iostream.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/manybody_operator.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/photon_transition.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/plot_spectrum.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/poles.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/rixs_utils.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/soc.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/utils.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/reference/wannier_ham.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/devcontainer.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/examples.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/index.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/nio_l23_xas.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/papers.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/usedocker.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/docs/source/user/whatisedrixs.rst +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/__init__.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/_backend_options.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/_version.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/angular_momentum.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Co.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Cr.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Cu.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Fe.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Ir.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Mn.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Ni.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Os.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Pu.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Re.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Sm.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/Ti.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/U.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/atom_data/V.json +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/basis_transform.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/coulomb_utensor.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/dense_backend/options.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/fit_hyb.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/fock_basis.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/fortran_backend/iostream_fortran.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/iostream.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/manybody_operator.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/petsc_backend/__init__.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/photon_transition.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/plot_spectrum.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/poles.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/rixs_utils.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/scipy_backend/__init__.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/scipy_backend/hash_basis_methods.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/scipy_backend/krylov.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/scripts.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/soc.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs/wannier_ham.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs.egg-info/dependency_links.txt +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs.egg-info/entry_points.txt +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs.egg-info/requires.txt +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/edrixs.egg-info/top_level.txt +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/pyproject.toml +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/requirements.txt +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/setup.cfg +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/arpack.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/ed_driver.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/ed_main.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/fock.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/full_diag.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/ham.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/io.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/lanczos.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/linsys.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/m_constants.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/m_control.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/m_global.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/m_types.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/opavg_driver.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/opavg_main.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/pyapi.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/rixs_driver.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/rixs_main.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/spmv.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/utils.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/xas_driver.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/src/xas_main.f90 +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_angular_momentum.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_basis_transform.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_coulomb_utensor.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_fock_basis.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_legacy_solver_deprecations.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_manybody_operator.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_model_siam_2d1p.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_scipy_krylov.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_soc.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_utils.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_utils_extra.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/tests/test_wannier_ham.py +0 -0
- {edrixs-0.2.0 → edrixs-0.3.0.dev1}/versioneer.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edrixs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev1
|
|
4
4
|
Summary: An open source toolkit for simulating RIXS spectra based on ED
|
|
5
|
-
Home-page: https://github.com/
|
|
5
|
+
Home-page: https://github.com/EDRIXS/edrixs
|
|
6
6
|
Author: Brookhaven National Lab
|
|
7
|
-
Author-email:
|
|
7
|
+
Author-email: mdean@bnl.gov
|
|
8
8
|
License: GPL-3.0-or-later
|
|
9
9
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
10
10
|
Classifier: Development Status :: 2 - Pre-Alpha
|
|
@@ -35,11 +35,31 @@ Dynamic: summary
|
|
|
35
35
|
edrixs
|
|
36
36
|
===============================
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
:target: https://pypi.python.org/pypi/edrixs
|
|
38
|
+
|ci| |conda| |pypi| |docs| |doi| |binder|
|
|
40
39
|
|
|
41
|
-
.. image:: https://
|
|
42
|
-
|
|
40
|
+
.. |ci| image:: https://github.com/EDRIXS/edrixs/actions/workflows/ci-test.yml/badge.svg?branch=master&event=push
|
|
41
|
+
:target: https://github.com/EDRIXS/edrixs/actions/workflows/ci-test.yml?query=branch%3Amaster+event%3Apush
|
|
42
|
+
:alt: CI status
|
|
43
|
+
|
|
44
|
+
.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/edrixs.svg
|
|
45
|
+
:target: https://anaconda.org/conda-forge/edrixs
|
|
46
|
+
:alt: Conda-forge version
|
|
47
|
+
|
|
48
|
+
.. |pypi| image:: https://img.shields.io/pypi/v/edrixs.svg
|
|
49
|
+
:target: https://pypi.org/project/edrixs/
|
|
50
|
+
:alt: PyPI version
|
|
51
|
+
|
|
52
|
+
.. |docs| image:: https://img.shields.io/badge/docs-online-blue.svg
|
|
53
|
+
:target: https://edrixs.github.io/edrixs/
|
|
54
|
+
:alt: Documentation
|
|
55
|
+
|
|
56
|
+
.. |doi| image:: https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2019.04.018-blue.svg
|
|
57
|
+
:target: https://doi.org/10.1016/j.cpc.2019.04.018
|
|
58
|
+
:alt: Paper DOI
|
|
59
|
+
|
|
60
|
+
.. |binder| image:: https://mybinder.org/badge_logo.svg
|
|
61
|
+
:target: https://mybinder.org/v2/gh/edrixs/edrixs.git/master?urlpath=lab
|
|
62
|
+
:alt: Launch Binder
|
|
43
63
|
|
|
44
64
|
EDRIXS is an open source toolkit for simulating XAS and RIXS spectra based on exact diagonalization of model Hamiltonians.
|
|
45
65
|
It was started as part of the `COMSCOPE project <https://www.bnl.gov/comscope/>`_ in the
|
|
@@ -2,11 +2,31 @@
|
|
|
2
2
|
edrixs
|
|
3
3
|
===============================
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
:target: https://pypi.python.org/pypi/edrixs
|
|
5
|
+
|ci| |conda| |pypi| |docs| |doi| |binder|
|
|
7
6
|
|
|
8
|
-
.. image:: https://
|
|
9
|
-
|
|
7
|
+
.. |ci| image:: https://github.com/EDRIXS/edrixs/actions/workflows/ci-test.yml/badge.svg?branch=master&event=push
|
|
8
|
+
:target: https://github.com/EDRIXS/edrixs/actions/workflows/ci-test.yml?query=branch%3Amaster+event%3Apush
|
|
9
|
+
:alt: CI status
|
|
10
|
+
|
|
11
|
+
.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/edrixs.svg
|
|
12
|
+
:target: https://anaconda.org/conda-forge/edrixs
|
|
13
|
+
:alt: Conda-forge version
|
|
14
|
+
|
|
15
|
+
.. |pypi| image:: https://img.shields.io/pypi/v/edrixs.svg
|
|
16
|
+
:target: https://pypi.org/project/edrixs/
|
|
17
|
+
:alt: PyPI version
|
|
18
|
+
|
|
19
|
+
.. |docs| image:: https://img.shields.io/badge/docs-online-blue.svg
|
|
20
|
+
:target: https://edrixs.github.io/edrixs/
|
|
21
|
+
:alt: Documentation
|
|
22
|
+
|
|
23
|
+
.. |doi| image:: https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2019.04.018-blue.svg
|
|
24
|
+
:target: https://doi.org/10.1016/j.cpc.2019.04.018
|
|
25
|
+
:alt: Paper DOI
|
|
26
|
+
|
|
27
|
+
.. |binder| image:: https://mybinder.org/badge_logo.svg
|
|
28
|
+
:target: https://mybinder.org/v2/gh/edrixs/edrixs.git/master?urlpath=lab
|
|
29
|
+
:alt: Launch Binder
|
|
10
30
|
|
|
11
31
|
EDRIXS is an open source toolkit for simulating XAS and RIXS spectra based on exact diagonalization of model Hamiltonians.
|
|
12
32
|
It was started as part of the `COMSCOPE project <https://www.bnl.gov/comscope/>`_ in the
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
models
|
|
2
|
+
======
|
|
3
|
+
|
|
4
|
+
Model constructors define the physical problem without building many-body
|
|
5
|
+
operators or running solvers. They return eight values: seven inputs describing
|
|
6
|
+
the Hamiltonians, Fock bases, and transition operators, plus a scalar ``shift``
|
|
7
|
+
equal to the filled core's shell-level energy.
|
|
8
|
+
|
|
9
|
+
Pass the first seven outputs to ``get_ops``. For dense, SciPy, or PETSc
|
|
10
|
+
diagonalization, optionally pass ``shift`` to ``ed`` to reduce numerical errors.
|
|
11
|
+
The returned eigenvalues retain their original energy reference, so the shift
|
|
12
|
+
does not change the physics. Fortran ED ignores a nonzero shift with a warning.
|
|
13
|
+
|
|
14
|
+
.. automodule:: edrixs.models
|
|
15
|
+
:members:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
solvers
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
``build_op`` returns a zero-argument ``functools.partial`` with a ``.backend``
|
|
5
|
+
attribute. Numerical ``get_ops`` returns these factories for both Hamiltonians
|
|
6
|
+
and each transition component. ``ed`` and ``rixs`` dispatch using
|
|
7
|
+
``hmat_i.backend``; ``xas`` uses ``hmat_n.backend``. The backend receives the
|
|
8
|
+
factories unchanged. All staged backend solvers require factories.
|
|
9
|
+
Dense, SciPy, and PETSc ED construct all inputs at calculation start.
|
|
10
|
+
PETSc XAS and RIXS accept ``matrix_lifetime`` in ``backend_kws``.
|
|
11
|
+
Fortran disk handles are callable, returning themselves; native Fortran manages
|
|
12
|
+
actual matrix construction.
|
|
13
|
+
|
|
14
|
+
Call a numerical factory explicitly to obtain a concrete matrix for arithmetic.
|
|
15
|
+
|
|
16
|
+
.. automodule:: edrixs.solvers
|
|
17
|
+
:members:
|
|
@@ -8,6 +8,15 @@ Unreleased
|
|
|
8
8
|
New calculation interface
|
|
9
9
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
10
10
|
|
|
11
|
+
* Return labeled matrix factories from ``build_op`` and numerical ``get_ops``.
|
|
12
|
+
Call a factory explicitly for matrix arithmetic. ``ed``, ``xas``, and ``rixs``
|
|
13
|
+
now dispatch using ``.backend`` labels and no longer accept ``backend=``.
|
|
14
|
+
* Construct matrices inside the numerical backends. Dense and SciPy eagerly
|
|
15
|
+
materialize inputs at calculation start, as does PETSc ED. PETSc XAS and
|
|
16
|
+
RIXS accept ``matrix_lifetime`` with
|
|
17
|
+
``'retain'`` (default) and ``'recompute'`` policies for reusing matrices or
|
|
18
|
+
releasing and rebuilding them between operations.
|
|
19
|
+
|
|
11
20
|
* Introduce a staged workflow that separates physical model construction,
|
|
12
21
|
many-body operator construction, diagonalization, and spectral calculations:
|
|
13
22
|
``model_*`` → ``get_ops`` → ``ed`` → ``xas`` / ``rixs``.
|
|
@@ -17,7 +26,7 @@ New calculation interface
|
|
|
17
26
|
* Make SciPy the default backend, with sparse operator construction and Krylov
|
|
18
27
|
methods for ED, XAS, and RIXS. Dense calculations and native Fortran/MPI
|
|
19
28
|
solvers are also available through the staged interface.
|
|
20
|
-
*
|
|
29
|
+
* Provide a PETSc backend with distributed operator construction and solvers.
|
|
21
30
|
* Add compact Fock-basis specifications with interchangeable combinadic and
|
|
22
31
|
explicit basis construction. Operator construction uses Numba by default;
|
|
23
32
|
``use_numba=False`` selects Python construction.
|
|
@@ -27,7 +36,7 @@ New calculation interface
|
|
|
27
36
|
Numerical methods and utilities
|
|
28
37
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
29
38
|
|
|
30
|
-
* Support an energy-reference shift for SciPy and
|
|
39
|
+
* Support an energy-reference shift for SciPy, dense, and PETSc diagonalization while
|
|
31
40
|
returning eigenvalues in the original reference. Models return the shift
|
|
32
41
|
alongside their operator inputs. The Fortran backend warns and continues
|
|
33
42
|
when a nonzero shift is supplied.
|
|
@@ -40,6 +49,11 @@ Numerical methods and utilities
|
|
|
40
49
|
Compatibility and migration
|
|
41
50
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
42
51
|
|
|
52
|
+
* ``build_op`` and numerical ``get_ops`` now return factories rather than
|
|
53
|
+
matrices. Call a factory to obtain a matrix for arithmetic. Public ``ed``,
|
|
54
|
+
``xas``, and ``rixs`` require labeled factories or Fortran disk handles and
|
|
55
|
+
reject the removed ``backend`` keyword. Backend-specific staged solvers also
|
|
56
|
+
require factories. See :ref:`lazy-operators`.
|
|
43
57
|
* Deprecate the legacy model-specific Python and Fortran solver wrappers in
|
|
44
58
|
favor of the staged interface. Existing wrappers emit deprecation warnings.
|
|
45
59
|
* Reject isotropic RIXS polarization; specify incoming and outgoing
|
|
@@ -6,22 +6,50 @@ Backend
|
|
|
6
6
|
|
|
7
7
|
The :ref:`introduction` describes the four stages of a calculation. Stages two
|
|
8
8
|
to four -- building operators, diagonalizing, and assembling spectra --
|
|
9
|
-
delegate their numerical work to a backend selected with ``backend
|
|
9
|
+
delegate their numerical work to a backend selected with ``backend`` when
|
|
10
|
+
calling ``build_op`` or ``get_ops``:
|
|
10
11
|
|
|
11
|
-
* ``'dense'``
|
|
12
|
+
* ``'dense'`` builds full NumPy matrices and uses exact dense
|
|
12
13
|
diagonalization and explicit eigenstate sums. It is intended for small
|
|
13
14
|
problems, reference calculations, and pedagogy.
|
|
14
|
-
* ``'scipy'``
|
|
15
|
+
* ``'scipy'`` builds SciPy CSR matrices and uses LOBPCG, Lanczos, and GMRES.
|
|
15
16
|
It is the default backend.
|
|
16
17
|
* ``'fortran'`` uses the native MPI solvers and communicates through files in
|
|
17
18
|
the current working directory. We provide the function
|
|
18
19
|
:func:`edrixs.get_ops_disk <edrixs.solvers.get_ops_disk>` to load the setup
|
|
19
20
|
from disk if desired.
|
|
20
|
-
* ``'petsc'``
|
|
21
|
+
* ``'petsc'`` uses distributed PETSc matrices, SLEPc eigensolvers, and PETSc
|
|
22
|
+
Krylov solvers. It is intended for larger Hilbert spaces and MPI runs.
|
|
21
23
|
|
|
22
|
-
Backend-specific numerical controls belong in a ``backend_kws`` mapping.
|
|
24
|
+
Backend-specific numerical controls belong in a ``backend_kws`` mapping. The
|
|
23
25
|
mapping is specific to both the backend *and the operation*.
|
|
24
26
|
|
|
27
|
+
.. _lazy-operators:
|
|
28
|
+
|
|
29
|
+
Operator factories and solver dispatch
|
|
30
|
+
======================================
|
|
31
|
+
|
|
32
|
+
``build_op`` returns a callable that constructs the matrix when called. This
|
|
33
|
+
lets callers defer matrix allocation and recreate matrices when needed. Its
|
|
34
|
+
``.backend`` attribute identifies the numerical backend and the matrix
|
|
35
|
+
representation it will produce.
|
|
36
|
+
|
|
37
|
+
Numerical ``get_ops`` returns these callables for both Hamiltonians
|
|
38
|
+
and every transition component. Public ``ed`` and ``rixs`` dispatch using
|
|
39
|
+
``hmat_i.backend``; ``xas`` uses ``hmat_n.backend``. They pass the factories
|
|
40
|
+
unchanged to the selected backend and assume all operators are suitable for it.
|
|
41
|
+
Dense, SciPy, and PETSc ED call every supplied factory at calculation
|
|
42
|
+
start. Repeated arguments may be instantiated independently. PETSc XAS and RIXS
|
|
43
|
+
accept ``matrix_lifetime`` in ``backend_kws``; see :doc:`backends/petsc`.
|
|
44
|
+
All staged solver entry points, including backend-specific functions, require
|
|
45
|
+
factories or callable Fortran disk handles.
|
|
46
|
+
|
|
47
|
+
For matrix arithmetic or direct access to matrix methods, call the factory
|
|
48
|
+
explicitly::
|
|
49
|
+
|
|
50
|
+
number_op = edrixs.build_op(number_coefficients, None, basis, backend='dense')
|
|
51
|
+
number_matrix = number_op()
|
|
52
|
+
|
|
25
53
|
Numerical precision
|
|
26
54
|
===================
|
|
27
55
|
|
|
@@ -47,7 +75,7 @@ Choose the backend whose keywords you need:
|
|
|
47
75
|
* :doc:`SciPy keywords <backends/scipy>`
|
|
48
76
|
* :doc:`Dense keywords <backends/dense>`
|
|
49
77
|
* :doc:`Fortran keywords <backends/fortran>`
|
|
50
|
-
* :doc:`PETSc
|
|
78
|
+
* :doc:`PETSc keywords <backends/petsc>`
|
|
51
79
|
|
|
52
80
|
These references apply to the staged ``get_ops`` / ``ed`` / ``xas`` / ``rixs``
|
|
53
81
|
interface. The legacy ``ed_*_fort``, ``xas_*_fort``, and ``rixs_*_fort``
|
|
@@ -9,8 +9,13 @@ Dense keywords
|
|
|
9
9
|
About this backend
|
|
10
10
|
==================
|
|
11
11
|
|
|
12
|
-
The ``dense`` backend
|
|
12
|
+
The ``dense`` backend uses NumPy
|
|
13
13
|
`ndarray objects <https://numpy.org/doc/stable/reference/arrays.ndarray.html>`__.
|
|
14
|
+
``build_op`` and ``get_ops`` return labeled factories; the matrices are built
|
|
15
|
+
when a factory is called explicitly or by the dense backend at the start of
|
|
16
|
+
each calculation. Each argument is called independently, including repeated
|
|
17
|
+
references. Backend-specific solvers also require factories.
|
|
18
|
+
|
|
14
19
|
It uses SciPy's
|
|
15
20
|
`dense Hermitian eigensolver <https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eigh.html>`__
|
|
16
21
|
for ED. XAS explicitly sums over all intermediate eigenstates, while RIXS
|
|
@@ -45,6 +45,11 @@ current working directory, call :func:`~edrixs.solvers.get_ops_disk`. It
|
|
|
45
45
|
returns ``hmat_i``, ``hmat_n``, and ``trans_ops`` handles without rewriting
|
|
46
46
|
the problem files.
|
|
47
47
|
|
|
48
|
+
Both ``get_ops(..., backend='fortran')`` and ``get_ops_disk()`` return disk
|
|
49
|
+
handles with ``.backend == 'fortran'``. Pass them directly to public ``ed``,
|
|
50
|
+
``xas``, and ``rixs``. The handles are callable and return themselves; the
|
|
51
|
+
Fortran backends call them while native Fortran manages matrix construction.
|
|
52
|
+
|
|
48
53
|
``ed``
|
|
49
54
|
======
|
|
50
55
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
.. _petsc-backend-options:
|
|
2
|
+
|
|
3
|
+
**************
|
|
4
|
+
PETSc keywords
|
|
5
|
+
**************
|
|
6
|
+
|
|
7
|
+
:doc:`Back to the backend overview <../backend>`
|
|
8
|
+
|
|
9
|
+
About this backend
|
|
10
|
+
==================
|
|
11
|
+
|
|
12
|
+
PETSc supplies distributed vectors and matrices together with scalable linear
|
|
13
|
+
solvers and preconditioners; its concise
|
|
14
|
+
`architecture overview <https://petsc.org/release/overview/nutshell/>`__
|
|
15
|
+
introduces the ``Vec``, ``Mat``, ``KSP``, and ``PC`` objects. Python programs
|
|
16
|
+
access them through the official
|
|
17
|
+
`petsc4py API <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.html>`__.
|
|
18
|
+
For eigenvalue problems, SLEPc builds on PETSc and exposes its ``EPS`` solver
|
|
19
|
+
through the
|
|
20
|
+
`SLEPc eigenvalue guide <https://slepc.upv.es/release/documentation/manual/eps.html>`__
|
|
21
|
+
and the
|
|
22
|
+
`slepc4py EPS API <https://slepc.upv.es/release/slepc4py/reference/slepc4py.SLEPc.EPS.html>`__.
|
|
23
|
+
|
|
24
|
+
EDRIXS constructs distributed PETSc ``Mat`` objects, obtains low-energy
|
|
25
|
+
eigenpairs with SLEPc's Krylov--Schur method, and evaluates XAS and RIXS with
|
|
26
|
+
distributed Lanczos and KSP solves. Importing EDRIXS does not import PETSc;
|
|
27
|
+
``petsc4py`` and ``slepc4py`` are loaded only when this backend is used.
|
|
28
|
+
|
|
29
|
+
``build_op`` and ``get_ops`` return factories labeled with
|
|
30
|
+
``.backend == 'petsc'``. Calling a factory assembles its distributed matrix;
|
|
31
|
+
public ``ed``, ``xas``, and ``rixs`` read the labels and pass the factories to
|
|
32
|
+
the PETSc backend. All MPI ranks in the matrix communicator must participate
|
|
33
|
+
in construction and solver calls. See :ref:`lazy-operators`.
|
|
34
|
+
|
|
35
|
+
Options are specific to the stage where they are supplied.
|
|
36
|
+
|
|
37
|
+
Matrix lifetime
|
|
38
|
+
===============
|
|
39
|
+
|
|
40
|
+
PETSc ``xas`` and ``rixs`` accept ``matrix_lifetime`` in ``backend_kws``:
|
|
41
|
+
|
|
42
|
+
* ``'retain'`` (default) builds each required factory on first use, keeps its
|
|
43
|
+
matrix for reuse during the calculation, and destroys it before returning.
|
|
44
|
+
* ``'recompute'`` builds a matrix for each operation and destroys it immediately
|
|
45
|
+
afterward, rebuilding it for later uses. This reduces peak memory usage at the
|
|
46
|
+
cost of more CPU time. This can be useful for the largest jobs.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
``build_op`` and ``get_ops``
|
|
50
|
+
============================
|
|
51
|
+
|
|
52
|
+
.. backend-options:: petsc get_ops
|
|
53
|
+
|
|
54
|
+
Two matrix construction options are available. ``assembly_method='row'`` is
|
|
55
|
+
the default and inserts entries by row in bounded chunks.
|
|
56
|
+
``assembly_method='coo'`` counts contributions in a first pass, then generates
|
|
57
|
+
them again into exact-sized coordinate and value arrays for bulk PETSc COO
|
|
58
|
+
assembly. PETSc combines duplicate coordinates and communicates remote entries.
|
|
59
|
+
Both options produce AIJ (CSR) matrices before optional ``mat_type`` conversion;
|
|
60
|
+
COO describes the assembly interface, rather than the final storage format.
|
|
61
|
+
Both options support the same solver lifetime policies.
|
|
62
|
+
COO avoids the Python row-insertion loop but requires full local entry buffers
|
|
63
|
+
and PETSc's COO mappings, so compare assembly time and peak memory for your
|
|
64
|
+
problem. ``assembly_chunk_cols`` bounds individual kernel calls for both
|
|
65
|
+
methods; COO still collects all local contributions before insertion.
|
|
66
|
+
|
|
67
|
+
``nnz_guess_per_row`` controls PETSc matrix preallocation. Leaving it unset
|
|
68
|
+
uses an estimate from the retained one- and two-body coefficients. With multiple
|
|
69
|
+
MPI ranks, the hint is applied separately to the local-column and remote-column
|
|
70
|
+
blocks of each rank's matrix rows. With one rank it applies to the sequential
|
|
71
|
+
matrix. Larger hints reserve more memory but can avoid reallocations during
|
|
72
|
+
row assembly; they do not change the matrix values. COO computes its pattern
|
|
73
|
+
directly and ignores this hint. A
|
|
74
|
+
``mat_type`` such as ``'aijcusparse'`` can select an accelerated matrix format;
|
|
75
|
+
see PETSc's `matrix type overview
|
|
76
|
+
<https://petsc.org/release/manual/mat/#basic-matrix-operations>`__.
|
|
77
|
+
|
|
78
|
+
``ed``
|
|
79
|
+
======
|
|
80
|
+
|
|
81
|
+
Pass the final model output as ``ed(hmat_i, shift=shift)`` to subtract the
|
|
82
|
+
filled-core shell energy from the factory-created distributed Hamiltonian before
|
|
83
|
+
diagonalization. Returned eigenvalues retain the original energy reference.
|
|
84
|
+
With a nonzero ``shift``, ``eigval_tol`` is an absolute residual tolerance for
|
|
85
|
+
the shifted problem, avoiding division by a near-zero centered eigenvalue.
|
|
86
|
+
With ``shift=0``, it is a relative residual tolerance, scaled by the eigenvalue
|
|
87
|
+
magnitude.
|
|
88
|
+
|
|
89
|
+
ED calls its factory once and destroys the matrix before returning.
|
|
90
|
+
``matrix_lifetime`` is not accepted for ED.
|
|
91
|
+
|
|
92
|
+
.. backend-options:: petsc ed
|
|
93
|
+
|
|
94
|
+
The eigensolver uses SLEPc ``EPS`` with a Hermitian problem type and requests
|
|
95
|
+
the smallest-real eigenpairs. ``ncv`` sets the Krylov subspace size described
|
|
96
|
+
by `EPS.setDimensions
|
|
97
|
+
<https://slepc.upv.es/release/slepc4py/reference/slepc4py.SLEPc.EPS.html#slepc4py.SLEPc.EPS.setDimensions>`__.
|
|
98
|
+
|
|
99
|
+
``xas``
|
|
100
|
+
=======
|
|
101
|
+
|
|
102
|
+
XAS accepts ``matrix_lifetime`` in ``backend_kws``. The default ``'retain'``
|
|
103
|
+
builds required transition components and the intermediate Hamiltonian on first
|
|
104
|
+
use and keeps them until calculation exit. With ``'recompute'``, each transition
|
|
105
|
+
component is destroyed after its application, and the intermediate Hamiltonian
|
|
106
|
+
is rebuilt and destroyed for each nonzero seed's Lanczos calculation. At most
|
|
107
|
+
one factory-created matrix is alive at a time in this mode. Components with
|
|
108
|
+
zero polarization coefficients and Hamiltonians for zero seeds are skipped.
|
|
109
|
+
Both policies destroy factory-created matrices before returning, including on
|
|
110
|
+
failure; initial-state eigenvectors remain owned by the caller.
|
|
111
|
+
|
|
112
|
+
XAS and RIXS center factory-created distributed matrices using the lowest retained initial
|
|
113
|
+
energy and the first incident energy, which should lie near resonance. RIXS
|
|
114
|
+
also centers the final Hamiltonian. Spectra are evaluated on these relative
|
|
115
|
+
energies before restoring the original reference in returned pole dictionaries.
|
|
116
|
+
Factory-created Hamiltonians are shifted in place.
|
|
117
|
+
|
|
118
|
+
.. backend-options:: petsc xas
|
|
119
|
+
|
|
120
|
+
``rixs``
|
|
121
|
+
========
|
|
122
|
+
|
|
123
|
+
.. backend-options:: petsc rixs
|
|
124
|
+
|
|
125
|
+
The default solver is ``shifted_pminres``. ``linsys_tol`` sets KSP's absolute
|
|
126
|
+
tolerance, ``atol``, and the default relative tolerance is zero. Other KSP
|
|
127
|
+
types retain PETSc's default relative tolerance unless overridden through
|
|
128
|
+
its options database.
|
|
129
|
+
|
|
130
|
+
EDRIXS calls KSP's ``setFromOptions()`` after applying ``backend_kws``.
|
|
131
|
+
Corresponding PETSc options-database entries, such as ``ksp_atol``, ``ksp_rtol``,
|
|
132
|
+
``ksp_max_it``, and ``ksp_type``, take precedence over these settings.
|
|
133
|
+
|
|
134
|
+
``ksp_type`` accepts a PETSc KSP type such as ``'gmres'``; the available
|
|
135
|
+
algorithms and their tradeoffs are listed in the `KSP solver table
|
|
136
|
+
<https://petsc.org/release/manual/ksp/#tab-kspdefaults>`__.
|
|
137
|
+
|
|
138
|
+
To select GMRES instead of the default shifted PMINRES, pass::
|
|
139
|
+
|
|
140
|
+
backend_kws={'ksp_type': 'gmres', 'linsys_tol': 1e-10}
|
|
@@ -11,8 +11,15 @@ About this backend
|
|
|
11
11
|
|
|
12
12
|
The ``scipy`` backend builds operators as SciPy
|
|
13
13
|
`CSR matrices <https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html>`__.
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
``build_op`` and ``get_ops`` return labeled factories that construct these
|
|
15
|
+
matrices when called. Pass the factories to public ``ed``, ``xas``, and ``rixs``;
|
|
16
|
+
the primary Hamiltonian's ``.backend`` label selects SciPy. The backend calls
|
|
17
|
+
each supplied factory at calculation start, including repeated arguments.
|
|
18
|
+
See :ref:`lazy-operators`.
|
|
19
|
+
|
|
20
|
+
The backend-specific ``ed_scipy``, ``xas_scipy``, and ``rixs_scipy`` functions
|
|
21
|
+
also require factories. These can return NumPy arrays, SciPy sparse matrices,
|
|
22
|
+
or a matrix-free
|
|
16
23
|
`LinearOperator <https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LinearOperator.html>`__.
|
|
17
24
|
ED uses SciPy's
|
|
18
25
|
`LOBPCG eigensolver <https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lobpcg.html>`__;
|
|
@@ -54,3 +61,7 @@ eigensolver tolerance accepted by ``ed``.
|
|
|
54
61
|
========
|
|
55
62
|
|
|
56
63
|
.. backend-options:: scipy rixs
|
|
64
|
+
|
|
65
|
+
``linsys_tol`` sets GMRES's relative tolerance, passed as ``rtol`` (or ``tol``
|
|
66
|
+
in older SciPy). With the ``rtol`` API, EDRIXS sets the absolute tolerance
|
|
67
|
+
``atol`` to zero.
|
|
@@ -15,8 +15,6 @@ Energies and naming
|
|
|
15
15
|
===================
|
|
16
16
|
|
|
17
17
|
* **Electron and hole language.** EDRIXS uses electron language by default.
|
|
18
|
-
Using hole language involves inverting the energy levels in ``emat`` and
|
|
19
|
-
taking the conjugate transpose of the absorption and emission operators.
|
|
20
18
|
* **Units.** All energies are in **eV**.
|
|
21
19
|
* **Initial and intermediate states.** Throughout EDRIXS, an ``_i`` suffix
|
|
22
20
|
labels the initial and final states, which have no core hole, while ``_n``
|
|
@@ -47,11 +45,17 @@ labels without increasing the number of states. This convention avoids the
|
|
|
47
45
|
energy corrections needed when filled core orbitals are omitted and simplifies
|
|
48
46
|
the construction of transition operators.
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
Numerical diagonalization can lose precision when the diagonal entries have a
|
|
49
|
+
large common energy offset.
|
|
50
|
+
For this reason, model constructors also return an energy offset, ``shift``.
|
|
51
|
+
Passing it to :func:`~edrixs.solvers.ed` with the dense, SciPy, or PETSc backend subtracts
|
|
52
|
+
the offset from the Hamiltonian diagonal before diagonalization and restores
|
|
53
|
+
it to the returned eigenvalues. This preserves the physics while reducing
|
|
54
|
+
numerical errors caused by subtracting large, nearly equal numbers.
|
|
55
|
+
|
|
56
|
+
When computing XAS or RIXS, the relevant resonant denominator is absorbed
|
|
57
|
+
into the matrix prior to the matrix operations, so a separate ``shift`` is
|
|
58
|
+
not needed.
|
|
55
59
|
|
|
56
60
|
Default orbital ordering and single-particle bases
|
|
57
61
|
==================================================
|
|
@@ -132,10 +136,12 @@ Spectral conventions
|
|
|
132
136
|
``loc_axis`` (model) or ``scatter_axis`` (solver) to change this.
|
|
133
137
|
* **Polarization** is given as a list of channels. For XAS, each entry is
|
|
134
138
|
``(kind, angle)`` with ``kind`` one of ``'linear'``, ``'left'``, ``'right'``
|
|
135
|
-
or ``'isotropic'`` (the last for powders).
|
|
136
|
-
``(in_kind, in_angle, out_kind, out_angle)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
or ``'isotropic'`` (the last for powders). For RIXS each entry is a 4-tuple
|
|
140
|
+
``(in_kind, in_angle, out_kind, out_angle)``, where each kind is ``'linear'``,
|
|
141
|
+
``'left'``, or ``'right'``; sum the two outgoing channels when the experiment
|
|
142
|
+
does not resolve emitted polarization. ``'isotropic'`` is not supported for
|
|
143
|
+
RIXS and is rejected with a warning.
|
|
144
|
+
* **Broadening** is a Lorentzian half width at half maximum. ``gamma_c`` is the
|
|
139
145
|
inverse core-hole lifetime (it dominates XAS and the incident-energy axis of
|
|
140
146
|
RIXS); ``gamma_f`` is the final-state or resolution width on the RIXS
|
|
141
147
|
energy-loss axis. ``gamma_c`` may be a scalar or an array with the same
|
|
@@ -43,7 +43,9 @@ and activate the build environment::
|
|
|
43
43
|
mamba create --name edrixs_env -c conda-forge --strict-channel-priority \
|
|
44
44
|
python=3.14 "numpy>=2" scipy sympy matplotlib mpi4py \
|
|
45
45
|
"arpack=*=mpi_openmpi*" openmpi gfortran \
|
|
46
|
-
"
|
|
46
|
+
"petsc=*=complex_*" petsc4py \
|
|
47
|
+
"slepc=*=complex_*" slepc4py \
|
|
48
|
+
"libblas=*=*openblas" cmake ninja numba pip setuptools wheel \
|
|
47
49
|
sphinx ipython numpydoc pillow sphinx-copybutton sphinx-gallery \
|
|
48
50
|
sphinx_rtd_theme pytest
|
|
49
51
|
conda activate edrixs_env
|
|
@@ -76,6 +78,10 @@ requirements. The supported versions and required components are:
|
|
|
76
78
|
``mpif90`` and ``mpicc`` wrappers are used in the recommended environment
|
|
77
79
|
* mpi4py 4 or newer, built with the same MPI implementation used to build
|
|
78
80
|
edrixs
|
|
81
|
+
* PETSc and SLEPc built for double-precision complex scalars
|
|
82
|
+
(``complex128``), together with petsc4py and slepc4py. The
|
|
83
|
+
``*=complex_*`` package specifications select these complex conda-forge
|
|
84
|
+
builds.
|
|
79
85
|
* BLAS and LAPACK; OpenBLAS 0.3 is used in the recommended environment
|
|
80
86
|
* `ARPACK-NG <https://github.com/opencollab/arpack-ng/>`_ 3.9 or newer,
|
|
81
87
|
built with MPI support
|
|
@@ -48,12 +48,15 @@ overview as needed.
|
|
|
48
48
|
The physical model
|
|
49
49
|
==================
|
|
50
50
|
|
|
51
|
-
There are
|
|
51
|
+
There are four ``edrixs.models`` constructors:
|
|
52
52
|
|
|
53
53
|
* :func:`~edrixs.models.model_1v1c` -- one valence shell and one core shell
|
|
54
54
|
(for example, Cu :math:`3d` and :math:`2p`).
|
|
55
55
|
* :func:`~edrixs.models.model_2v1c` -- two valence shells and one core shell.
|
|
56
56
|
* :func:`~edrixs.models.model_siam` -- an Anderson impurity model.
|
|
57
|
+
* :func:`~edrixs.models.model_siam_2d1p` -- a commonly used special case of the
|
|
58
|
+
Anderson impurity model with one :math:`d` impurity shell, one bath shell,
|
|
59
|
+
and one :math:`p` core shell (for L-edge spectroscopy).
|
|
57
60
|
|
|
58
61
|
Each returns a description of the problem, building no operators itself:
|
|
59
62
|
|
|
@@ -105,26 +108,33 @@ Many-body operators
|
|
|
105
108
|
The second stage picks the many-body Fock basis :math:`\lvert \Phi \rangle`
|
|
106
109
|
defined above and evaluates the Hamiltonian in it.
|
|
107
110
|
|
|
108
|
-
:func:`~edrixs.solvers.build_op`
|
|
111
|
+
:func:`~edrixs.solvers.build_op` prepares one many-body operator:
|
|
109
112
|
|
|
110
113
|
* ``emat``, ``umat`` -- the one- and two-body coefficients from the first
|
|
111
114
|
stage. Pass ``None`` for whichever of the two is absent.
|
|
112
115
|
* ``basis`` -- a Fock-basis specification, or a realized basis.
|
|
113
116
|
* ``backend`` -- the representation the operator is returned in.
|
|
114
117
|
|
|
115
|
-
It returns
|
|
116
|
-
|
|
118
|
+
It returns a zero-argument callable with a ``.backend`` label. Calling it builds
|
|
119
|
+
the matrix :math:`\langle \Phi_l \rvert \hat{H} \lvert \Phi_r
|
|
120
|
+
\rangle` of the one- and two-body terms above. Each call builds a fresh matrix.
|
|
117
121
|
|
|
118
122
|
:func:`~edrixs.solvers.get_ops` is the spectroscopy-oriented wrapper, which
|
|
119
|
-
|
|
123
|
+
prepares everything an XAS or RIXS calculation needs in one call:
|
|
120
124
|
|
|
121
125
|
* ``emat_i``, ``umat_i``, ``basis_i`` and their ``_n`` counterparts -- the two
|
|
122
126
|
Fock spaces, without and with a core hole.
|
|
123
127
|
* ``trans_mat`` -- the Cartesian photon transition matrices from the model.
|
|
124
128
|
|
|
125
129
|
It returns ``hmat_i``, ``hmat_n`` and the many-body transition operators
|
|
126
|
-
``trans_ops
|
|
127
|
-
|
|
130
|
+
``trans_ops`` as labeled factories for numerical backends, or disk handles for
|
|
131
|
+
Fortran. Pass these directly to ``ed``, ``xas``, and ``rixs``; the solvers read
|
|
132
|
+
their ``.backend`` labels and pass the factories to the backend for matrix
|
|
133
|
+
construction. These solver functions
|
|
134
|
+
do not accept a ``backend`` keyword. Because XAS and RIXS connect states with
|
|
135
|
+
no core hole to states with exactly one core hole, keeping the two Hamiltonians
|
|
136
|
+
separate avoids the
|
|
137
|
+
need to generate a Hamiltonian that spans both spaces and makes
|
|
128
138
|
the calculation more efficient.
|
|
129
139
|
|
|
130
140
|
The Fock-basis encoding and the valence-before-core orbital ordering that both
|
|
@@ -143,10 +153,10 @@ The third stage finds the low-energy eigenstates of the many-body Hamiltonian.
|
|
|
143
153
|
* ``eval_i`` is a 1D real array ordered by increasing energy.
|
|
144
154
|
* For the ``dense`` and ``scipy`` backends ``evec_i`` is a 2D complex array; the
|
|
145
155
|
eigenvector belonging to ``eval_i[k]`` is the column ``evec_i[:, k]``.
|
|
146
|
-
*
|
|
147
|
-
|
|
156
|
+
* For the ``petsc`` backend ``evec_i`` is a list of distributed PETSc vectors,
|
|
157
|
+
one for each value in ``eval_i``.
|
|
148
158
|
|
|
149
|
-
Dense and
|
|
159
|
+
Dense, SciPy, and PETSc ED accept ``shift=shift``, where ``shift`` is the eighth
|
|
150
160
|
output of a model constructor. They diagonalize :math:`H - \mathrm{shift} I`
|
|
151
161
|
and restore the offset in ``eval_i``. The Hamiltonian supplied by the caller
|
|
152
162
|
remains unchanged, so XAS and RIXS continue using the same energy reference.
|
|
@@ -9,6 +9,9 @@ This example uses :func:`~edrixs.models.model_siam_2d1p` to calculate Ni
|
|
|
9
9
|
contains a correlated Ni :math:`3d` shell and one bath site representing ten
|
|
10
10
|
symmetry-adapted O :math:`2p` ligand spin-orbitals. Hybridization allows the
|
|
11
11
|
calculation to include ligand-to-metal charge-transfer configurations.
|
|
12
|
+
The distributed PETSc/SLEPc backend is used for the many-body operators and
|
|
13
|
+
solvers. The example runs on one process during the documentation build, or it
|
|
14
|
+
can be run in parallel with ``mpirun``.
|
|
12
15
|
|
|
13
16
|
The nominal impurity occupancy is ``nd=8``. The wrapper fixes one full
|
|
14
17
|
bath, so the initial valence sector contains 18 electrons; the intermediate
|