Skip to main content

Inductance

PyPI Status Python Version License Read the documentation at https://inductance.readthedocs.io/ Tests Codecov pre-commit Ruff

This is a python library to calculate inductance. Mostly for the purposes of calcualting magnetically confined plasmas. It might someday actually contain some plasma physics, but lets not get too carried away.

Features

  • Self-inductance formulas

    • self inductance of circular, circular hollow, and rectangular section by Maxwell's approximation
    • Lyle's approximation for thick coil solenoid self inductances to 4th and 6th order.
    • Butterworth's approximation for long solenoids
    • Lorentz's perfect analytic solution for current sheet solenoids
    • Babic and Akyel's approximation for thin solenoids
  • Mutual-inductance formulas

    • mutual inductance of filaments (Maxwell)
  • Filamentary models

    • utility functions to create filament arrays from rectangular definitions of coils and subcoils
    • calculation for filament array mutual inductance
    • calculation of filament array self inductance
  • Green's functions

    • calculation of Green's functions for Psi, Br, and Bz from filamented coils to points
      • with Numba, calculation of green's functions for arbitrary grids of points
    • calculation fo Green's functions for coil forces
  • Arbitrary coil shapes

    • rudimentary support for arbitrary wire filament coil shapes

Requirements

Inductance requires NumPy and uses Numba for acceleration. It is written in mostly pure python referencing academic articles for calculating inductances by various methods, most of which rely on elliptic functions. Inductance provides Numba accelerated pure python elliptic functions.

Numba is optional, though it is installed by default. Without it, Inductance falls back to pure python: everything still works, just slower, apart from the vectorized Green's function helpers (BrGreenFil, BzGreenFil, AGreenFil), which stay callable but are no longer generalized ufuncs, so they need an explicit output array. The plan is to provide different options, including with alternative accelerators, such as JAX. The requirements are:

  • python >= 3.11
  • numpy >= 2.3
  • numba >= 0.63 — optional, installed by default on any python Numba supports

Installation

You can install inductance via pip from PyPI:

$ pip install inductance

That installs Numba too. On a python newer than Numba supports, it is skipped automatically so the install still succeeds; once Numba catches up, ask for it explicitly with:

$ pip install "inductance[numba]"

To install without Numba on a python that does support it:

$ pip install --no-deps inductance numpy

If Numba is installed but you want to bypass compilation — when debugging, or under coverage — set NUMBA_DISABLE_JIT=1 in the environment instead.

Reference

Please see the reference for details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, inductance is free and open source software.

Issues

For now, this is a very early release. It is likely a new top level API will be developed as the library matures.

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

Metadata

Release files for inductance 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inductance 0.2.0
File Size Uploaded
inductance-0.2.0.tar.gz 181.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inductance 0.2.0
File Interpreter ABI Platform
inductance-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 211.9 kB

Release files / inductance-0.2.0.tar.gz

Download URL inductance-0.2.0.tar.gz
Size 181.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f44cc4254df79b69e7b8c23828441232d9ea9ff982477e55502b79055ff4ba2e
BLAKE2b-256 checksum
How to use checksums
e3453565006da039db14ac4d2fe408446b7d21226abbcbbccc175d316225b3c6
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

Release files / inductance-0.2.0-py3-none-any.whl

Download URL inductance-0.2.0-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e385b9781f67d47ba47ea35c233ee94a4053aa46331491e07123c4be6f78ba8f
BLAKE2b-256 checksum
How to use checksums
a72c3b69068e5463daa0727072c63d65a15e8ae3b808451cae87ed181e3b388a
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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page