The software

One engine.
Two ways to work.

A graphical workbench for interactive design. A Python library for reproducible studies.

Design interactively

Build a project in the Qt/VTK workbench. Edit geometry, targets and processing settings, then inspect the stream function, winding and field results.

Saved projects retain editable inputs. Start with File → Load template to choose a gradient or shim design.

Workbench guide ↗

Work in Python

Use the same numerical engine from scripts and the class-based API. Define physical parameters explicitly and keep settings with your study.

from coilgen import CylinderCoilDesign

design = CylinderCoilDesign(
    target_bz_expression="y",
    target_scale=0.01,  # 10 mT/m
    radius_m=0.12,
    length_m=0.30,
    target_region_radius_m=0.045,
    contour_levels=16,
)
result = design.run()

Geometry in meters; magnetic fields in tesla. This is a starter configuration, separate from the saved gallery designs.

Capabilities

From geometry to diagnostics.

Define the problem

Generated or imported support meshes, analytic or imported target fields, and optional suppression regions.

Optimize the current

Stream-function optimization, resistance regularization and optional fixed-error constrained objectives.

Construct a winding

Contour extraction and smoothing, intrinsic topology, loop connections, return routing and conductor profiles.

Inspect the result

Sheet, contour and conductor-centerline field comparisons; spacing, bend and clearance diagnostics; resistance and inductance estimates.

Download & installation

Get the current source.

Download the ZIP or clone with Git, then follow the matching installation steps below.

Development source

Package metadata: 0.1.0.
No tagged release is published.

Python 3.10+

Workbench and Python API.
Git is optional for ZIP users.

Recorded validation

Windows / Python 3.12
Linux / Python 3.10
18 Oct 2026 · commit 80f0361 ↗

Usage & licensing

A project-wide CoilGen2 license is not yet declared.
Read the licensing information ↓

Install the desktop workbench

  1. Download and extract Coilgen2-main.zip.
  2. Open the extracted Coilgen2-main folder, then open a terminal there. The folder should contain pyproject.toml.
  3. Run the commands below. Git is not needed.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[gui,plot]"
python -m coilgen.gui
After launch: File → Load template

For a script-only workflow, use python -m pip install -e ".[research,plot]". The validation record describes a specific audited revision; the current main branch may differ. Record your commit with research results. Full installation guide ↗

Documentation

Make the model explicit.

Use the guides to understand units, target definitions, solver choices and how to interpret field and manufacturing diagnostics.

Usage & licensing

CoilGen2 currently has no project-wide license declaration. The repository’s legacy reference materials include GPLv3 license text. Refer to the repository’s file-level notices and contact Philipp for clarification of the applicable terms.