Skip to content

Implement mittag_leffler model - #244

Open
henrikjacobsenfys wants to merge 1 commit into
developfrom
feature/mittag-leffler-component
Open

Implement mittag_leffler model#244
henrikjacobsenfys wants to merge 1 commit into
developfrom
feature/mittag-leffler-component

Conversation

@henrikjacobsenfys

Copy link
Copy Markdown
Member

Disclaimer: The code was written by Claude and looked through by me. The description below was written by me.

This implements the diffusion model that was requested at the summer school, eqs. 41 and 42 in this paper

A. N. Hassani, L. Haris, M. Appel, T. Seydel, A. M. Stadler and G. R. Kneller,
Multiscale relaxation dynamics and diffusion of myelin basic protein in solution studied by
quasielastic neutron scattering
, J. Chem. Phys. 156, 025102 (2022),
doi:10.1063/5.0077100.

A factor pi is missing in the equation, which is fixed here. Eq. 42 is also a special case of $\tau_R=1$, here we allow any value of $\tau_R$.

It is implemented as a ModelComponent for the per-Q calculation and as a DiffusionModel since in the paper $\epsilon=DQ^2$. It is modelled after the existing DeltaLorentz diffusion model, so the only new things are the equations - all the architecture is essentially copy/pasted. (I don't think it should be put into a shared base class when we have only two models that are similar).

The tests verify numerical correctness by comparing with the Laplace transform given earlier in the paper.

The notebook reproduces several of the figures of the paper, indicating that everything works as it should.

@henrikjacobsenfys henrikjacobsenfys added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] medium Normal/default priority labels Aug 28, 2026
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.22798% with 30 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@92dd2ed). Learn more about missing BASE report.

Files with missing lines Patch % Lines
..._model/diffusion_model/mittag_leffler_diffusion.py 89.86% 17 Missing and 13 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #244   +/-   ##
==========================================
  Coverage           ?   98.06%           
==========================================
  Files              ?       59           
  Lines              ?     5898           
  Branches           ?     1010           
==========================================
  Hits               ?     5784           
  Misses             ?       59           
  Partials           ?       55           
Flag Coverage Δ
unittests 98.06% <92.22%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/easydynamics/__init__.py 100.00% <100.00%> (ø)
src/easydynamics/sample_model/__init__.py 100.00% <100.00%> (ø)
...c/easydynamics/sample_model/components/__init__.py 100.00% <100.00%> (ø)
...odel/components/diffusion_damped_mittag_leffler.py 100.00% <100.00%> (ø)
...ydynamics/sample_model/diffusion_model/__init__.py 100.00% <100.00%> (ø)
..._model/diffusion_model/mittag_leffler_diffusion.py 89.86% <89.86%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant