DipolEq
Dipole equilibrium design code
Based on "TokaMac v2.0" by L. Bai and M. Mauel at Columbia University.
Can be used to show high beta equilibria in a dipole confined plasma. In other words, solve the Grad-Shafranov equation in a machine with an "first closed flux surface" and no toroidal field.
The code is licensed under the MIT license. (Except for the ClibPDF code, which no longer is available but was licensed for free use in academic use. This code is not linked into the python package version of this code.)
If you use this code, please reference this paper as source.
D. T. Garnier, J. Kesner, and M. E. Mauel, “Magnetohydrodynamic stability in a levitated dipole,” Phys. Plasmas, vol. 6, no. 9, pp. 3431–3434, Jan. 1999, doi: 10.1063/1.873601.
Conventions
DipolEq follows COCOS 11. Psi is the total poloidal flux through a toroidal loop at (R, Z), in webers -- not webers per radian:
B_R = 1/(2 pi R) dPsi/dZ
B_Z = -1/(2 pi R) dPsi/dR
This holds for the Python interface and the HDF5 output. Codes using COCOS 1-8, such as g-eqdsk files, use flux per radian, Psi / (2 pi) (and some, e.g. COCOS 3, also flip the sign); h5togeqdsk handles both.
C Code - Command Line Version
Compilation
The original code is written in C (and some C++) and gives a command line interface, that outputs a PDF, HDF5 and other output files. The code can be compiled with cmake. There are example codes for how to process hdf5 files (into, for example an EFIT gfile) in the postprocess directory.
Dependencies
Ubuntu
The recommended build is for hdf5, zlib and libjpeg libraries to be installed:
sudo apt install cmake gcc zlib1g-dev libjpeg-dev libhdf5-dev
macOS
cmake and hdf5 can be installed with macports or homebrew and should be enough to compile the code.
brew install cmake hdf5
or
sudo port install cmake hdf5
Build and Install
The code can be configured and compiled with cmake. The recommended way to compile is to create a build directory and run cmake from there:
cd dipoleq
mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --install .
Usage
The code can be run from the command line with the following command:
dipoleq -f <input_file>
See the Testing directories for examples of input files [*.in].
There is a second command line tool that can be used to generate a EFIT gfile from the output hdf5 file:
dipoleq_geqdsk <output.h5>
Python Module Interface
A python version of the code is now available. This relies on the pybind11 library to wrap the C code into a python module. This wraps the main features of the code into a python module, although the outer loop of the code is now in python. The python module is not yet fully documented, but the main features are available, and regularly tested against the original C code. For packaging, the "scikit-build-core" package is used to build the code using a standard pyproject.toml file.
Complilation
The python module can be compiled with the following command:
pip install .
This may install in your user directory or in a virtual environment. It will also install the dipoleq and dipoleq_geqdsk command line tools as well, though these are actually calls to the python / pybind11 version of the code and no longer include ClibPDF or HDF5 directly. This may become the preferred way to install the code in the future.
Usage
Python usage is still in development. More on this soon.
Metadata
Release files for dipoleq 0.11.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 | Provenance | Actions |
|---|---|---|---|---|
| dipoleq-0.11.3.tar.gz | 3.3 MB | With provenance | Details for dipoleq-0.11.3.tar.gz |
Built distributions (wheels)
Total release size: 9.0 MB
Release files / dipoleq-0.11.3.tar.gz
| Download URL | dipoleq-0.11.3.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9819ce827f2396b72c1321511f7fd7a411cde25ebdd8efb27d8d1af96738f3fb
|
|
BLAKE2b-256 checksum How to use checksums |
740d6ace34f421db4accf1e604c07ecb880090d5b2ae28ecb2f4170397e87cda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dipoleq-0.11.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 414.5 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e51659fb32ec1516f43e315989d8af60471b862176ac79a884b6a572acc63a99
|
|
BLAKE2b-256 checksum How to use checksums |
052f1014ea2ec576ef5a872978562b798f74c7ad648f4cce422cb254d48b0519
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | dipoleq-0.11.3-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 336.6 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5b2619b69175ae3424f4614985ed65471a4479b523cea896af81b175aef4e558
|
|
BLAKE2b-256 checksum How to use checksums |
e05bc68bf374898cb50535c1660be1b14b0d2b941001caf62e767d33998fa596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp314-cp314-macosx_10_15_x86_64.whl
| Download URL | dipoleq-0.11.3-cp314-cp314-macosx_10_15_x86_64.whl |
|---|---|
| Size | 377.3 kB |
| Tags | CPython 3.14 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
15412013548aa077a025de160557a71d01bc310eb7c7697d5034443209b2820b
|
|
BLAKE2b-256 checksum How to use checksums |
7b62822609225beb81b6a1e6144fadf3a0f9e9df1313085e8439325c951138cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dipoleq-0.11.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 414.3 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ca7f46c3cef608dc5d63471cc157944ce1b43d22c9e56fc8ddee41f547f0db1c
|
|
BLAKE2b-256 checksum How to use checksums |
9538eb59a41c55b2129ef7bba8e94ac30a5486af93075461a57269fdb353eefc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | dipoleq-0.11.3-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 336.4 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
36d12aa58081ebfe0d52db505ccbe36743b45bf94b55caba1a5bfc46108c7b51
|
|
BLAKE2b-256 checksum How to use checksums |
60fbc108ad025b2d8fc3c1db9368b1a2ef1d831836f22026baa9a15e1c74ac80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp313-cp313-macosx_10_15_x86_64.whl
| Download URL | dipoleq-0.11.3-cp313-cp313-macosx_10_15_x86_64.whl |
|---|---|
| Size | 377.2 kB |
| Tags | CPython 3.13 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
ee835a60f96127bfd2d8fade29b06955100e997ea33e55ef40e2beaf6420ec66
|
|
BLAKE2b-256 checksum How to use checksums |
9e631b3c1d6d46257ace7bed5a49a1f6a9ffd853999fbfb2c056f45c47e07304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dipoleq-0.11.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 414.5 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b811fb8508f2614b0c6feb20a282deb2a27b8eddf0e57ec7b98bb5a1a8af80c9
|
|
BLAKE2b-256 checksum How to use checksums |
c2e878a2d2c9bba900f43f25aec53093558971acce7896ba6f685c666be1a07f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | dipoleq-0.11.3-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 336.4 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f25dd74c6d9e56a60d6414e7cb481a14ca8334a31bc4a5d499a6e37444602591
|
|
BLAKE2b-256 checksum How to use checksums |
87ca06456abe9d50d9accc0ccec2db7b0fa3cfda6c85c5749b07b23f8cc26c70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp312-cp312-macosx_10_15_x86_64.whl
| Download URL | dipoleq-0.11.3-cp312-cp312-macosx_10_15_x86_64.whl |
|---|---|
| Size | 377.2 kB |
| Tags | CPython 3.12 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
b5f145a96b7a66c3240d03533fb5db12747b024c2fd5e4f4729cfd71d6374035
|
|
BLAKE2b-256 checksum How to use checksums |
b597ed870076a081a41705ada900c1311a66f77c7463cc9082ae7ed2f07eabdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dipoleq-0.11.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 415.1 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f778beb7066e2a0aee145e3c37805c4d70cd618b1f279838424c254dfbd6aa44
|
|
BLAKE2b-256 checksum How to use checksums |
f5739e0a70dcd3b9c3cf3cdc016c45a6bbebfac44bb12dac82ee755c680bbd82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | dipoleq-0.11.3-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 336.9 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
51ed0c1ef559492285579537af4f959eb936beb12e3a5a1546a52fef070d5fa4
|
|
BLAKE2b-256 checksum How to use checksums |
84973aeae143c2d6c9015dcbe61a0dcb8e355fc2bdd7094536afef57a770214a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp311-cp311-macosx_10_15_x86_64.whl
| Download URL | dipoleq-0.11.3-cp311-cp311-macosx_10_15_x86_64.whl |
|---|---|
| Size | 376.7 kB |
| Tags | CPython 3.11 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
1c7e19584168fcd62c0d02a909efb870d242568604eea0f3d3105196d447f9bb
|
|
BLAKE2b-256 checksum How to use checksums |
e32370873e36d8a171d79d6fd0950b2265540eab3ba1e734dcd7294e5bf46f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dipoleq-0.11.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 414.7 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bad8f0bff3b9523d05b1692566600d4bcc7309d0e48a1c89b6ef937dab82914f
|
|
BLAKE2b-256 checksum How to use checksums |
242f419195ef94a8a4c2813a617822f69bf9d405b50dc309898e56f87d678339
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | dipoleq-0.11.3-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 336.5 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9532f0d8dcf926f926f92613a131874bda5460a6195467c40379feddce74bafc
|
|
BLAKE2b-256 checksum How to use checksums |
d3a854a8f001e69333771aad4db2cbc26fa88d3c48362186aeed6cf5c39fd83c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / dipoleq-0.11.3-cp310-cp310-macosx_10_15_x86_64.whl
| Download URL | dipoleq-0.11.3-cp310-cp310-macosx_10_15_x86_64.whl |
|---|---|
| Size | 375.5 kB |
| Tags | CPython 3.10 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
98dfdd3769073dcb48bfcc880a4eed86c2d10da32e1528ea20782144616a0940
|
|
BLAKE2b-256 checksum How to use checksums |
c1db14b2ceed53fb426554fdd7590791c601d8e66544b59ca107bcc75b1ccce7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logSecurity for dipoleq 0.11.3
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.
Full provenance
All 16 files in this release have been uploaded with provenance metadata.
Attestation for dipoleq-0.11.3.tar.gz
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 Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.