Skip to main content

tiwave - gravitational waveforms implemented using taichi-lang

last commit code style: black docs

tiwave is a python implementation of several gravitational waveform models powered by taichi-lang, developed primarily for the preparatory science of space-borne gravitaional-wave missions. This package enables high-performance waveform generation across CPUs and GPUs, while keeping pythonic usability and maintainability.

Installation

Install from PyPI:

pip install tiwave

Install the latest or specific commit version:

# install the latest development version
pip install git+https://github.com/nnrui/tiwave
# install a specific commit
pip install git+https://github.com/nnrui/tiwave@<commit-hash>

Usage

import taichi as ti
ti.init(arch=ti.cpu, default_fp=ti.f64)

import numpy as np
from tiwave.waveforms import IMRPhenomXAS

reference_frequency = 20.0
minimum_frequency = 20.0
maximum_frequency = 2048.0
sampling_rate = 4096
duration = 4.0

num_samples = int(duration * sampling_rate)
full_freqs = np.fft.rfftfreq(num_samples, 1 / sampling_rate)
freqs_mask = (full_freqs <= maximum_frequency) * (full_freqs >= minimum_frequency)
freqs = full_freqs[freqs_mask]
freqs_ti = ti.field(ti.f64, shape=freqs.shape)
freqs_ti.from_numpy(freqs)

params = dict(
    mass_1=36.0,
    mass_2=29.0,
    chi_1=-0.4,
    chi_2=0.02,
    luminosity_distance=800.0,
    inclination=0.4,
    reference_phase=1.2,
)

xas_tiw = IMRPhenomXAS(freqs_ti, reference_frequency)
xas_tiw.update_waveform(params)
xas_tiw.waveform_container_numpy

More examples or tutorials can be found in the document.

Other Tools

If tiwave cannot meet your needs, you may find other packages for gravitaional waveform generation (welcome to open issues or pull requests if you know more):

Known Limitations

  • For waveforms of X family, only the recommended configuration are implemented, except the multibanding settings which is currently not supported in tiwave. The details of recommended settings can be found in the document of lalsimulation, LALSimIMRPhenomX.c;
  • The 32 mode in IMRPhenomXHM has relatively large numerical errors. However, we believe it is still safe to use for sources with moderate mass ratio and spins (more details can be found in the notebook and Appendix A in the paper);
  • Currently, automatic differentiation is only available for IMRPhenomXAS, and limited to the backward mode;

Contact

The author strive to make this package easy-to-use and maintainable. But the author's experience and knowledge in software engineering is limited. Any feedback, comments, and suggestions are greatly appreciated. Feel free to open issues or contact.

Citation

If you think this package is useful, please considering cite arxiv: 2601.xxxx.

The development of this package depending on many previous works, Please cite the original works for the corresponding modules you have used.

IMRPhenomD: (validation for reimplemented IMRPhenomD in tiwave over the entire parameter space is still in progress)

  • Sascha Husa, et al. Frequency-domain gravitational waves from nonprecessing black-hole binaries. I. New numerical waveforms and anatomy of the signal, Phys. Rev. D 93, 044006
  • Sebastian Khan, et al. Frequency-domain gravitational waves from nonprecessing black-hole binaries. II. A phenomenological model for the advanced detector era, Phys. Rev. D 93, 044007

IMRPhenomXAS:

  • Geraint Pratten, et al. Setting the cornerstone for a family of models for gravitational waves from compact binaries: The dominant harmonic for nonprecessing quasicircular black holes, Phys. Rev. D 102, 064001

IMRPhenomXHM:

  • Cecilio García-Quirós, et al. Multimode frequency-domain model for the gravitational wave signal from nonprecessing black-hole binaries, Phys. Rev. D 102, 064002

IMRPhenomXPHM: (support for the precession effects in tiwave is still ongoing)

  • Geraint Pratten, et al. Computationally efficient models for the dominant and subdominant harmonic modes of precessing binary black holes, Phys. Rev. D 103, 104056
  • (the single-spin model) Mark Hannam, et al. Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms, Phys. Rev. Lett. 113, 151101
  • (the double-spin model) Katerina Chatziioannou, et, al. Constructing gravitational waves from generic spin-precessing compact binary inspirals, Phys. Rev. D 95, 104004

Metadata

Release files for tiwave 0.0.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 tiwave 0.0.1
File Size Uploaded Provenance Actions
tiwave-0.0.1.tar.gz 126.3 kB With provenance Details for tiwave-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 254.2 kB

Release files / tiwave-0.0.1.tar.gz

Download URL tiwave-0.0.1.tar.gz
Size 126.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a3603b41cbfdd7abd09f43b0e7f16672caa5166731a9d4565b767efbeace3460
BLAKE2b-256 checksum
How to use checksums
156172195ddd7626e3c451ca4ac325e008758a61f6ad6cdb23227bdcd812f7fa
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 Oct 26, 2026.

Transparency log

Release files / tiwave-0.0.1-py3-none-any.whl

Download URL tiwave-0.0.1-py3-none-any.whl
Size 127.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca0de6e5dcb1f9cf67e8f36babdbb681cfccd360749777f17e29f9313af011c9
BLAKE2b-256 checksum
How to use checksums
f032b178826f5a163bdea38291c089340e23be0a6a8f4518b46cf8249b866dc4
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 Oct 26, 2026.

Transparency log

Security for tiwave 0.0.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tiwave-0.0.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 Oct 26, 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.0.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