Skip to content

Commit

Permalink
Merge pull request #18 from alphal00p/sixpointoneloop
Browse files Browse the repository at this point in the history
Broken merge to help move towards a stable version with both CFF and float+numerator compatible with latest spenso and symbolica.
  • Loading branch information
ValentinHirschi authored Jul 4, 2024
2 parents 3dfd1b2 + e096c37 commit 943263a
Show file tree
Hide file tree
Showing 26 changed files with 4,698 additions and 1,733 deletions.
79 changes: 67 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ insta = { version = "1.38.0", features = ["yaml", "json", "ron", "toml"] }

[dependencies]
# symbolica = { path = "./python/gammaloop/dependencies/symbolica" }
symbolica = { version = "0.5.0" }
spenso = { version = "0.1.1", features = ["shadowing"] }

symbolica = { version = "0.7.0" }
# spenso = { version = "0.2.0", features = ["shadowing"] }
spenso = { git = "https://github.com/alphal00p/spenso", branch = "master", features = [
"shadowing",
] }

# spencer = { path = "../spencer" }

serde = { version = "1.0", features = ["derive"] }
Expand Down Expand Up @@ -74,7 +79,7 @@ nohash-hasher = "0.2.0"
permutation = "0.4.1"
slotmap = { version = "1.0.7", features = ["serde"] }
ahash = { version = "0.8.8", features = ["serde"] }
num = { version = "0.4.1", features = ["serde"] }
# num = { version = "0.4.1", features = ["serde"] }
pprof = { version = "0.13.0", features = ["flamegraph"] }
derive_more = "0.99.17"
rand_xoshiro = "0.6.0"
Expand All @@ -86,6 +91,9 @@ treena = "0.0.5"
serde_json = "1.0.115"
ctrlc = "3.4.4"
constcat = "0.5.0"
ref-ops = "0.2.5"
delegate = "0.12.0"
portrait = "0.3.0"

[dependencies.pyo3]
features = ["multiple-pymethods"]
Expand Down Expand Up @@ -118,4 +126,8 @@ similar.opt-level = 3


[patch.crates-io]

# spenso = { git = "https://github.com/alphal00p/spenso", branch = "master" }

