Skip to main content

Neutrino Interferometry - nu-waves

What is it?

Neutrino Interferometry, or nu_waves, is a simple Python library that calculate flavor oscillation of neutrinos. You can input your own parameters and get the oscillation probabilities.

How to install?

pip install nu-waves

Features

  • Embedded GPU acceleration (MPS, CUDA)
  • Oscillation framework with N neutrinos
  • Vacuum oscillations
  • Custom smearing function (L and E)
  • Constant matter MSW
  • Multi-layer matter MSW
  • Earth model (PREM) with cosz
  • Adiabatic transitions

Oscillation convention

The active three-flavor PMNS matrix uses the PDG convention, U_e3 = sin(theta13) * exp(-1j * deltaCP). The evolution operator stores S[energy, detected, emitted], while public probabilities retain the order P[energy, emitted, detected] = abs(S[energy, detected, emitted])**2 (singleton axes may be squeezed). Antineutrinos conjugate the mixing matrix and reverse the matter potential. Matter layers are ordered from source to detector.

The CP convention correction changes predictions from earlier implementations that transposed transition amplitudes. Remove any external phase-sign or channel-swap workarounds when adopting this correction, and regenerate affected predictions. The notebook notebooks/04_vacuum_executor_benchmarks.ipynb checks an independent PDG amplitude before benchmarking; tests/TestPdgConvention.py also covers matter, antineutrinos, layer ordering and decoherence.

Some nice pictures

vacuum_pmns.jpg matter_constant_test.jpg matter_prem_test.jpg adiabatic_sun_ssm_test.jpg vacuum_2d_pmns.jpg vacuum_2flavors.jpg

Examples

2 flavors oscillation in vacuum

import numpy as np
import matplotlib.pyplot as plt
from nu_waves.models.mixing import Mixing
from nu_waves.models.spectrum import Spectrum
from nu_waves.propagation.oscillator import Oscillator
from nu_waves.hamiltonian import vacuum
from nu_waves.utils import flavors

# sterile test
osc_amplitude = 0.1  # sin^2(2\theta)
angles = {(1, 2): np.arcsin(np.sqrt(osc_amplitude)) / 2}
dm2={(2, 1): 1}

mixing = Mixing(n_neutrinos=2, mixing_angles=angles)
spectrum = Spectrum(n_neutrinos=2, m_lightest=0., dm2={(2, 1): 1})
H = vacuum.Hamiltonian(
    mixing=mixing,
    spectrum=spectrum,
    antineutrino=False
)

# oscillator object that calculates the oscillation probability
osc = Oscillator(hamiltonian=H)

# get the oscillation probabilities
E_fixed = 3E-3
L_min, L_max = 1e-3, 20e-3
L_list = np.linspace(L_min, L_max, 200)
print(L_list)
P = osc.probability(
    L_km=L_list, E_GeV=E_fixed,
    flavor_emit=flavors.electron,
    flavor_det=flavors.electron  # muon could be sterile
)

# draw it
plt.figure(figsize=(6.5, 4.0))

plt.plot(L_list * 1000, P, label=r"$P_{e e}$ disappearance", lw=2)
plt.plot(L_list * 1000, [1] * len(L_list), "--", label="Total probability", lw=1.5)

plt.xlabel(r"$L_\nu$ [m]")
plt.ylabel(r"Probability")
plt.title(f"eV$^2$ sterile with $E_\\nu$ = {E_fixed * 1000} MeV")
# plt.xlim(L_min, L_max)
plt.ylim(0, 1.05)
plt.legend()
plt.tight_layout()
plt.show()

Release files for nu-waves 1.2.7

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

Source distribution (sdist)

Source distribution for nu-waves 1.2.7
File Size Uploaded
nu_waves-1.2.7.tar.gz 41.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nu-waves 1.2.7
File Interpreter ABI Platform
nu_waves-1.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 94.2 kB

Release files / nu_waves-1.2.7.tar.gz

Download URL nu_waves-1.2.7.tar.gz
Size 41.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9040758e5487887e516be6e494ab7d0f6970c9c94fd666598d15c0bbdc41b806
BLAKE2b-256 checksum
How to use checksums
d3d00c70d006cfea216119aced688113c7f46eee604626b1f76011786e5d6d12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release files / nu_waves-1.2.7-py3-none-any.whl

Download URL nu_waves-1.2.7-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8020172bfcc4b82605adad9b2fc1805336f4fa42c1539eb4dbbf621f2453d5e8
BLAKE2b-256 checksum
How to use checksums
9ed21a98c59c2e4f21f140ef27c37821e1b224ce9948f3989e3f5e97bcb53d57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.7 This release

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

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