quantumhall-matrixelements 0.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 (28) hide show
  1. quantumhall_matrixelements-0.1.0/.github/workflows/build-and-test.yml +34 -0
  2. quantumhall_matrixelements-0.1.0/.github/workflows/release.yml +45 -0
  3. quantumhall_matrixelements-0.1.0/.gitignore +56 -0
  4. quantumhall_matrixelements-0.1.0/CITATION.cff +15 -0
  5. quantumhall_matrixelements-0.1.0/LICENSE +22 -0
  6. quantumhall_matrixelements-0.1.0/PKG-INFO +177 -0
  7. quantumhall_matrixelements-0.1.0/README.md +146 -0
  8. quantumhall_matrixelements-0.1.0/examples/compare_exchange_backends.py +43 -0
  9. quantumhall_matrixelements-0.1.0/examples/plot_exchange_kernels_radial.py +43 -0
  10. quantumhall_matrixelements-0.1.0/examples/plot_form_factors_radial.py +38 -0
  11. quantumhall_matrixelements-0.1.0/pyproject.toml +74 -0
  12. quantumhall_matrixelements-0.1.0/setup.cfg +4 -0
  13. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/__init__.py +80 -0
  14. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/_debug_symmetry.py +50 -0
  15. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/diagnostic.py +53 -0
  16. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/exchange_gausslag.py +163 -0
  17. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/exchange_hankel.py +165 -0
  18. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/exchange_legendre.py +186 -0
  19. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements/planewave.py +87 -0
  20. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements.egg-info/PKG-INFO +177 -0
  21. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements.egg-info/SOURCES.txt +26 -0
  22. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements.egg-info/dependency_links.txt +1 -0
  23. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements.egg-info/requires.txt +11 -0
  24. quantumhall_matrixelements-0.1.0/src/quantumhall_matrixelements.egg-info/top_level.txt +1 -0
  25. quantumhall_matrixelements-0.1.0/tests/test_exchange_kernels.py +37 -0
  26. quantumhall_matrixelements-0.1.0/tests/test_exchange_legendre.py +32 -0
  27. quantumhall_matrixelements-0.1.0/tests/test_form_factors.py +72 -0
  28. quantumhall_matrixelements-0.1.0/tests/test_validation.py +95 -0
