-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/form/qcd/2_to_2/colorcorrelation/test_colorcorrelation_gg_qq.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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 | ||
|
||
logger = logging.getLogger("feynamp") | ||
logger.setLevel(logging.DEBUG) | ||
|
||
|
||
def test_colorcorrelation_gg_qq(): | ||
fm = load_ufo_model("ufo_sm") | ||
qfm = feynmodel_to_qgraf(fm, True, False) | ||
|
||
qgraf.install() | ||
xml_string = qgraf.run( | ||
"g[p1], g[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, colorcorrelated=False) | ||
cc = compute_squared(fds, fm, colorcorrelated=True) | ||
|
||
assert_colorcorrelation(cc / born, fds, fm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/form/qcd/2_to_2/spincorrelation/test_spincorrelation_gg_qq.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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_spincorrelation_gg_qq(): | ||
fm = load_ufo_model("ufo_sm") | ||
qfm = feynmodel_to_qgraf(fm, True, False) | ||
|
||
qgraf.install() | ||
xml_string = qgraf.run( | ||
"g[p1], g[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, colorcorrelated=False) | ||
sc = compute_squared(fds, fm, spincorrelated=True) | ||
|
||
assert_spincorrelation(sc / born, fds, fm) |