# spenso = { path = "../spenso" }
symbolica = { path = "./python/gammaloop/dependencies/symbolica" }
5 changes: 3 additions & 2 deletions python/gammaloop/bin/build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_dependencies () {
exit 1
fi

echo "Run 'tail -f "$(PWD)"/dependencies/dependency_build.log' to follow installation progress.";
echo "Run 'tail -f "$(pwd)"/dependencies/dependency_build.log' to follow installation progress.";

cd dependencies
touch LOCK
Expand Down Expand Up @@ -186,7 +186,8 @@ build_dependencies () {
echo "Cloning symbolica ...";
CMD_TO_ACCESS_SYMBOLICA="${CMD_TO_ACCESS_SYMBOLICA:-git clone https://github.com/alphal00p/symbolica}"
$CMD_TO_ACCESS_SYMBOLICA >> dependency_build.log 2>&1
cd symbolica && git reset --hard a260306 >> ../dependency_build.log 2>&1
cd symbolica && git reset --hard 82d19d3 >> ../dependency_build.log 2>&1

cd ..
fi

Expand Down
37 changes: 37 additions & 0 deletions python/gammaloop/tests/test_data/qgraf_outputs/massive_hexagon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
graphs = []
# To be imported after having the gammaloop UFO model named "scalars"

# Hexagon with top quark in the loop
graphs.append(
{
"edges": {
101: {"name": "p1", "PDG": 22, "type": "in", "momentum": "p1", "indices": (), "vertices": (101, 1)},
102: {"name": "p2", "PDG": 22, "type": "out", "momentum": "p2", "indices": (), "vertices": (2, 102)},
103: {"name": "p3", "PDG": 22, "type": "out", "momentum": "p3", "indices": (), "vertices": (3, 103)},
104: {"name": "p4", "PDG": 22, "type": "out", "momentum": "p4", "indices": (), "vertices": (4, 104)},
105: {"name": "p5", "PDG": 22, "type": "out", "momentum": "p5", "indices": (), "vertices": (5, 105)},
106: {"name": "p6", "PDG": 22, "type": "out", "momentum": "p6", "indices": (), "vertices": (6, 106)},
1: {"name": "q1", "PDG": 6, "type": "virtual", "momentum": "N/A", "indices": (), "vertices": (1, 2)},
2: {"name": "q2", "PDG": 6, "type": "virtual", "momentum": "N/A", "indices": (), "vertices": (2, 3)},
3: {"name": "q3", "PDG": 6, "type": "virtual", "momentum": "N/A", "indices": (), "vertices": (3, 4)},
4: {"name": "q4", "PDG": 6, "type": "virtual", "momentum": "N/A", "indices": (), "vertices": (4, 5)},
5: {"name": "q5", "PDG": 6, "type": "virtual", "momentum": "N/A", "indices": (), "vertices": (5, 6)},
6: {"name": "q6", "PDG": 6, "type": "virtual", "momentum": "N/A", "indices": (), "vertices": (6, 1)}
},
"nodes": {
101: {"PDGs": (22,), "momenta": ("p1",), "indices": (), "vertex_id": -1, "edge_ids": (101,)},
102: {"PDGs": (22,), "momenta": ("p2",), "indices": (), "vertex_id": -1, "edge_ids": (102,)},
103: {"PDGs": (22,), "momenta": ("p3",), "indices": (), "vertex_id": -1, "edge_ids": (103,)},
104: {"PDGs": (22,), "momenta": ("p4",), "indices": (), "vertex_id": -1, "edge_ids": (104,)},
105: {"PDGs": (22,), "momenta": ("p5",), "indices": (), "vertex_id": -1, "edge_ids": (105,)},
106: {"PDGs": (22,), "momenta": ("p6",), "indices": (), "vertex_id": -1, "edge_ids": (106,)},
1: {"PDGs": (6, 22, 6), "momenta": ("N/A", "N/A", "N/A"), "indices": (), "vertex_id": 0, "edge_ids": (1, 101, 6)},
2: {"PDGs": (6, 22, 6), "momenta": ("N/A", "N/A", "N/A"), "indices": (), "vertex_id": 0, "edge_ids": (2, 102, 1)},
3: {"PDGs": (6, 22, 6), "momenta": ("N/A", "N/A", "N/A"), "indices": (), "vertex_id": 0, "edge_ids": (3, 103, 2)},
4: {"PDGs": (6, 22, 6), "momenta": ("N/A", "N/A", "N/A"), "indices": (), "vertex_id": 0, "edge_ids": (4, 104, 3)},
5: {"PDGs": (6, 22, 6), "momenta": ("N/A", "N/A", "N/A"), "indices": (), "vertex_id": 0, "edge_ids": (5, 105, 4)},
6: {"PDGs": (6, 22, 6), "momenta": ("N/A", "N/A", "N/A"), "indices": (), "vertex_id": 0, "edge_ids": (6, 106, 5)}
},
"overall_factor": "1"
}
)
11 changes: 7 additions & 4 deletions src/api/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{
SerializableIntegrationState,
},
model::Model,
utils::F,
HasIntegrand, Settings,
};
use ahash::HashMap;
Expand All @@ -19,7 +20,7 @@ use std::{
fs,
path::{Path, PathBuf},
};
use symbolica::printer::PrintOptions;
use symbolica::{domains::float::Complex, printer::PrintOptions};

const GIT_VERSION: &str = git_version!();

Expand Down Expand Up @@ -346,6 +347,7 @@ impl PythonWorker {
is_momentum_space: bool,
use_f128: bool,
) -> PyResult<(f64, f64)> {
let pt = pt.iter().map(|&x| F(x)).collect::<Vec<F<f64>>>();
match self.integrands.get_mut(integrand) {
Some(integrand) => {
let settings = match integrand {
Expand All @@ -363,7 +365,7 @@ impl PythonWorker {
use_f128,
);

Ok((res.re, res.im))
Ok((res.re.0, res.im.0))
}
None => Err(exceptions::PyException::new_err(format!(
"Could not find integrand {}",
Expand All @@ -380,11 +382,12 @@ impl PythonWorker {
workspace_path: &str,
target: Option<(f64, f64)>,
) -> PyResult<Vec<(f64, f64)>> {
let target = target.map(|(re, im)| (F(re), F(im)));
match self.integrands.get_mut(integrand) {
Some(integrand_enum) => match integrand_enum {
Integrand::GammaLoopIntegrand(gloop_integrand) => {
let target = match target {
Some((re, im)) => Some(num::Complex::new(re, im)),
Some((re, im)) => Some(Complex::new(re, im)),
_ => None,
};

Expand Down Expand Up @@ -468,7 +471,7 @@ impl PythonWorker {
.result
.iter()
.tuple_windows()
.map(|(re, im)| (*re, *im))
.map(|(re, im)| (re.0, im.0))
.collect())
}
_ => unimplemented!("unsupported integrand type"),
Expand Down
Loading

0 comments on commit 943263a

Please sign in to comment.