Skip to content

Commit

Permalink
fix(build): 🐛 update rust in flake and fix cfg condition bug by addin…
Browse files Browse the repository at this point in the history
…g higher_loops feature
  • Loading branch information
lcnbr committed Jul 29, 2024
1 parent 751ae19 commit 99b3375
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
13 changes: 7 additions & 6 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ bench = false
[features]
extension-module = ["pyo3/extension-module"]
default = ["python_api"]
higher_loops = []

python_api = ["pyo3", "extension-module"]
binary = []
Expand Down
24 changes: 12 additions & 12 deletions flake.lock

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

20 changes: 19 additions & 1 deletion src/numerator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{ser::SerializeStruct, Deserialize, Serialize};
use spenso::{
complex::Complex,
network::TensorNetwork,
parametric::ParamTensor,
parametric::{ParamTensor, PatternReplacement},
structure::{Lorentz, NamedStructure, PhysReps, RepName, Shadowable, TensorStructure},
symbolic::SymbolicTensor,
};
Expand Down Expand Up @@ -127,9 +127,27 @@ impl Numerator {
replacements.extend(model.dependent_coupling_replacements());
replacements.extend(model.internal_parameter_replacements());

let reps = replacements
.iter()
.map(|(lhs, rhs)| Replacement::new(lhs, rhs))
.collect_vec();

if let Some(net) = &mut self.network {
net.replace_all_multiple_repeat_mut(&reps);
}

let mut split_reps = vec![];
split_reps.extend(model.valued_coupling_re_im_split(fn_map));
split_reps.extend(model.external_parameter_re_im_split(fn_map));

let reps = split_reps
.iter()
.map(|(lhs, rhs)| Replacement::new(lhs, rhs))
.collect_vec();

if let Some(net) = &mut self.network {
net.replace_all_multiple_repeat_mut(&reps);
}
}

pub fn compile(&mut self, _graph: &Graph) {
Expand Down

0 comments on commit 99b3375

Please sign in to comment.