Skip to content

Commit

Permalink
test: no spin correlation
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed May 28, 2024
1 parent c2edd6a commit ca47f86
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
10 changes: 10 additions & 0 deletions feynamp/test/spincorrelation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import List

from feynml.leg import Leg

from feynamp import sympy
from feynamp.leg import color_vector_to_casimir, get_color_vector, get_leg_momentum


def assert_spincorrelation(sympy_expr, fd, legs: List[Leg], model):
assert 1 == 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import logging

import equation_database.isbn_9780511628788 as ref
import sympy
from feynml.interface.qgraf import style
from feynmodel.interface.qgraf import feynmodel_to_qgraf
from feynmodel.interface.ufo import load_ufo_model
from pyfeyn2.feynmandiagram import FeynML
from pyqgraf import qgraf
from xsdata.formats.dataclass.parsers import XmlParser

from feynamp.form import compute_squared
from feynamp.test.colorcorrelation import assert_colorcorrelation
from feynamp.test.spincorrelation import assert_spincorrelation

logger = logging.getLogger("feynamp")
logger.setLevel(logging.DEBUG)


def test_colorcorrelation_ee_qq():
fm = load_ufo_model("ufo_sm")
qfm = feynmodel_to_qgraf(fm, True, False)

qgraf.install()
xml_string = qgraf.run(
"e_minus[p1], e_plus[p2]",
"u[p3], u_bar[p4]",
loops=0,
loop_momentum="l",
model=qfm,
style=style,
)

parser = XmlParser()
fml = parser.from_string(xml_string, FeynML)
fds = [fml.diagrams[0]]
born = compute_squared(fds, fm)
cc = compute_squared(fds, fm, spincorrelated=True)
assert (cc / born).simplify().equals(sympy.parse_expr("0"))

assert_spincorrelation(cc / born, fds[0], fds[0].legs, fm)

0 comments on commit ca47f86

Please sign in to comment.