Skip to content

Conversation

@tueda
Copy link
Collaborator

@tueda tueda commented Nov 24, 2025

Update: This PR depends on:

The former may not be needed depending on how we treat the cache files.

TODO:

  • Move the test file (probably) to check/extra. Tests should be fast enough. Put them in check/diagrams.frm. The core routines moved to check/diagrams/diagrams.h.
  • Define the standard test set. For example, it may include 2-loop amplitudes with commonly used options, like:
    • 0
    • `ONEPI_'+`FLOOP_'
  • Add reference-output cache files for the standard test set (in check/.diagrams_cache/).
  • Add optional thorough tests that don't run on CI (possibly in check/diagrams/).
  • Improve CanonicalizeDiagrams performance.

This PR introduces tests for comparing the diagram generator with QGRAF. The core routines also support FeynGraph, which could be helpful when we implement and test vacuum diagrams in the future (#485). For now, the test cases in the file cover only simple 1-loop diagrams and compare them with QGRAF.

The code contains two #pipe preprocessor instructions. One checks whether a cache file exists (see also #240). The other checks the FeynGraph version, for which I couldn't find any way to get it from the result using a Jinja template.

Open questions:

  • where to place this file (check, check/extra or check/diagrams)
  • whether to use the cache and where to store cache files
  • which test cases should be the defaults if we put this file in check

The CanonicalizeDiagrams procedure may perform better if spectators are used in a smarter way.

@coveralls
Copy link

coveralls commented Nov 24, 2025

Coverage Status

coverage: 57.728% (+4.4%) from 53.34%
when pulling f8e9ca0 on tueda:pr/test/diagram-comparison
into 73a6a14 on form-dev:master.

@tueda tueda force-pushed the pr/test/diagram-comparison branch from 93412ae to 97fe0e1 Compare November 25, 2025 03:52
@tueda tueda force-pushed the pr/test/diagram-comparison branch 3 times, most recently from 6feac9e to 9dc826b Compare December 9, 2025 12:36
@tueda tueda marked this pull request as draft December 9, 2025 12:48
@tueda tueda force-pushed the pr/test/diagram-comparison branch 5 times, most recently from 42e1861 to c4f3928 Compare January 6, 2026 08:27
@tueda tueda marked this pull request as ready for review January 6, 2026 08:45
@tueda
Copy link
Collaborator Author

tueda commented Jan 6, 2026

At this point, though the TODOs are not fully completed, this PR can be merged as it improves test code coverage.

@tueda
Copy link
Collaborator Author

tueda commented Jan 6, 2026

Found a bug in CanonicalizeDiagrams:

#include- check/diagrams/diagrams.h
#call SetupPhi3Model

L F =
      +
       1/16
       *node(phi(-k1),phi(k1),phi(-k2))
       *node(phi(-k3),phi(k3),phi(-k4))
       *node(phi(k2),phi(-k5),phi(-k6))
       *node(phi(k4),phi(k5),phi(k6))
;

#call CanonicalizeDiagrams
P +sss;
.end
   F=
      +
       1/8
       *topo(1)
       *node(phi(-k1),phi(-k2),phi(k1))
       *node(phi(-k3),phi(-k4),phi(k3))
       *node(phi(-k5),phi(-k6),phi(k2))
       *node(phi(k4),phi(k5),phi(k6))
      ;

tueda added 3 commits January 7, 2026 13:00
The core part of the diagram generator comparison tests. This includes
FORM routines for comparing the diagram generator with QGRAF and
FeynGraph:

http://cefema-gt.tecnico.ulisboa.pt/~paulo/qgraf.html
https://jens-braun.github.io/FeynGraph/
The standard test set of the diagram generator.
Checked with QGRAF 3.6.10 and FeynGraph 0.1.0b4+gf7ae8f4.
@tueda tueda force-pushed the pr/test/diagram-comparison branch from c4f3928 to f8e9ca0 Compare January 7, 2026 06:14
@tueda
Copy link
Collaborator Author

tueda commented Jan 7, 2026

The bug in CanonicalizeDiagrams was fixed (having been found in phi^3 3-loop vacuum bubbles, leading me to revisit introductory-level material on symmetry factors and counting a total of 1944 terms in Wick contractions).

I added QCD 3-loop vacuum bubbles. The results have been validated against FeynGraph on its main branch. I'm not sure how to use Furry's theorem in FeynGraph (it seems that a custom filter would need to be created), so I added both a test without filtering and one with the 1PI filter.

I also added q -> q g and q Q -> g g.

The gho -> gho tests were removed, as they are essentially the same as q -> q.

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