Experiment#

pylit.experiment.prepare(config)#

Prepare input data and compute quantities required for performing the inverse Laplace transform.

This function loads the imaginary-time correlation function \(F(q, \tau)\) and the default model \(D(q, \omega)\) for the dynamic structure factor \(S(q, \omega)\) from CSV files specified in the configuration, processes them, and computes the quantities required for performing the inverse Laplace transform.

Steps performed#

  1. Load \(F(q, \tau)\) from the specified path

    • Determine the inverse temperature \(\beta = \max(\tau)\),

    • Scale \(F(q, \tau)\) by its maximum value in \(\tau\).

  2. Load \(D(q, \omega)\) from the specified path

    • Optionally enforce non-negativity,

    • Optionally apply detailed balance \(D(-\omega) = e^{-\beta \omega} D(\omega)\).

  3. Compute the following quantities

    • Integrals \(\int D(q, \omega)\, d\omega\) (trapezoidal rule),

    • Normalize the default model \(\widehat{D}(q, \omega)\) by its integrals in \(\omega\),

    • Expected value \(\mu(D)\),

    • Standard deviation \(\sigma(D)\),

    • Statistical moments \(\mu_\alpha(D)\) for predefined orders \(\alpha\),

    • Forward Laplace transform \(\widehat{D}(\tau)\),

    • Absolute error \(|\widehat{D}(\tau) - F_{\text{scaled}}(\tau)|\),

    • Maximal error across all \(\tau\).

  4. Store all results in a Preparation object.

type config:

Configuration

param config:

Configuration object containing file paths and flags controlling data preprocessing (e.g., enforcing non-negativity, detailed balance).

returns:

Data container holding both raw and processed quantities.

rtype:

Preparation

Notes

If config.path_prep is provided, the Preparation object is serialized and saved to JSON.