simsopt.configs package

simsopt.configs.download_ID_from_QUASR_database(ID, return_style='simsopt-style', verbose=True, use_cache=True)

Download a configuration from the QUASR database. Downloaded configuration files are cached in [SIMSOPT_INSTALL_DIR]/src/simsopt/configs/QUASR_cache/ The cache is pruned to keep 100 files (~10MB) to avoid excessive disk usage.

Parameters:
  • ID (int) – the ID of the configuration to download (leading zeros removed). A pandas dataframe containing metadata on the devices, including all valid ID numbers is located at: https://quasr.flatironinstitute.org/QUASR.pkl The database is navigatable online at https://quasr.flatironinstitute.org/ Alternatively, you can download the latest full set of devices from https://zenodo.org/doi/10.5281/zenodo.10050655

  • return_style (str) –

    How to return the information either: "quasr-style": two-element tuple containing ([SurfaceXYXTensorFourier], # surfaces

    [Coil,] # all coils )

    "simsopt-style": five-element tuple containing ([base_curves ], # curves of coils in first field/half period

    [base_currents, ], # currents of these coils [nfp, ], # number of field periods [coils, ] # all coils

    )

  • verbose (boolean) – if true, additional caching and downloading status messages are printed, otherwise they are not.

  • use_cache (True) – if true, the downloaded file will be saved to disk. The location will the in the simsopt installation directory if writeable, otherwise in the current working directory. If false, no caching is performed.

  • returns – a list containing: [list of simsopt.geo.Coil objects, list of simsopt.field.Current objects]

simsopt.configs.get_LHD_like_data(numquadpoints_circular=400, numquadpoints_helical=1000, numquadpoints_axis=30)

Return the coils and axis for an LHD-like configuration.

This coil set is a single-filament approximation of the coils in LHD, the Large Helical Device in Japan. Each filament corresponds to the center of the winding pack of the real finite-thickness LHD coils. The coil currents correspond to the configuration in which the major radius of the magnetic axis is 3.6 m.

This configuration has 6 circular coils and 2 helical coils. In the lists of curves and currents, the order is OVU, OVL, ISU, ISL, IVU, IVL, helical1, helical2. Here, U and L indicate upper and lower, OV and IV indicate the outer and inner vertical field coils, and IS indicates the inner shaping coils.

These coils were generated from data generously provided by Yasuhiro Suzuki. They produce a configuration similar to that used in Suzuki, Y., K. Y. Watanabe, and S. Sakakibara. “Theoretical studies of equilibrium beta limit in LHD plasmas.” Physics of Plasmas 27, 10 (2020).

Typical usage:

from simsopt.configs import get_LHD_like_data
from simsopt.field import BiotSavart, Current, Coil

coils, currents, axis = get_LHD_like_data()
coils = [
    Coil(curve, Current(current)) for curve, current in zip(coils, currents)
]
field = BiotSavart(coils)
Parameters:
  • numquadpoints_circular – number of quadrature points for the circular coils

  • numquadpoints_helical – number of quadrature points for helical coils

  • numquadpoints_axis – number of quadrature points for the magnetic axis

Returns:

3 element tuple containing the curves, currents, and the magnetic axis.

Deprecated since version 1.11.0: Use get_data() instead: get_data('lhd_like', numquadpoints_circular=..., numquadpoints_helical=..., numquadpoints_axis=...).

simsopt.configs.get_data(name, **kwargs)

Load one of several pre-defined stellarator coil configurations plus its Biot–Savart operator in a single call.

Parameters:
  • name (str) – Which configuration to load. Available values are: "ncsx", "hsx", "giuliani", "w7x", "lhd_like", "quasr", "STAR_Lite-A_low", "STAR_Lite-A_medium", "STAR_Lite-A_high"

  • kwargs (dict) –

    Configuration-specific parameters. See the sections below for details.

    Note

    The following keys are supported in kwargs based on the value of name:

    ncsx

    • coil_order (int, default=25) Order of the curves representing the coils.

    • points_per_period (int, default=10) Points-per-period for quadrature.

    • magnetic_axis_order (int, default=10) Order of the curve representing the magnetic axis.

    hsx

    • coil_order (int, default=16)

    • points_per_period (int, default=10)

    • magnetic_axis_order (int, default=10)

    giuliani

    • coil_order (int, default=16)

    • magnetic_axis_order (int, default=10)

    • points_per_period (int, default=10)

    • length (int, default=18) Total length for the nine-stage optimization.

    • nsurfaces (int, default=5) Number of surfaces for the optimization.

    w7x

    • coil_order (int, default=48)

    • points_per_period (int, default=2)

    • magnetic_axis_order (int, default=10)

    lhd_like

    • numquadpoints_circular (int, default=400) Number of quadrature points for the six circular coils.

    • numquadpoints_helical (int, default=1000) Number of quadrature points for each helical coil.

    • numquadpoints_axis (int, default=30) Number of quadrature points for the magnetic axis.

    quasr

    • QUASR_ID (int)

      The ID of the QUASR configuration you want to download

    • use_cache (bool, default=True)

      Whether to save the downloaded configuration (default in the installation directory of simsopt)

    • verbose (bool, default=False)

      Whether to print out messages during download from the database

Returns:

5-element tuple (base_curves, base_currents, ma, nfp, bs), where:

base_curveslist of CurveXYZFourier, or RotatedCurve

The curves representing the unique coils of the configuration (excluding symmetry copies). Fidelity and number of degrees-of-freedom are determined by coil_order and points_per_period.

base_currentslist of Current, or ScaledCurrent

Corresponding coil currents.

maCurveRZFourier

The magnetic axis, of order magnetic_axis_order.

nfpint

Number of field periods.

bsBiotSavart

The Biot–Savart operator assembled from the complete physical coil set.

Note

  • For all configurations except "lhd_like", the coils are expanded via coils_via_symmetries(curves, currents, nfp, True) before building bs.

  • For "lhd_like", each CurveXYZFourier and its Current are passed directly into Coil(curve, current) (no symmetry expansion).

Return type:

tuple

Notes

Available configurations:

name="ncsx"

Get a configuration that corresponds to the modular coils of the NCSX experiment (circular coils are not included).

name="hsx"

Get a configuration that corresponds to the modular coils of the HSX experiment.

name="giuliani"

This example simply loads the coils after the nine stage optimization runs discussed in

A. Giuliani, F. Wechsung, M. Landreman, G. Stadler, A. Cerfon, “Direct computation of magnetic surfaces in Boozer coordinates and coil optimization for quasi-symmetry,” Journal of Plasma Phys.

name="w7x"

Get the W7-X coils and magnetic axis.

Note that this function returns 7 coils: the 5 unique non-planar modular coils, and the 2 planar (A and B) coils. The coil currents correspond to the “Standard configuration”, in which the planar A and B coils carry no current. The shapes come from Fourier-transforming the xgrid file coils.w7x_v001, provided by Joachim Geiger (Sept 27, 2022) in an email to Florian Wechsung and others,the Fourier modes here reproduce the Cartesian coordinate data from coils.w7x_v001 to ~ 1e-13 meters.

Some description from Joachim:

“I have attached two coils-files which contain the filaments suitable for generating the mgrid-file for VMEC with xgrid. They contain the non-planar and the planar coils in a one-filament approximation as used here for equilibrium calculations. The two coil-sets are slightly different with respect to the planar coils (the non-planar coil geometry is the same), the w7x_v001 being the CAD-coil-set while the w7x-set has slightly older planar coils which I had used in a large number of calculations. The difference is small, but, depending on what accuracy is needed, noticeable. In case you want only one coil-set, I would suggest to use the CAD-coils, i.e. w7x_v001, although the other coil-set had been used in the PPCF-paper for citation. If there are any further questions, do not hesitate to contact me.”

name="lhd_like"

Get the coils and axis for an LHD-like configuration.

This coil set is a single-filament approximation of the coils in LHD, the Large Helical Device in Japan. Each filament corresponds to the center of the winding pack of the real finite-thickness LHD coils. The coil currents correspond to the configuration in which the major radius of the magnetic axis is 3.6 m.

This configuration has 6 circular coils and 2 helical coils. In the lists of curves and currents, the order is OVU, OVL, ISU, ISL, IVU, IVL, helical1, helical2. Here, U and L indicate upper and lower, OV and IV indicate the outer and inner vertical field coils, and IS indicates the inner shaping coils.

These coils were generated from data generously provided by Yasuhiro Suzuki. They produce a configuration similar to that used in Suzuki, Y., K. Y. Watanabe, and S. Sakakibara. “Theoretical studies of equilibrium beta limit in LHD plasmas.” Physics of Plasmas 27, 10 (2020).

Special Note: For "lhd_like", the returned nfp (5) reflects the coil periodicity, while the magnetic axis uses nfp=10.

name="quasr"

Get the coils for a QUASR configuration.

The QUASR database contains around 300,000 quasi-symmetric stellarator vacuum fields with coils.

Magnetic axes have not been generated for the database, and the returned ma variable is set to None.

name="STAR_Lite-A_low", "STAR_Lite-A_medium", "STAR_Lite-A_high"

Get the coils for STAR_Lite-A in the low, medium, and high rotational transform configurations.

Design A for STAR_Lite (“STAR_Lite-A”) varies the current ratios, while fixing the coil geometry to attain different rotational transform profiles. The low, medium, and high iota configurations have on-axis rotational transform 0.20, 0.23, 0.30. All configurations also feature an unpaired X point.

See the following reference for more information: Harrer, G. F., Giuliani, A., Padidar, M., Davies, R., Naik, S., & Lowe, C. (2026). STAR_Lite: A stellarator designed to experimentally validate non-resonant divertors. arXiv. https://arxiv.org/abs/2603.18265

simsopt.configs.get_giuliani_data(Nt_coils=16, Nt_ma=10, ppp=10, length=18, nsurfaces=5)

This example simply loads the coils after the nine stage optimization runs discussed in

  1. Giuliani, F. Wechsung, M. Landreman, G. Stadler, A. Cerfon, Direct computation of magnetic surfaces in Boozer coordinates and coil optimization for quasi-symmetry. Journal of Plasma Physics.

Parameters:
  • Nt_coils – order of the curves representing the coils.

  • Nt_ma – order of the curve representing the magnetic axis.

  • ppp – point-per-period: number of quadrature points per period

Returns: 3 element tuple containing the coils, currents, and the magnetic axis.

Deprecated since version 1.11.0: Use get_data() instead: get_data('giuliani', coil_order=..., magnetic_axis_order=..., points_per_period=..., length=..., nsurfaces=...).

simsopt.configs.get_hsx_data(Nt_coils=16, Nt_ma=10, ppp=10)

Get a configuration that corresponds to the modular coils of the HSX experiment.

Parameters:
  • Nt_coils – order of the curves representing the coils.

  • Nt_ma – order of the curve representing the magnetic axis.

  • ppp – point-per-period: number of quadrature points per period

Returns: 3 element tuple containing the coils, currents, and the magnetic axis.

Deprecated since version 1.11.0: Use get_data() instead: get_data('hsx', coil_order=..., magnetic_axis_order=..., points_per_period=...).

simsopt.configs.get_ncsx_data(Nt_coils=25, Nt_ma=10, ppp=10)

Get a configuration that corresponds to the modular coils of the NCSX experiment (circular coils are not included).

Parameters:
  • Nt_coils – order of the curves representing the coils.

  • Nt_ma – order of the curve representing the magnetic axis.

  • ppp – point-per-period: number of quadrature points per period

Returns: 3 element tuple containing the coils, currents, and the magnetic axis.

Deprecated since version 1.11.0: Use get_data() instead: get_data('ncsx', coil_order=..., magnetic_axis_order=..., points_per_period=...).

simsopt.configs.get_w7x_data(Nt_coils=48, Nt_ma=10, ppp=2)

Get the W7-X coils and magnetic axis.

Note that this function returns 7 coils: the 5 unique nonplanar modular coils, and the 2 planar (A and B) coils. The coil currents returned by this function correspond to the “Standard configuration”, in which the planar A and B coils carry no current.

Parameters:
  • Nt_coils – order of the curves representing the coils.

  • Nt_ma – order of the curve representing the magnetic axis.

  • ppp – point-per-period: number of quadrature points per period.

Returns: 3 element tuple containing the coils, currents, and the magnetic axis.

Deprecated since version 1.11.0: Use get_data() instead: get_data('w7x', coil_order=..., magnetic_axis_order=..., points_per_period=...).