Skip to content

Unified QEL model with spectral function#485

Open
LiangLiu212 wants to merge 4 commits into
GENIE-MC:masterfrom
LiangLiu212:dev/sf-unified-qel
Open

Unified QEL model with spectral function#485
LiangLiu212 wants to merge 4 commits into
GENIE-MC:masterfrom
LiangLiu212:dev/sf-unified-qel

Conversation

@LiangLiu212

@LiangLiu212 LiangLiu212 commented May 3, 2026

Copy link
Copy Markdown
Contributor

Add unified QEL cross-section framework with hadron tensor infrastructure

This PR convert the original Fortran code to c++ code based on the work from Noah Steinberg and Steven Gardiner et, al.

Introduces a hadron-tensor-based formulation for quasi-elastic cross section calculations, replacing direct amplitude evaluation with a contraction of leptonic and hadronic tensors.

New components:

  • HadronTensorInterface(I) and Rank2LorentzTensorI: base classes for rank-2 Lorentz tensor manipulation and contraction. New we only implement the one body current. We will introduction two body currents and interference in the future.
  • LeptonTensor and ManualResponseTensor: leptonic and hadronic tensor implementations
  • UnifiedQELPXSec: tensor-contraction-based QEL cross-section algorithm
  • KellyELFormFactorsModel: Kelly parametrization of nucleon EM form factors, it is dipole model, new to GENIE
  • LwlynSmithFFEM: electromagnetic variant of the Llewellyn-Smith form-factor model
  • onebody_currents_sf: one-body current operators for spectral function calculations
  • Spectral function tables for 12C, 16O, and 40Ar (p/n)

Updates SpectralFunc to interface with the new framework, registers new algorithms in master_config.xml and per-algorithm XML configs, and adjusts Makefile and LinkDef entries for the new classes.

Add unified QEL cross-section framework with hadron tensor infrastructure

Introduces a hadron-tensor-based formulation for quasi-elastic cross
section calculations, replacing direct amplitude evaluation with a
contraction of leptonic and hadronic tensors.

New components:
  - HadronTensorInterface(I) and Rank2LorentzTensorI: base classes for
    rank-2 Lorentz tensor manipulation and contraction. New we only
    implement the one body current. We will introduction two body
    currents and interference in the future.
  - LeptonTensor and ManualResponseTensor: leptonic and hadronic tensor
    implementations
  - UnifiedQELPXSec: tensor-contraction-based QEL cross-section algorithm
  - KellyELFormFactorsModel: Kelly parametrization of nucleon EM form
    factors, it is dipole model, new to GENIE
  - LwlynSmithFFEM: electromagnetic variant of the Llewellyn-Smith
    form-factor model
  - onebody_currents_sf: one-body current operators for spectral
    function calculations
  - Spectral function tables for 12C, 16O, and 40Ar (p/n)

Updates SpectralFunc to interface with the new framework, registers
new algorithms in master_config.xml and per-algorithm XML configs,
and adjusts Makefile and LinkDef entries for the new classes.
@LiangLiu212 LiangLiu212 requested review from nusense and sjgardiner May 3, 2026 16:13

@nusense nusense left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've got a number of questions, but I've looked at all the changes.

Comment thread config/Messenger.xml Outdated
Comment thread config/SpectralFunc.xml
Comment thread config/UnifiedQELPXSec.xml Outdated
Comment thread src/Apps/Makefile
double qtx, qty, qtz, wt;
double f1v, xif2v, fa, fp;

w = fw; mNi = fmNi;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These multiple assignments on the same line are hard to read, along with declaring variables ahead and then assigning them here. It would be less fortran-like to have:

double  mNi = fmNi;
double  w = fw;
... 

This is a stylistic suggestion and not a requirement.

Comment thread src/Physics/QuasiElastic/XSection/KellyELFormFactorsModel.cxx Outdated
Comment thread src/Physics/QuasiElastic/XSection/UnifiedQELPXSec.cxx
Comment thread src/Physics/QuasiElastic/XSection/UnifiedQELPXSec.cxx Outdated
kTIdx_NumDimensions = 4
} TensorIndex_t;

class Rank2LorentzTensorI {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit confused by this class being Rank2LorentzTensorI as the trailing I by GENIE convention usually means "interface" not a concrete class. And in the \class documentation above you give the name without the I.

In UnifiedQELPXSec it seems to be treated as a concrete class. And while there is a destructor declared, I don't see a constructor.

Comment thread src/Physics/QuasiElastic/XSection/UnifiedQELPXSec.cxx
@LiangLiu212

Copy link
Copy Markdown
Contributor Author

Hi, Robert,

Thank you very much for your valuable comments.

This RP is a continue work from #461. At this point, I have mainly converted the one-body current from Fortran to C++ and verified that the C++ code produces the same results as the Fortran version.

I would love to improve the hadron tensor interface according to your comments.

For the Eigen, do we want to introduce a new external library to GENIE?

Best,

Liang

The change only rename the class of hadron tensor, add comments
In order to avoid use external Eigen library, implement the TensorUtil
to do hadron current. The implementation is done by claude, I do the
validate to make sure the agreement at machine precision.
@LiangLiu212

Copy link
Copy Markdown
Contributor Author

Hi, Robert,

Here, I rename all the tensors and here is hierarchy of them

               +-------------------------+
                |   Rank2LorentzTensor    |   <<abstract>>
                |   W^mu_nu interface     |
                +-------------------------+
                      ^               ^
                      |               |
          +-----------+               +-----------+
          |                                       |
+---------------------+               +---------------------+
|   NucleonTensor     | <<abstract>>  |   LeptonTensor      | <<concrete>>
|   hadronic side     |               |   L^mu_nu spinors   |
+---------------------+               +---------------------+
          ^
          |
+-------------------------+
|   IASingleNucleonTensor |  <<concrete>>
|   impulse approx.       |
+-------------------------+

I hope it helps.

Best
Liang

@nusense nusense left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The revisions since my previous review have addressed my comments. I'll approve this for when the series of pull requests are applied for version R-3_08_00.

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