@@ -0,0 +1,34 @@
1
+ name: build-and-test
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Build sdist and wheel
23
+ run: |
24
+ python -m pip install -U pip build
25
+ python -m build -s -w
26
+
27
+ - name: Install wheel and smoke-check metadata
28
+ run: |
29
+ python -m pip install dist/*.whl
30
+ python - << 'PY'
31
+ import importlib.metadata as md
32
+ print("quantumhall_matrixelements version:", md.version("quantumhall_matrixelements"))
33
+ PY
34
+
@@ -0,0 +1,45 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build-and-publish:
11
+ runs-on: ubuntu-latest
12
+ # 👇 This must match exactly the environment you configure on PyPI
13
+ environment: release
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Build sdist and wheel
27
+ run: |
28
+ python -m pip install -U pip build
29
+ python -m build -s -w
30
+
31
+ - name: Smoke-check package metadata
32
+ run: |
33
+ python -m pip install dist/*.whl
34
+ python - << 'PY'
35
+ import importlib.metadata as md
36
+ print("quantumhall_matrixelements version:", md.version("quantumhall_matrixelements"))
37
+ PY
38
+
39
+ # Only publish on tag refs like v0.1.0
40
+ - name: Publish to PyPI via OIDC (Trusted Publisher)
41
+ if: startsWith(github.ref, 'refs/tags/v')
42
+ uses: pypa/gh-action-pypi-publish@release/v1
43
+ with:
44
+ packages-dir: dist/
45
+
@@ -0,0 +1,56 @@
1
+
2
+ # Python
3
+ __pycache__/
4
+ *.pyc
5
+ *.pyo
6
+ *.pyd
7
+ .Python
8
+ env/
9
+ venv/
10
+ .env
11
+ .venv
12
+ pip-log.txt
13
+ pip-delete-this-directory.txt
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ build/
18
+ develop-eggs/
19
+ dist/
20
+ downloads/
21
+ eggs/
22
+ .eggs/
23
+ lib/
24
+ lib64/
25
+ parts/
26
+ sdist/
27
+ var/
28
+ wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+
33
+ # Unit test / coverage reports
34
+ htmlcov/
35
+ .tox/
36
+ .nox/
37
+ .coverage
38
+ .coverage.*
39
+ .cache
40
+ nosetests.xml
41
+ coverage.xml
42
+ *.cover
43
+ *.py,cover
44
+ .hypothesis/
45
+ .pytest_cache/
46
+
47
+ # Jupyter Notebook
48
+ .ipynb_checkpoints
49
+
50
+ # IDEs
51
+ .vscode/
52
+ .idea/
53
+ *.swp
54
+
55
+ # OS
56
+ .DS_Store
@@ -0,0 +1,15 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ type: software
4
+ title: "quantumhall_matrixelements: Quantum Hall Landau-Level Matrix Elements"
5
+ version: "0.1.0"
6
+ doi: 10.5281/zenodo.17646027
7
+ date-released: "2025-11-18"
8
+ authors:
9
+ - family-names: Wolf
10
+ given-names: Tobias
11
+ repository-code: "https://github.com/wolft/quantumhall_matrixelements"
12
+ license: MIT
13
+ abstract: >
14
+ Landau-level plane-wave form factors and exchange kernels for quantum Hall systems,
15
+ with multiple numerical backends and symmetry diagnostics.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tobias Wolf
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: quantumhall_matrixelements
3
+ Version: 0.1.0
4
+ Summary: Landau-level plane-wave form factors and exchange kernels for quantum Hall systems.
5
+ Author-email: Tobias Wolf <public@wolft.xyz>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/wolft/quantumhall_matrixelements
8
+ Project-URL: Issues, https://github.com/wolft/quantumhall_matrixelements/issues
9
+ Keywords: quantum Hall,matrix elements,form factors,exchange kernels,Landau levels
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Topic :: Scientific/Engineering :: Physics
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: numpy>=1.26
21
+ Requires-Dist: scipy>=1.11
22
+ Requires-Dist: hankel>=1.2
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest>=8.0; extra == "dev"
25
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
26
+ Requires-Dist: ruff>=0.5.0; extra == "dev"
27
+ Requires-Dist: mypy>=1.10; extra == "dev"
28
+ Requires-Dist: build; extra == "dev"
29
+ Requires-Dist: twine; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # quantumhall-matrixelements: Quantum Hall Landau-Level Matrix Elements
33
+
34
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17646027.svg)](https://doi.org/10.5281/zenodo.17646027)
35
+
36
+ Landau-level plane-wave form factors and exchange kernels for quantum Hall systems.
37
+
38
+ This library factors out the continuum matrix-element kernels used in Hartree–Fock and
39
+ related calculations into a small, reusable package. It provides:
40
+
41
+ - Analytic Landau-level plane-wave form factors $F_{n',n}(\mathbf{q})$.
42
+ - Exchange kernels $X_{n_1 m_1 n_2 m_2}(\mathbf{G})$ computed via:
43
+ - Gauss-Legendre quadrature with rational mapping (`gausslegendre` backend, default).
44
+ - Generalized Gauss–Laguerre quadrature (`gausslag` backend).
45
+ - Hankel-transform based integration (`hankel` backend).
46
+ - Symmetry diagnostics for verifying kernel implementations on a given G-grid.
47
+
48
+ ## Backends and Reliability
49
+
50
+ The package provides three backends for computing exchange kernels, each with different performance and stability characteristics:
51
+
52
+ 1. **`gausslegendre` (Default)**:
53
+ - **Method**: Gauss-Legendre quadrature mapped from $[-1, 1]$ to $[0, \infty)$ via a rational mapping.
54
+ - **Pros**: Fast and numerically stable for all Landau level indices ($n$).
55
+ - **Cons**: May require tuning `nquad` for extremely large momenta or indices ($n > 100$).
56
+ - **Recommended for**: General usage, especially for large $n$ ($n \ge 10$).
57
+
58
+ 2. **`gausslag`**:
59
+ - **Method**: Generalized Gauss-Laguerre quadrature.
60
+ - **Pros**: Very fast for small $n$.
61
+ - **Cons**: Numerically unstable for large $n$ ($n \ge 12$) due to high-order Laguerre polynomial roots.
62
+ - **Recommended for**: Small systems ($n < 10$) where speed is critical.
63
+
64
+ 3. **`hankel`**:
65
+ - **Method**: Discrete Hankel transform.
66
+ - **Pros**: High precision and stability.
67
+ - **Cons**: Significantly slower than quadrature methods.
68
+ - **Recommended for**: Reference calculations and verifying other backends.
69
+
70
+ ## Mathematical Definitions
71
+
72
+ ### Plane-Wave Form Factors
73
+
74
+ The form factors are the matrix elements of the plane-wave operator $e^{i \mathbf{q} \cdot \mathbf{R}}$ in the Landau level basis $|n\rangle$:
75
+
76
+ $$ F_{n',n}(\mathbf{q}) = \langle n' | e^{i \mathbf{q} \cdot \mathbf{R}} | n \rangle $$
77
+
78
+ Analytically, these are given by:
79
+
80
+ $$
81
+ F_{n',n}(\mathbf{q}) =
82
+ i^{|n-n'|}
83
+ e^{i(n-n')\theta_{\mathbf{q}}}
84
+ \sqrt{\frac{n_{<}!}{n_{>}!}}
85
+ \left( \frac{|\mathbf{q}|\ell_{B}}{\sqrt{2}} \right)^{|n-n'|}
86
+ L_{n_<}^{|n-n'|}\left( \frac{|\mathbf{q}|^2 \ell_{B}^2}{2} \right)
87
+ e^{-|\mathbf{q}|^2 \ell_{B}^2/4}
88
+ $$
89
+
90
+ where $n_< = \min(n, n')$, $n_> = \max(n, n')$, and $L_n^\alpha$ are the generalized Laguerre polynomials, and $\ell_B$ is the magnetic length.
91
+
92
+ ### Exchange Kernels
93
+
94
+ The exchange kernels $X_{n_1 m_1 n_2 m_2}(\mathbf{G})$ are defined as the Fourier transform of the interaction potential weighted by the form factors:
95
+
96
+ $$ X_{n_1 m_1 n_2 m_2}(\mathbf{G}) = \int \frac{d^2 q}{(2\pi)^2} V(q) F_{n_1, m_1}(\mathbf{q}) F_{m_2, n_2}(-\mathbf{q}) e^{-i \mathbf{q} \cdot \mathbf{G} \ell_B^2} $$
97
+
98
+ where $V(q)$ is the interaction potential. For the Coulomb interaction, $V(q) = \frac{2\pi e^2}{\epsilon q}$.
99
+
100
+ ### Units and Interaction Strength
101
+
102
+ The package performs calculations in dimensionless units where lengths are scaled by $\ell_B$. The interaction strength is parameterized by a dimensionless prefactor $\kappa$.
103
+
104
+ - **Coulomb Interaction**: The code assumes a potential of the form $V(q) = \kappa \frac{2\pi \ell_B}{q \ell_B}$ (in effective dimensionless form).
105
+ - If you set `kappa = 1.0`, the resulting exchange kernels will be in units of the **Coulomb energy scale** $E_C = e^2 / (\epsilon \ell_B)$.
106
+ - If you want the results in units of the cyclotron energy $\hbar \omega_c$, you should set $\kappa = E_C / (\hbar \omega_c) = (e^2/\epsilon \ell_B) / (\hbar \omega_c)$.
107
+
108
+ - **General Potential**: For a general $V(q)$, the function `V_of_q` should return values in your desired energy units. The integration measure $d^2q/(2\pi)^2$ introduces a factor of $1/\ell_B^2$, so ensure your potential scaling is consistent.
109
+
110
+ ## Installation
111
+
112
+ From PyPI (once published):
113
+
114
+ ```bash
115
+ pip install quantumhall-matrixelements
116
+ ```
117
+
118
+ From a local checkout (development install):
119
+
120
+ ```bash
121
+ pip install -e .[dev]
122
+ ```
123
+
124
+ ## Basic usage
125
+
126
+ ```python
127
+ import numpy as np
128
+ from quantumhall_matrixelements import (
129
+ get_form_factors,
130
+ get_exchange_kernels,
131
+ )
132
+
133
+ # Simple G set: G0=(0,0), G+=(1,0), G-=(-1,0)
134
+ Gs_dimless = np.array([0.0, 1.0, 1.0])
135
+ thetas = np.array([0.0, 0.0, np.pi])
136
+ nmax = 2
137
+
138
+ F = get_form_factors(Gs_dimless, thetas, nmax) # shape (nG, nmax, nmax)
139
+ X = get_exchange_kernels(Gs_dimless, thetas, nmax) # default 'gausslegendre' backend
140
+
141
+ print("F shape:", F.shape)
142
+ print("X shape:", X.shape)
143
+ ```
144
+
145
+ For more detailed examples, see the example scripts under `examples/` and the tests under `tests/`.
146
+
147
+ ## Citation
148
+
149
+ If you use the package `quantumhall-matrixelements` in academic work, please cite:
150
+
151
+ > Tobias Wolf, *quantumhall-matrixelements: Quantum Hall Landau-Level Matrix Elements*, version 0.1.0, 2025.
152
+ > DOI: https://doi.org/10.5281/zenodo.17646027
153
+
154
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17646027.svg)](https://doi.org/10.5281/zenodo.17646027)
155
+
156
+ A machine-readable `CITATION.cff` file is included in the repository and can be used with tools that support it (for example, GitHub’s “Cite this repository” button).
157
+
158
+ ## Development
159
+
160
+ - Run tests and coverage:
161
+
162
+ ```bash
163
+ pytest
164
+ ```
165
+
166
+ - Lint and type-check:
167
+
168
+ ```bash
169
+ ruff check .
170
+ mypy .
171
+ ```
172
+
173
+ ## Authors and license
174
+
175
+ - Author: Tobias Wolf
176
+ - Copyright © 2025 Tobias Wolf
177
+ - License: MIT (see `LICENSE`).
@@ -0,0 +1,146 @@
1
+ # quantumhall-matrixelements: Quantum Hall Landau-Level Matrix Elements
2
+
3
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17646027.svg)](https://doi.org/10.5281/zenodo.17646027)
4
+
5
+ Landau-level plane-wave form factors and exchange kernels for quantum Hall systems.
6
+
7
+ This library factors out the continuum matrix-element kernels used in Hartree–Fock and
8
+ related calculations into a small, reusable package. It provides:
9
+
10
+ - Analytic Landau-level plane-wave form factors $F_{n',n}(\mathbf{q})$.
11
+ - Exchange kernels $X_{n_1 m_1 n_2 m_2}(\mathbf{G})$ computed via:
12
+ - Gauss-Legendre quadrature with rational mapping (`gausslegendre` backend, default).
13
+ - Generalized Gauss–Laguerre quadrature (`gausslag` backend).
14
+ - Hankel-transform based integration (`hankel` backend).
15
+ - Symmetry diagnostics for verifying kernel implementations on a given G-grid.
16
+
17
+ ## Backends and Reliability
18
+
19
+ The package provides three backends for computing exchange kernels, each with different performance and stability characteristics:
20
+
21
+ 1. **`gausslegendre` (Default)**:
22
+ - **Method**: Gauss-Legendre quadrature mapped from $[-1, 1]$ to $[0, \infty)$ via a rational mapping.
23
+ - **Pros**: Fast and numerically stable for all Landau level indices ($n$).
24
+ - **Cons**: May require tuning `nquad` for extremely large momenta or indices ($n > 100$).
25
+ - **Recommended for**: General usage, especially for large $n$ ($n \ge 10$).
26
+
27
+ 2. **`gausslag`**:
28
+ - **Method**: Generalized Gauss-Laguerre quadrature.
29
+ - **Pros**: Very fast for small $n$.
30
+ - **Cons**: Numerically unstable for large $n$ ($n \ge 12$) due to high-order Laguerre polynomial roots.
31
+ - **Recommended for**: Small systems ($n < 10$) where speed is critical.
32
+
33
+ 3. **`hankel`**:
34
+ - **Method**: Discrete Hankel transform.
35
+ - **Pros**: High precision and stability.
36
+ - **Cons**: Significantly slower than quadrature methods.
37
+ - **Recommended for**: Reference calculations and verifying other backends.
38
+
39
+ ## Mathematical Definitions
40
+
41
+ ### Plane-Wave Form Factors
42
+
43
+ The form factors are the matrix elements of the plane-wave operator $e^{i \mathbf{q} \cdot \mathbf{R}}$ in the Landau level basis $|n\rangle$:
44
+
45
+ $$ F_{n',n}(\mathbf{q}) = \langle n' | e^{i \mathbf{q} \cdot \mathbf{R}} | n \rangle $$
46
+
47
+ Analytically, these are given by:
48
+
49
+ $$
50
+ F_{n',n}(\mathbf{q}) =
51
+ i^{|n-n'|}
52
+ e^{i(n-n')\theta_{\mathbf{q}}}
53
+ \sqrt{\frac{n_{<}!}{n_{>}!}}
54
+ \left( \frac{|\mathbf{q}|\ell_{B}}{\sqrt{2}} \right)^{|n-n'|}
55
+ L_{n_<}^{|n-n'|}\left( \frac{|\mathbf{q}|^2 \ell_{B}^2}{2} \right)
56
+ e^{-|\mathbf{q}|^2 \ell_{B}^2/4}
57
+ $$
58
+
59
+ where $n_< = \min(n, n')$, $n_> = \max(n, n')$, and $L_n^\alpha$ are the generalized Laguerre polynomials, and $\ell_B$ is the magnetic length.
60
+
61
+ ### Exchange Kernels
62
+
63
+ The exchange kernels $X_{n_1 m_1 n_2 m_2}(\mathbf{G})$ are defined as the Fourier transform of the interaction potential weighted by the form factors:
64
+
65
+ $$ X_{n_1 m_1 n_2 m_2}(\mathbf{G}) = \int \frac{d^2 q}{(2\pi)^2} V(q) F_{n_1, m_1}(\mathbf{q}) F_{m_2, n_2}(-\mathbf{q}) e^{-i \mathbf{q} \cdot \mathbf{G} \ell_B^2} $$
66
+
67
+ where $V(q)$ is the interaction potential. For the Coulomb interaction, $V(q) = \frac{2\pi e^2}{\epsilon q}$.
68
+
69
+ ### Units and Interaction Strength
70
+
71
+ The package performs calculations in dimensionless units where lengths are scaled by $\ell_B$. The interaction strength is parameterized by a dimensionless prefactor $\kappa$.
72
+
73
+ - **Coulomb Interaction**: The code assumes a potential of the form $V(q) = \kappa \frac{2\pi \ell_B}{q \ell_B}$ (in effective dimensionless form).
74
+ - If you set `kappa = 1.0`, the resulting exchange kernels will be in units of the **Coulomb energy scale** $E_C = e^2 / (\epsilon \ell_B)$.
75
+ - If you want the results in units of the cyclotron energy $\hbar \omega_c$, you should set $\kappa = E_C / (\hbar \omega_c) = (e^2/\epsilon \ell_B) / (\hbar \omega_c)$.
76
+
77
+ - **General Potential**: For a general $V(q)$, the function `V_of_q` should return values in your desired energy units. The integration measure $d^2q/(2\pi)^2$ introduces a factor of $1/\ell_B^2$, so ensure your potential scaling is consistent.
78
+
79
+ ## Installation
80
+
81
+ From PyPI (once published):
82
+
83
+ ```bash
84
+ pip install quantumhall-matrixelements
85
+ ```
86
+
87
+ From a local checkout (development install):
88
+
89
+ ```bash
90
+ pip install -e .[dev]
91
+ ```
92
+
93
+ ## Basic usage
94
+
95
+ ```python
96
+ import numpy as np
97
+ from quantumhall_matrixelements import (
98
+ get_form_factors,
99
+ get_exchange_kernels,
100
+ )
101
+
102
+ # Simple G set: G0=(0,0), G+=(1,0), G-=(-1,0)
103
+ Gs_dimless = np.array([0.0, 1.0, 1.0])
104
+ thetas = np.array([0.0, 0.0, np.pi])
105
+ nmax = 2
106
+
107
+ F = get_form_factors(Gs_dimless, thetas, nmax) # shape (nG, nmax, nmax)
108
+ X = get_exchange_kernels(Gs_dimless, thetas, nmax) # default 'gausslegendre' backend
109
+
110
+ print("F shape:", F.shape)
111
+ print("X shape:", X.shape)
112
+ ```
113
+
114
+ For more detailed examples, see the example scripts under `examples/` and the tests under `tests/`.
115
+
116
+ ## Citation
117
+
118
+ If you use the package `quantumhall-matrixelements` in academic work, please cite:
119
+
120
+ > Tobias Wolf, *quantumhall-matrixelements: Quantum Hall Landau-Level Matrix Elements*, version 0.1.0, 2025.
121
+ > DOI: https://doi.org/10.5281/zenodo.17646027
122
+
123
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17646027.svg)](https://doi.org/10.5281/zenodo.17646027)
124
+
125
+ A machine-readable `CITATION.cff` file is included in the repository and can be used with tools that support it (for example, GitHub’s “Cite this repository” button).
126
+
127
+ ## Development
128
+
129
+ - Run tests and coverage:
130
+
131
+ ```bash
132
+ pytest
133
+ ```
134
+
135
+ - Lint and type-check:
136
+
137
+ ```bash
138
+ ruff check .
139
+ mypy .
140
+ ```
141
+
142
+ ## Authors and license
143
+
144
+ - Author: Tobias Wolf
145
+ - Copyright © 2025 Tobias Wolf
146
+ - License: MIT (see `LICENSE`).
@@ -0,0 +1,43 @@
1
+ """Compare Gauss–Laguerre and Hankel exchange-kernel backends.
2
+
3
+ For a small |G|â„“_B grid and nmax=2, this script computes the exchange
4
+ kernels using both the Gauss–Laguerre and Hankel backends and plots the
5
+ relative difference of a representative diagonal element X_{0000}(G).
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import numpy as np
10
+ import matplotlib.pyplot as plt
11
+
12
+ from quantumhall_matrixelements import get_exchange_kernels
13
+
14
+
15
+ def main() -> None:
16
+ nmax = 2
17
+ q = np.linspace(0.2, 3.0, 60)
18
+ theta = np.zeros_like(q)
19
+
20
+ X_gl = get_exchange_kernels(q, theta, nmax, method="gausslag")
21
+ X_hk = get_exchange_kernels(q, theta, nmax, method="hankel")
22
+
23
+ # Focus on X_{0000}(G) as a simple representative component
24
+ X_gl_diag = X_gl[:, 0, 0, 0, 0]
25
+ X_hk_diag = X_hk[:, 0, 0, 0, 0]
26
+
27
+ abs_diff = np.abs(X_gl_diag - X_hk_diag)
28
+ denom = np.maximum(np.abs(X_gl_diag), np.abs(X_hk_diag))
29
+ rel_diff = np.where(denom > 0, abs_diff / denom, 0.0)
30
+
31
+ fig, ax = plt.subplots()
32
+ ax.plot(q, rel_diff, marker="o", linestyle="-")
33
+ ax.set_xlabel(r"$|G| \ell_B$")
34
+ ax.set_ylabel(r"relative difference")
35
+ ax.set_title(r"Relative difference of $X_{0000}(G)$: Gauss–Laguerre vs Hankel")
36
+ ax.grid(True, alpha=0.3)
37
+ fig.tight_layout()
38
+ plt.show()
39
+
40
+
41
+ if __name__ == "__main__":
42
+ main()
43
+
@@ -0,0 +1,43 @@
1
+ """Exchange kernel diagonal elements X_{nnnn}(G) vs |G|â„“_B.
2
+
3
+ This example computes selected diagonal components of the exchange kernel
4
+ using the Gauss–Laguerre backend and plots their real parts as a function
5
+ of |G|â„“_B.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import numpy as np
10
+ import matplotlib.pyplot as plt
11
+
12
+ from quantumhall_matrixelements import get_exchange_kernels
13
+
14
+
15
+ def main() -> None:
16
+ nmax = 3
17
+ # Avoid G=0 to dodge the Coulomb singularity; start from small q
18
+ q = np.linspace(0.2, 4.0, 80)
19
+ theta = np.zeros_like(q)
20
+
21
+ X = get_exchange_kernels(q, theta, nmax, method="gausslag")
22
+
23
+ fig, ax = plt.subplots()
24
+ for n in range(nmax):
25
+ vals = X[:, n, n, n, n]
26
+ ax.plot(q, vals.real, label=fr"$\mathrm{{Re}}\,X_{{{n}{n}{n}{n}}}(G)$")
27
+
28
+ for n in range(1,nmax):
29
+ vals = X[:, n, n-1, n-1, n]
30
+ ax.plot(q, vals.real, label=fr"$\mathrm{{Re}}\,X_{{{n}{n-1}{n-1}{n}}}(G)$")
31
+
32
+ ax.set_xlabel(r"$|G| \ell_B$")
33
+ ax.set_ylabel(r"$\mathrm{Re}\,X_{nnnn}(G)$ (Îş=1)")
34
+ ax.set_title("Diagonal exchange kernels (Gauss–Laguerre backend)")
35
+ ax.legend()
36
+ ax.grid(True, alpha=0.3)
37
+ fig.tight_layout()
38
+ plt.show()
39
+
40
+
41
+ if __name__ == "__main__":
42
+ main()
43
+
@@ -0,0 +1,38 @@
1
+ """Radial Landau-level form factors F_{n',n}(q) vs qâ„“_B.
2
+
3
+ This example plots the lowest diagonal LL form factors as a function of
4
+ dimensionless momentum qâ„“_B, illustrating the Gaussian envelope and
5
+ Laguerre oscillations.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import numpy as np
10
+ import matplotlib.pyplot as plt
11
+
12
+ from quantumhall_matrixelements import get_form_factors
13
+
14
+
15
+ def main() -> None:
16
+ # Dimensionless |G|â„“_B grid
17
+ q = np.linspace(0.0, 5.0, 400)
18
+ theta = np.zeros_like(q)
19
+ nmax = 3
20
+
21
+ F = get_form_factors(q, theta, nmax) # shape (nq, nmax, nmax)
22
+
23
+ fig, ax = plt.subplots()
24
+ for n in range(nmax):
25
+ ax.plot(q, F[:, n, n].real, label=fr"$\mathrm{{Re}}\,F_{{{n}{n}}}(q)$")
26
+
27
+ ax.set_xlabel(r"$q \ell_B$")
28
+ ax.set_ylabel(r"$\mathrm{Re}\,F_{nn}(q)$")
29
+ ax.set_title("Diagonal Landau-level form factors")
30
+ ax.legend()
31
+ ax.grid(True, alpha=0.3)
32
+ fig.tight_layout()
33
+ plt.show()
34
+
35
+
36
+ if __name__ == "__main__":
37
+ main()
38
+