Skip to content

Update NSI oscillation source files, add stan support - #45

Open
xiaoyan1997 wants to merge 7 commits into
cafana:mainfrom
xiaoyan1997:feature/xhuang6_oscillib_stan
Open

Update NSI oscillation source files, add stan support#45
xiaoyan1997 wants to merge 7 commits into
cafana:mainfrom
xiaoyan1997:feature/xhuang6_oscillib_stan

Conversation

@xiaoyan1997

Copy link
Copy Markdown

No description provided.

@xiaoyan1997
xiaoyan1997 requested a review from a team as a code owner April 28, 2026 20:31
Comment thread OscLib/OscCalcPMNS_NSI.cxx Outdated

@chenel chenel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working with me on this.

I noticed one other thing, which is not your fault because it's from the preceding calculator code, but which needs to be addressed ASAP:

_OscCalcPMNS_NSI doesn't override GetParamsHash() from the base class. That means it inherits GetParamsHashDefault from _IOscCalcAdjustable, which only hashes the 8 standard oscillation parameters: fL, fRho, fDmsq21, fDmsq32, fTh12, fTh13, fTh23, fdCP (see IOscCalc.cxx:87-90). The 9 NSI-specific members (fEps_ee, ...) are silently excluded.
This means that any cache pull using GetParamsHash() will return stale results when only NSI parameters change---i.e., you'll get the same prediction for differing NSI parameters (😱).

We need an overridden GetParamsHash() in this class. Are you game for implementing it?

Adds 9 NSI matter potential parameters (eps_ee, eps_mumu, eps_tautau,
eps_emu, eps_etau, eps_mutau with re/im components) to _OscCalc<T>.
Modified _P() to include NSI contributions to the matter Hamiltonian:
  diagonal: A_CC * (1+eps_ee), A_CC * eps_mumu, A_CC * eps_tautau
  off-diagonal: A_CC * eps_emu, eps_etau, eps_mutau (complex)
Verified with test_nsi_calc.C: both sections ALL PASS vs OscCalcPMNS_NSI.
The -E trick correctly handles complex off-diagonal NSI for antineutrinos.
M is Hermitian, so P = |exp(M)_ba|^2 = |exp(M*)_ba|^2, and the physical
antineutrino Hamiltonian is M^T = M* (Hermitian property), giving the same
probability through |exp(M^T)_ba|^2 = |exp(M)_ab|^2 = |exp(M)_ba|^2.
No explicit conjugation of imaginary eps parts is needed.
Implements analytic Cardano eigensolver for NSI oscillation probabilities,
templated on T for Stan autodiff compatibility. NSI epsilon corrections are
added to the matter Hamiltonian in UpdateHamiltonian() alongside the standard
MSW term; GetEigenvalues() is untouched.

Reverts NSI additions from OscCalcAnalytic base class — NSI is now in the
standalone OscCalcAnalytic_NSI only, leaving the 3F base class unmodified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants