Skip to main content

MomentumRouting

Trait MomentumRouting 

Source
pub trait MomentumRouting {
Show 13 methods // Required methods fn generate_loop_momentum_bases_of<S: SubGraphLike>( &self, subgraph: &S, ) -> Vec<MomentumBasis> where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>; fn generate_loop_momentum_bases(&self) -> Vec<MomentumBasis>; fn replacement_impl<'a, S: SubSetLike, I>( &self, rep: impl Fn(EdgeIndex, Atom, Atom) -> Replacement, subgraph: &S, lmb: &MomentumBasis, loop_symbol: Symbol, ext_symbol: Symbol, loop_args: &'a [I], ext_args: &'a [I], filter_pair: fn(&HedgePair) -> bool, emr_id: bool, ) -> Vec<Replacement> where &'a I: Into<AtomOrView<'a>>; fn lmb_impl<S: SubGraphLike + SubSetOps + ModifySubSet<HedgePair> + ModifySubSet<Hedge>>( &self, subgraph: &S, tree: &S, externals: S, ) -> LmbResult<MomentumBasis> where S::Base: ModifySubSet<Hedge> + SubGraphLike; fn lmb_of<S: SubGraphLike<Base = SuBitGraph>>( &self, subgraph: &S, ) -> MomentumBasis; fn lmb(&self) -> MomentumBasis; fn shrunken_sub_lmb( &self, outer: &SuBitGraph, shrunken: &InternalSubGraph, externals: SuBitGraph, parent_lmb: Option<&MomentumBasis>, ) -> LmbResult<MomentumBasis>; fn shrunken_lmb_of( &self, outer: &SuBitGraph, shrunken: &InternalSubGraph, ) -> MomentumBasis; fn compatible_sub_lmb<S: SubGraphLike>( &self, subgraph: &S, externals: S::Base, lmb: &MomentumBasis, ) -> MomentumBasis where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>; fn empty_lmb(&self) -> MomentumBasis; fn dot_lmb_of<S: SubGraphLike>( &self, subgraph: &S, lmb: &MomentumBasis, ) -> String; // Provided methods fn try_compatible_sub_lmb<S: SubGraphLike>( &self, subgraph: &S, externals: S::Base, lmb: &MomentumBasis, ) -> LmbResult<MomentumBasis> where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge> { ... } fn cotree_lmb<S: SubGraphLike + SubSetOps + SubGraphOps + ModifySubSet<HedgePair> + ModifySubSet<Hedge>>( &self, subgraph: &S, cotree: &S, externals: S, ) -> MomentumBasis where S::Base: ModifySubSet<Hedge> + SubGraphLike { ... }
}

Required Methods§

Source

fn generate_loop_momentum_bases_of<S: SubGraphLike>( &self, subgraph: &S, ) -> Vec<MomentumBasis>
where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,

Enumerate all loop-momentum bases induced by spanning forests of subgraph.

Each spanning forest covering the same nodes as subgraph produces one basis. Empty subgraphs return an empty list.

Source

fn generate_loop_momentum_bases(&self) -> Vec<MomentumBasis>

Enumerate all loop-momentum bases for the full graph.

Source

fn replacement_impl<'a, S: SubSetLike, I>( &self, rep: impl Fn(EdgeIndex, Atom, Atom) -> Replacement, subgraph: &S, lmb: &MomentumBasis, loop_symbol: Symbol, ext_symbol: Symbol, loop_args: &'a [I], ext_args: &'a [I], filter_pair: fn(&HedgePair) -> bool, emr_id: bool, ) -> Vec<Replacement>
where &'a I: Into<AtomOrView<'a>>,

Core implementation shared by the public replacement constructors.

For each edge of subgraph whose [HedgePair] passes filter_pair, this computes the loop-dependent and external-flow atoms from lmb and passes them to rep.

rep is the final replacement builder: it receives the original edge id, the loop-dependent atom, and the external-flow atom, and returns the Replacement inserted into the result vector.

loop_symbol and ext_symbol select the function symbol used for the generated loop and external terms, while loop_args and ext_args are appended to those function calls. When emr_id is true, the generated loop/external indices are the concrete edge ids stored in the basis; otherwise they are the compact loop/external basis positions.

Source

fn lmb_impl<S: SubGraphLike + SubSetOps + ModifySubSet<HedgePair> + ModifySubSet<Hedge>>( &self, subgraph: &S, tree: &S, externals: S, ) -> LmbResult<MomentumBasis>
where S::Base: ModifySubSet<Hedge> + SubGraphLike,

Build a loop-momentum basis for subgraph using tree as the spanning forest guide and externals as the external-flow carriers.

tree must cover the same nodes as subgraph. externals must only contain nodes from subgraph; it chooses which external edges are treated as true external flows and which one in each connected component becomes the dependent external.

Source

fn lmb_of<S: SubGraphLike<Base = SuBitGraph>>( &self, subgraph: &S, ) -> MomentumBasis

