boltzpmp
boltzpmp は、プロパゲータ法で電子ボルツマン方程式を解く、Rustで高速化された
Pythonパッケージです。DC・RF電場における電子エネルギー分布、平均エネルギー、
ドリフト速度、反応速度係数を計算できます。
インストール
Python 3.10以降が必要です。
uv pip install boltzpmp
クイックスタート
import boltzpmp as bp
mixture = bp.load_argon()
solver = bp.PMSolver(
mixture,
eps_max_eV=25.0,
d_eps_eV=0.2,
n_theta=90,
)
result = solver.solve_dc(EN_Td=10.0)
print(result.mean_energy)
print(result.drift_velocity)
print(result.rate_coefficients)
RF周期定常計算も同じソルバーから実行できます。
result = solver.solve_rf(EN_rms_Td=10.0, freq_Hz=13.56e6)
print(result.mean_energy_rms, result.drift_velocity_rms)
独立した換算電場点は、Rust計算中にPythonインタープリタを解放して並列実行できます。
results = bp.solve_dc_sweep(
solver,
[0.5, 1.0, 2.0, 5.0, 10.0],
max_workers=4,
scheme="upwind",
)
計算点の並列化には solve_dc_sweep を使用してください。単一計算内の並列化は
PMSolver(..., parallel=True) で明示的に有効化できます。
LXCat断面積による検証
2026-08-15に、LXCatのMorgan databaseから取得したAr電子衝突断面積セットを使い、 1、10、50、100 Tdのupwind計算と、10、100 Tdの自動ブレンディング計算を検証しました。 6条件すべてが収束し、Python参照実装との比較は次の結果でした。
| 指標 | 最大誤差 | 合格基準 |
|---|---|---|
| 状態分布のL1差 | 3.52e-14 |
1e-5 |
| EEDFの相対L1差 | 3.55e-14 |
1e-5 |
| 主要物理量の相対差 | 3.63e-14 |
1e-5 |
| 反応速度係数の相対差 | 4.06e-14 |
1e-5 |
入力ファイルのSHA-256は
29c903d91e68bb0895f45b763c8c982ef09c2b2e0636fc75fd0545dc7d69abc3 です。
条件、収束ステップ数、各物理量、生の誤差は
VALIDATION.md と
reference/lxcat_morgan_argon_validation.json
に記録しています。
開発とテスト
Windows PowerShellでは次のコマンドを実行します。
$env:UV_CACHE_DIR = Join-Path (Get-Location) '.uv-cache'
uv run --with maturin maturin develop --release
uv run --extra test pytest -q
cargo test --workspace
実データ検証は、断面積ファイルとPython参照実装の場所を指定して再実行できます。
$env:UV_CACHE_DIR = Join-Path (Get-Location) '.uv-cache'
uv run --with scipy --extra test python benchmarks\validate_lxcat.py `
'C:\path\to\Ar-cross-sections.txt' `
--reference-source 'C:\path\to\python-reference' `
--output reference\lxcat_morgan_argon_validation.json
現在のテスト構成はRust単体テスト4件、Python API・物理テスト15件です。
パッケージ公開
.github/workflows/wheels.yml を手動実行すると、Windows、Linux、macOS向けwheelと
sdistを作成します。全ビルド成功後、選択した公開先へOIDC Trusted Publishingで
配布します。
| workflow入力 | 公開先 | GitHub Environment |
|---|---|---|
publish_testpypi |
TestPyPI | testpypi |
publish_pypi |
PyPI | pypi |
TestPyPI版を確認する場合は、依存パッケージと本体の取得先を分けます。
uv pip install "numpy>=1.22"
uv pip install --no-deps --index-url https://test.pypi.org/simple/ boltzpmp
Trusted PublisherにはOwner Reasonia-TK、Repository boltzpmp、Workflow
wheels.yml と、公開先に対応するEnvironmentを設定します。
ライセンス
MIT License
Release files for boltzpmp 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| boltzpmp-0.1.3.tar.gz | 33.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| boltzpmp-0.1.3-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| boltzpmp-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| boltzpmp-0.1.3-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 1.1 MB
Release files / boltzpmp-0.1.3.tar.gz
| Download URL | boltzpmp-0.1.3.tar.gz |
|---|---|
| Size | 33.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44463454959bd0ac1b69877335ce577483853bca28287dc18675cf2cb7f27715
|
|
BLAKE2b-256 checksum How to use checksums |
155d0deffe070deb0a95d893ac200331d8d1699d454ca51bbccfb35fb11a8263
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / boltzpmp-0.1.3-cp310-abi3-win_amd64.whl
| Download URL | boltzpmp-0.1.3-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 258.6 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b30a12a2713a0f3aa545ac8233e51b0701c2c971ca90f2d8ba8936d4e87056d1
|
|
BLAKE2b-256 checksum How to use checksums |
f1578238d85e10b2a91eea5024bd909f822764754c46003a68a583591560213f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / boltzpmp-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | boltzpmp-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 422.1 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
47ca96b9d1934ac937b2f11369bd4206f8abcb5460d977143faa88412960a973
|
|
BLAKE2b-256 checksum How to use checksums |
11068a6877ed77a6c4737e0b3ca6348dfc08618dfdc0e9291fedc83d913761c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / boltzpmp-0.1.3-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | boltzpmp-0.1.3-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 371.3 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
054c77ddfcee799cfcfeda668c13b75758e6dc11239a4672c4180bfaeaf95e7c
|
|
BLAKE2b-256 checksum How to use checksums |
fb516fbd1734534532eb89805cb7b8627c7e69c6344c9ffb25fb8aa836d920a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency log