API reference

Stable high-level interface

The public interface is intentionally smaller than the internal solver implementation. Applications should begin with the unified workflow objects below.

PlasmaWorkflowConfig(temperature_ev, ...)

Unified high-level plasma workflow configuration.

solve_plasma_workflow(cfg)

Solve one unified plasma workflow from one composition specification.

continue_plasma_workflow_from_electronic_result(...)

Continue the unified workflow from an already available electronic result.

PreparedMulticomponentIonStructure(...)

Reusable, ion-temperature-independent input to mixture HNC solves.

prepare_multicomponent_ion_structure_from_electronic_result(...)

Prepare one mixture QOZ state for reuse across several ion temperatures.

run_formula_workflow(formula, ...[, ...])

Convenience wrapper around PlasmaWorkflowConfig + solve_plasma_workflow.

parse_formula_composition(formula)

Parse one simple chemical formula into distinct species and counts.

resolve_plasma_composition(*, formula, ...)

Resolve one composition specification to canonical symbols and counts.

StateExportOptions([r_max_bohr, ...])

Controls for one portable state export.

save_plasma_state(path, workflow, *[, options])

Save one completed workflow as a portable compressed NPZ state.

load_plasma_state(path)

Load and validate one portable state file with pickle disabled.

Workflow results and state files

Important

Access calculated arrays: Workflow results and portable NPZ files is the canonical field reference. It gives in-memory and NPZ examples, species/pair indexing, shapes, units, metadata, electronic profiles and levels, \(q(k)\), \(f(k)\), response and LFC arrays, \(V_{Ie}(k)\), \(V_{ee}(k)\), \(V_{ab}(k)\), \(g_{ab}(r)\), and \(S_{ab}(k)\), where \(a,b\) label ionic species.

The stable state-file interface stores the native average-atom profiles and levels together with \(q(k)\), \(f(k)\), electron response and LFC, interaction channels, \(V_{ab}\), \(g_{ab}\), and \(S_{ab}\) without pickled Python objects.

build_state_arrays(workflow, *[, options])

Build a portable state payload from a completed plasma workflow.

validate_state_arrays(arrays)

Validate the public state schema without loading pickled objects.

Scientific plotting

Otter provides one shared Matplotlib style and a dual web/slide export path. By default save_figure() writes both a high-resolution PNG and an editable vector PDF.

set_style([profile, palette, figsize])

Apply the Otter style globally to subsequent Matplotlib figures.

style_context([profile, palette, figsize])

Temporarily apply the Otter style and restore prior rcParams.

style_rcparams([profile, palette, figsize])

Return Otter's Matplotlib rcParams without applying them.

grid_figsize(nrows, ncols, *[, cell_width, ...])

Return the project-standard figure size for a panel grid.

add_panel_label(ax, label, *[, x, y, fontsize])

Add a bold panel label such as "(a)" and return the text artist.

save_figure(fig, output_stem, *[, formats, ...])

Save matching raster and vector copies of a figure.

Internal modules

The otter.electronic, otter.ionic, otter.numerics, and otter.io packages contain lower-level model and diagnostic APIs. They are documented progressively as their contracts stabilize. Code outside Otter should not rely on private names or dictionary fields that are absent from the public result schema.

Experimental APIs are documented separately under Experimental models; their presence does not imply the stability guarantees of this page.

API stability

Public additions require:

  • a NumPy-style docstring with units and array shapes;

  • a literature reference for physical models;

  • validation of accepted values and failure modes;

  • at least one focused test;

  • an example when the behavior is not evident from the signature.