Construct one canonical loop-momentum basis for subgraph.

This uses subgraph itself as the forest guide and the full crown of the subgraph as its external carriers.

Source

fn lmb(&self) -> MomentumBasis

Construct the canonical loop-momentum basis for the full graph.

Source

fn shrunken_sub_lmb( &self, outer: &SuBitGraph, shrunken: &InternalSubGraph, externals: SuBitGraph, parent_lmb: Option<&MomentumBasis>, ) -> LmbResult<MomentumBasis>

Build the LMB for outer - shrunken while each connected component of shrunken acts as a contracted passage node.

Source

fn shrunken_lmb_of( &self, outer: &SuBitGraph, shrunken: &InternalSubGraph, ) -> MomentumBasis

Construct the canonical shrunken-subgraph LMB using the full crown of outer as external-flow carriers.

Source

fn compatible_sub_lmb<S: SubGraphLike>( &self, subgraph: &S, externals: S::Base, lmb: &MomentumBasis, ) -> MomentumBasis
where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,

Construct a basis for subgraph that reuses loop edges from lmb whenever the induced cut still spans the same connected components.

This is used when descending into a subgraph while keeping its loop variables compatible with a parent basis.

Source

fn empty_lmb(&self) -> MomentumBasis

Return the empty basis with no loop or external generators.

Source

fn dot_lmb_of<S: SubGraphLike>( &self, subgraph: &S, lmb: &MomentumBasis, ) -> String

Render a DOT graph whose edge labels show the explicit momentum carried by each edge according to lmb.

Provided Methods§

Source

fn try_compatible_sub_lmb<S: SubGraphLike>( &self, subgraph: &S, externals: S::Base, lmb: &MomentumBasis, ) -> LmbResult<MomentumBasis>
where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,

Fallible form of Self::compatible_sub_lmb for callers that must handle an unavailable parent-compatible basis without panicking. The default preserves compatibility with external trait implementations that only implement the original infallible method.

Source

fn cotree_lmb<S: SubGraphLike + SubSetOps + SubGraphOps + ModifySubSet<HedgePair> + ModifySubSet<Hedge>>( &self, subgraph: &S, cotree: &S, externals: S, ) -> MomentumBasis
where S::Base: ModifySubSet<Hedge> + SubGraphLike,

Construct a basis from a chosen cotree of subgraph.

The cotree is converted into the corresponding tree by subtracting it from subgraph, then forwarded to Self::lmb_impl.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<E, V, H> MomentumRouting for HedgeGraph<E, V, H>

Source§

fn lmb_impl<S: SubGraphLike + SubSetOps + ModifySubSet<HedgePair> + ModifySubSet<Hedge>>( &self, subgraph: &S, forest_guide: &S, externals: S, ) -> LmbResult<MomentumBasis>
where S::Base: ModifySubSet<Hedge> + SubGraphLike,

Route the non-dummy external carriers on the selected nodes, including boundary half-edges absent from the selection. Omitted paired carriers within one component carry independent soft momenta.

Source§

fn empty_lmb(&self) -> MomentumBasis

Source§

fn lmb(&self) -> MomentumBasis

Source§

fn shrunken_sub_lmb( &self, outer: &SuBitGraph, shrunken: &InternalSubGraph, externals: SuBitGraph, parent_lmb: Option<&MomentumBasis>, ) -> LmbResult<MomentumBasis>

Source§

fn shrunken_lmb_of( &self, outer: &SuBitGraph, shrunken: &InternalSubGraph, ) -> MomentumBasis

Source§

fn lmb_of<S: SubGraphLike<Base = SuBitGraph>>( &self, subgraph: &S, ) -> MomentumBasis

Source§

fn compatible_sub_lmb<S: SubGraphLike>( &self, subgraph: &S, externals: S::Base, lmb: &MomentumBasis, ) -> MomentumBasis
where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,

Source§

fn try_compatible_sub_lmb<S: SubGraphLike>( &self, subgraph: &S, externals: S::Base, lmb: &MomentumBasis, ) -> LmbResult<MomentumBasis>
where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,

Source§

fn generate_loop_momentum_bases_of<S: SubGraphLike>( &self, subgraph: &S, ) -> Vec<MomentumBasis>
where S::Base: SubGraphLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,

Source§

fn generate_loop_momentum_bases(&self) -> Vec<MomentumBasis>

Source§

fn replacement_impl<'a, S: SubSetLike, I>( &self, rep: impl Fn(EdgeIndex, Atom, Atom) -> Replacement, subgraph: &S, lmb: &MomentumBasis, loop_symbol: Symbol, ext_symbol: Symbol, loop_args: &'a [I], ext_args: &'a [I], filter_pair: fn(&HedgePair) -> bool, emr_id: bool, ) -> Vec<Replacement>
where &'a I: Into<AtomOrView<'a>>,

Source§

fn dot_lmb_of<S: SubGraphLike>( &self, subgraph: &S, lmb: &MomentumBasis, ) -> String

Implementors§