Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numerator Evaluation with counterterms #30

Merged
merged 169 commits into from
Oct 8, 2024
Merged

Numerator Evaluation with counterterms #30

merged 169 commits into from
Oct 8, 2024

Conversation

lcnbr
Copy link
Member

@lcnbr lcnbr commented Oct 4, 2024

This PR brings a number of upgrades to gammaloop.

  • Numerator evaluation integrated with cff and ltd
  • Threshold counterterms that actually take into account numerator
  • A new input graph format based on DOT.

These changes also forced some reformatting of the codebase, namely:

  • The graph struct now is split into two parts:
    • BareGraph which includes all constant data and encode the graph structure. This should not be mutated after deserialization. If one needs to add information dependent on the graph structure it should happen when deserializing.
    • DerivedData which is associated data that gets populated later on, namely CFF and numerator
  • The momentum signature is now built into a struct, separating the external signature from internal loop momentum signature. Applying a signature can be done on any iterator with elements that can be summed and negated.
  • To enable serialization of symbolica evaluators, custom Serializable evaluators from spenso are used
    • SerializableAtom also can be used for expression serialization however this serializes the state each time so shouldn't be the default
  • All of symbolica's evaluation API was mirrored to all symbolic variants of spenso's tensors, including special evaluator structs that output sets of tensors.

Details

Numerator

This PR contains the ability to evaluate the numerator associated to a graph through application of Feynman rules encoded in a UFO format. For amplitudes the open lorentz and spinor indices are saturated with polarizations. The numerical value of these (lorentz or bispinor) vectors is computed from the external momenta using the conventions of HELAS. This also means that we had to use a transposed version of the weyl gamma matrices for things to match. The polarizations naturally depend on user defined helicities, that are provided in the same way as for external momenta.

Alternatively, a global numerator can be provided:
ExportSettings.numerator_settings.global_numerator: Option<String>
It can be any string that can be parsed by symbolica and use spenso's tensor format.

Additionally, a global prefactor :Option<GlobalPrefactor> (also in NumeratorSettings) can be provided to saturate all open indices, namely the color indices. This prefactor is split into two: the spin/lorentz prefactor and the color prefactor. Both can be sums of tensors with matching indices.

The obtained expression (global x prefactor or local x prefactor) is stored in the struct Numerator<AppliedFeynmanRules> or Numerator<Global>. Thus the numerator struct is compile time stateful, out of order operations literally cannot compile.

This object can then be simplified in color algebra using fierz identities turning into Numerator<ColorSimplified>. Then it can either be turned into dot products using gamma algebra Numerator<GammaSimplified>, or concretized using spenso: Numerator<Network>. This network version supports showing the network graph using spenso's rich graph output for tensor networks.

graphviz(5)

From there both versions of the numerator are turned into evaluators by calling .contract() turning them into Numerator<Contracted>. This will be a scalar in the gamma simplified case, but could be a tensor with open indices in the spenso concretized version.

This is then turned into an Numerator<Evaluators> using .generate_evaluators(..). This turns the scalar or tensor expression into an object that can be evaluated (implements the evaluate trait) for a single emr set, or for all the cff orientations at once. The backend evaluators are either linearized evaluators or compiled ones as set in the ExportSettings.numerator_settings.eval_settings:

#[serde(tag = "type")]
pub enum NumeratorEvaluatorOptions {
    #[serde(rename = "Single")]
    Single(EvaluatorOptions),
    #[serde(rename = "Joint")]
    Joint(EvaluatorOptions),
    #[serde(rename = "Iterative")]
    Iterative(IterativeOptions),
}

pub struct IterativeOptions {
    pub eval_options: EvaluatorOptions,
    pub iterations: usize,
    pub n_cores: usize,
    pub verbose: bool,
}

pub struct EvaluatorOptions {
    pub cpe_rounds: Option<usize>,
    pub compile_options: NumeratorCompileOptions,
}

#[serde(tag = "subtype")]
pub enum NumeratorCompileOptions {
    #[serde(rename = "Compiled")]
    Compiled,
    #[serde(rename = "NotCompiled")]
    NotCompiled,
}

A single evaluator will not optimize all orientations at all, and thus when asking for all cff orientations, will get called once per orientation. A joint evaluator is optimized as a whole, across all orientations. The iterative evaluator is for when joint optimizing is unfeasable. This reuses the horner form of the initial orientation.

lcnbr added 30 commits July 30, 2024 17:13
Somehow cff serialization was shifting the cursor, and would specifically affect numerator deserialization..
@ValentinHirschi ValentinHirschi marked this pull request as draft October 7, 2024 16:14
@ValentinHirschi ValentinHirschi marked this pull request as ready for review October 7, 2024 16:14
…ad of 3L 6 photons amplitude, use the 1L one, both euclidean and physical. Add new option '--max-runtime' to pytest.
@ValentinHirschi ValentinHirschi marked this pull request as draft October 7, 2024 18:46
@ValentinHirschi ValentinHirschi marked this pull request as ready for review October 7, 2024 18:46
@ValentinHirschi ValentinHirschi marked this pull request as draft October 7, 2024 21:43
@ValentinHirschi ValentinHirschi marked this pull request as ready for review October 7, 2024 21:43
… adding missing data files. Automatically add gcc_s linking when on mac.
@ValentinHirschi ValentinHirschi marked this pull request as draft October 8, 2024 00:30
@ValentinHirschi ValentinHirschi marked this pull request as ready for review October 8, 2024 00:30
@ValentinHirschi ValentinHirschi marked this pull request as draft October 8, 2024 01:48
@ValentinHirschi ValentinHirschi marked this pull request as ready for review October 8, 2024 01:49
@ValentinHirschi ValentinHirschi marked this pull request as draft October 8, 2024 03:11
@ValentinHirschi ValentinHirschi marked this pull request as ready for review October 8, 2024 03:11
@GraDje13 GraDje13 self-assigned this Oct 8, 2024
@GraDje13 GraDje13 self-requested a review October 8, 2024 09:20
@GraDje13 GraDje13 removed their assignment Oct 8, 2024
@ValentinHirschi ValentinHirschi merged commit 67559d2 into main Oct 8, 2024
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.

3 participants