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

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
import nu_waves.utils.flavors as flavors

# sterile test
osc_amplitude = 0.1  # sin^2(2\theta)
angles = {(1, 2): np.arcsin(np.sqrt(osc_amplitude)) / 2}
pmns = Mixing(n_neutrinos=2, mixing_angles=angles)
U_pmns = pmns.build_mixing_matrix()
print(np.round(U_pmns, 3))

# 1 eV^2
spec = Spectrum(n_neutrinos=2, m_lightest=0.)
spec._generate_dm2_matrix({(2, 1): 1})
spec.summary()
m2_diag = np.diag(spec.get_m2())

# oscillator object that calculates the oscillation probability
osc = Oscillator(mixing_matrix=U_pmns, m2_list=spec.get_m2())

# 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
    antineutrino=True
)

# 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()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nu_waves-1.2.5.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nu_waves-1.2.5-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file nu_waves-1.2.5.tar.gz.

File metadata

  • Download URL: nu_waves-1.2.5.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for nu_waves-1.2.5.tar.gz
Algorithm Hash digest
SHA256 aae57aa73ee9bf1935ef4b61bef650a20ed09bad3d2881995d107ce12f9363e0
MD5 e5e507722772e9e3e0e38a373fb35442
BLAKE2b-256 d39d4126cca7f769e60ad727bd677cc2a18c3f04b71df56178ecf0f741781b69

See more details on using hashes here.

Provenance

The following attestation bundles were made for nu_waves-1.2.5.tar.gz:

Publisher: publish.yml on nadrino/nu-waves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nu_waves-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: nu_waves-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for nu_waves-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cc4c91670171dad32dad65f856a4ec6b9082e7d699a75ca6b6cde6aec8f1ef27
MD5 0d31485d7c6cbb00c5cda32b23ed7eec
BLAKE2b-256 f87bdd9e2d9299f918538babcb97f65a601b82305aceaf8980733c929ff53d74

See more details on using hashes here.

Provenance

The following attestation bundles were made for nu_waves-1.2.5-py3-none-any.whl:

Publisher: publish.yml on nadrino/nu-waves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.2.6

2 files

This release

1.2.5 This release

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.3

2 files

1.0.1

2 files

1.0.0

2 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