Skip to main content

twpasolver

PyPI Python versions DOI

Simulation of traveling-wave parametric amplifiers (TWPAs) with coupled mode equations (CMEs).

Scope: this release simulates kinetic-inductance TWPAs (KI-TWPAs). The cells of the line can be any linear circuit, but the only nonlinearity is that of a kinetic inductance. Josephson-junction devices are not supported yet.

  • Circuit models: lumped and distributed elements, composed into unit cells, supercells and multi-segment devices. ABCD/S/Z parameters of any two-port network. User-defined models are supported.
  • Linear response: Bloch wavenumber, attenuation and impedance, stopbands, transmission.
  • Two gain models:
    • simple: the traditional forward-only CMEs of a homogeneous line. Fast, for quick sweeps and comparison with the literature.
    • bloch: forward and backward waves in the exact Bloch-mode basis of the loaded line, with reflections at the ends from arbitrary connectors and internal reflections at the junctions between segments. Port-resolved gains (S21, S12, S11, S22). Equivalent to harmonic balance simulations in preliminary testing.
  • Mode sets Automatically builds all 3WM and 4WM interactions with any number of modes and independent tones (pump harmonics, frequency conversion sidebands, multiple pumps), with the rotating-wave terms found exactly.

Documentation

Tutorials, physics notes and the API reference: https://twpalab.github.io/twpasolver/.

Installation

pip install twpasolver

The CME solvers are compiled with Numba and cached to disk on first use. Run the warmup once after installing to compile them up front (a few minutes), instead of the first time you run an analysis:

twpasolver-warmup

For development, clone the repository and install with Poetry and the pre-commit hooks:

git clone https://github.com/twpalab/twpasolver
cd twpasolver
poetry install --with docs,analysis
pre-commit install

Example

The gain of the kinetic-inductance TWPA used in the tutorials, at the pump that best phase matches the 4-12 GHz band:

import numpy as np
from twpasolver import TWPAnalysis

an = TWPAnalysis(twpa="docs/source/notebooks/imskit_v3_holotype.json", freqs=(0.2, 40, 2e-3))
pm = an.phase_matching(signal_freqs=(4, 12, 0.1), pump_freqs=(14, 18, 0.05))
result = an.gain(np.linspace(4, 12, 151), pump=pm.optimal_pump_freq, model="bloch")
print(f"pump {pm.optimal_pump_freq:.2f} GHz, mean gain {result.bandwidth()['mean_gain']:.1f} dB")
result.plot()

Citing

If you use twpasolver in published work, please cite it through its DOI, 10.5281/zenodo.24680845 (all versions; the GitHub "Cite this repository" button gives BibTeX and APA from CITATION.cff).

Acknowledgements

twpasolver was developed within the DARTWARS project (Detector Array Readout with Traveling Wave AmplifieRS), which has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 101027746.

License

twpasolver is licensed under the Apache License 2.0.

Metadata

Release files for twpasolver 0.1.1

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

Source distribution (sdist)

Source distribution for twpasolver 0.1.1
File Size Uploaded Provenance Actions
twpasolver-0.1.1.tar.gz 89.1 kB With provenance Details for twpasolver-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 193.4 kB

Release files / twpasolver-0.1.1.tar.gz

Download URL twpasolver-0.1.1.tar.gz
Size 89.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6bd40d5f2c0019a2346f599176de2442d1e97e2bcbceb9c9507de664a5d8ca13
BLAKE2b-256 checksum
How to use checksums
537bb5cb21b7c81810c4196d3e63d7956564f52d4e3f7294c9f7c6b462ecfca1
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 Nov 30, 2026.

Transparency log

Release files / twpasolver-0.1.1-py3-none-any.whl

Download URL twpasolver-0.1.1-py3-none-any.whl
Size 104.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7884166e1498de0e641e56d5ed1f47c97d646d93a0385524053d8eab990fe3f0
BLAKE2b-256 checksum
How to use checksums
2e6b3d20f84decbb8c59b28a352f3ad4eb56d3f6beb2492d10e1d071501ac144
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 Nov 30, 2026.

Transparency log

Security for twpasolver 0.1.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for twpasolver-0.1.1.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 Nov 30, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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