Standalone multilayer graphene Hamiltonians and single-particle utilities.
Project description
contimod_graphene
contimod_graphene is a standalone Python package for multilayer graphene tight-binding Hamiltonians, parameter sets, basis metadata, and related single-particle utilities.
This is a public preview release series. The package is still pre-1.0, so APIs, parameter conventions, and preset details may still change between minor releases; pin an exact version if you need stable downstream behavior.
Current scope includes:
- Bernal (ABA) stacking
- Rhombohedral (ABC) stacking
- Immutable, JSON-backed parameter sets
- Standalone model objects with thin wrappers over the kernel layer
- Basis and symmetry helpers
- JAX-friendly batched Hamiltonian evaluation
It includes both zero-field Hamiltonians and Landau-level (LL) Hamiltonians.
The maintained starting points are:
- the top-level public API shown below
- docs/usage.md
- examples/standalone_gallery.py
- examples/standalone_quickstart.py
For examples/tests on this machine, prefer JAX_PLATFORMS=cpu; the Apple Metal backend still hits known JAX failures in this repo.
Quick Start
For an ABC-trilayer Hamiltonian, its low-energy 2-band reduction, and a bilayer LL matrix:
import numpy as np
import contimod_graphene as cg
params = cg.GrapheneTBParameters.preset("tlg").replace(U=20.0, Delta=0.0)
abc = cg.RhombohedralMultilayer(n_layers=3, params=params)
ab = cg.BernalMultilayer(n_layers=2)
print(abc.hamiltonian(0.1, 0.0).shape)
print(np.round(np.linalg.eigvalsh(np.asarray(abc.two_band_hamiltonian(0.02, 0.0))), 3))
print(ab.landau_level_hamiltonian(10.0, n_cut=6, valley="K").shape)
(6, 6)
[-10.178 11.608]
(22, 22)
If you want the maintained script rather than a pasted snippet:
JAX_PLATFORMS=cpu python examples/standalone_quickstart.py
The built-in ABC/TLG preset carries U=30.0 meV and Delta=-1.15 meV. The quickstart pins Delta=0.0 so the example isolates the outer-layer bias U.
The main public entry points are:
GrapheneTBParametersload_parameter_set(name_or_path)list_parameter_sets()BernalMultilayerRhombohedralMultilayer
Physicist-friendly aliases are also available:
ABAMultilayerABCMultilayer
For a slightly longer walkthrough with equations, conventions, and more outputs, see docs/usage.md. For maintained example material, start with examples/standalone_quickstart.py, docs/examples.md, and examples/README.md.
Physics At A Glance
The package exposes three common surfaces:
$$ H(\mathbf{k}) \psi_{n\mathbf{k}} = E_n(\mathbf{k}) \psi_{n\mathbf{k}} $$
$$ H^{ABC_N}_{2\mathrm{band}} \propto \begin{pmatrix} 0 & (\pi^\dagger)^N \ \pi^N & 0 \end{pmatrix}, \qquad E \propto k^N $$
$$ \dim H_{\mathrm{LL}} = n_{\mathrm{layers}} \left(2 n_{\mathrm{cut}} - 1\right) $$
Useful parameter conventions:
- Bernal
Deltais the package A/B sublattice mass term, while Bernaldeltais the dimer/non-dimer onsite offset. - Rhombohedral
Deltamatches the usual trilayerΔ2meaning forn_layers=3; for thicker stacks it is reused as a package-specific inversion-even layer-curvature parameter. - LL builders return dense matrices, so the size formula above matters quickly when you increase
n_cut.
Low-Level Modules
The low-level kernel modules remain available for advanced use, JAX-focused workflows, and direct access to the functional core:
contimod_graphene.bernalcontimod_graphene.rhombohedralcontimod_graphene.paramscontimod_graphene.basiscontimod_graphene.symmetrycontimod_graphene.landaucontimod_graphene.utils
Installation
Install from PyPI:
pip install contimod-graphene
Quick smoke check:
python -c "import contimod_graphene as cg; print(cg.list_parameter_sets())"
The distribution name on PyPI uses a hyphen, but the Python import remains contimod_graphene.
If you want the unreleased main branch instead of the latest published version:
pip install git+https://github.com/skilledwolf/contimod_graphene.git
For local development, clone the repo and run pip install -e ".[dev]". If you prefer hatch, use hatch env create and hatch shell.
Author
Tobias Wolf (public@wolft.xyz) is the author and maintainer of this package. Please give appropriate credit if you use this work.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contimod_graphene-0.1.1.tar.gz.
File metadata
- Download URL: contimod_graphene-0.1.1.tar.gz
- Upload date:
- Size: 170.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cc7629d6193ee2b23882f8951646e8bee15bac206dd5270a64298c625738c11
|
|
| MD5 |
22b2346558056ecc3f2ccce6d32f4551
|
|
| BLAKE2b-256 |
2692f6650a8ec95e2d10851319bf1564491a64ac519ac97689c40ecb7db94fdf
|
Provenance
The following attestation bundles were made for contimod_graphene-0.1.1.tar.gz:
Publisher:
release.yml on skilledwolf/contimod_graphene
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contimod_graphene-0.1.1.tar.gz -
Subject digest:
3cc7629d6193ee2b23882f8951646e8bee15bac206dd5270a64298c625738c11 - Sigstore transparency entry: 1203917955
- Sigstore integration time:
-
Permalink:
skilledwolf/contimod_graphene@4be2eb6f9315e7f7bf615435be07e6ea064e0e35 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/skilledwolf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4be2eb6f9315e7f7bf615435be07e6ea064e0e35 -
Trigger Event:
push
-
Statement type:
File details
Details for the file contimod_graphene-0.1.1-py3-none-any.whl.
File metadata
- Download URL: contimod_graphene-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1224b17adefc74d3d9176ee9a88e8eff5359090af7d22bb5017b3872abae481f
|
|
| MD5 |
a3147050a21606098cb697d1dab54387
|
|
| BLAKE2b-256 |
54b01d0a72c2da02a634d8e0d00bef743c83f3ec2bf357dd3ad6633b97909897
|
Provenance
The following attestation bundles were made for contimod_graphene-0.1.1-py3-none-any.whl:
Publisher:
release.yml on skilledwolf/contimod_graphene
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contimod_graphene-0.1.1-py3-none-any.whl -
Subject digest:
1224b17adefc74d3d9176ee9a88e8eff5359090af7d22bb5017b3872abae481f - Sigstore transparency entry: 1203917998
- Sigstore integration time:
-
Permalink:
skilledwolf/contimod_graphene@4be2eb6f9315e7f7bf615435be07e6ea064e0e35 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/skilledwolf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4be2eb6f9315e7f7bf615435be07e6ea064e0e35 -
Trigger Event:
push
-
Statement type: