pub struct FeynmanDiagram { /* private fields */ }Expand description
Model-aware Feynman-diagram IR backed by Linnet’s half-edge graph.
Implementations§
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn from_compact_dot(
model: Arc<Model>,
parsed: DotGraph,
) -> Result<(Self, DiagramSourceMap), DiagramError>
pub fn from_compact_dot( model: Arc<Model>, parsed: DotGraph, ) -> Result<(Self, DiagramSourceMap), DiagramError>
Resolve compact physics DOT and retain the exact source-to-final map
used by finalization. Consumers can transport graph-local metadata
without reconstructing ownership from momentum or particle labels.
final_state lists comma-separated particles; | joins allowed alternatives.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn to_linnest(
&self,
highlight: Option<&SuBitGraph>,
isolated: &BTreeSet<usize>,
lmb: Option<&LoopMomentumBasis>,
config: &str,
) -> Result<String, DiagramError>
pub fn to_linnest( &self, highlight: Option<&SuBitGraph>, isolated: &BTreeSet<usize>, lmb: Option<&LoopMomentumBasis>, config: &str, ) -> Result<String, DiagramError>
Emit a complete Typst document that renders this diagram with Linnest.
The document imports the canonical Linnest package tree at
crates/linnest/typst, which must be available below the Typst project
root together with its sibling Kurvst package and the shared physics
styles in assets/embedded/drawing/templates. Particle spin, color,
charge, mass, and TeX names select line patterns, arrows, and labels.
Interaction vertices retain their native identifiers. Amplitude external
legs are dangling half-edges and retain their names, indices, and
incoming/outgoing states as edge data.
GammaLoop’s shared physics layout owns particle styling, label measurement,
force settings, and left/right amplitude placement. Finalized cross sections
contain paired initial-state edges, opened for drawing by default. Set
options.split-initial-state to false to retain their sewn appearance.
Inspection and highlighting always refer to the original diagram.
A native half-edge selection highlights the corresponding structural
halves while retaining the complete graph and its particle styles.
The complement is faded and dotted; an empty selection fades everything.
Selected isolated vertices are supplied separately from the half-edges.
config is a trusted native Typst configuration expression, serialized by
Linnet at the Python boundary. The optional basis is validated against this
graph; its signatures supply momentum labels and SVG inspection metadata.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn numerator_of<S: SubGraphLike + SubSetOps>(
&self,
subgraph: &S,
without: &S,
) -> Result<SymbolicTensor<PartialStructure>, DiagramError>
pub fn numerator_of<S: SubGraphLike + SubSetOps>( &self, subgraph: &S, without: &S, ) -> Result<SymbolicTensor<PartialStructure>, DiagramError>
Construct the selected local numerator using the same boundary and exclusion rules as GammaLoop. Diagram-wide factors remain separate.
pub fn denominator_of<S: SubGraphLike>( &self, subgraph: &S, edge_powers: &BTreeMap<EdgeId, isize>, ) -> Result<Atom, DiagramError>
Sourcepub fn denominator_of_in_dimension<S: SubGraphLike>(
&self,
subgraph: &S,
edge_powers: &BTreeMap<EdgeId, isize>,
dimension: Dimension,
) -> Result<Atom, DiagramError>
pub fn denominator_of_in_dimension<S: SubGraphLike>( &self, subgraph: &S, edge_powers: &BTreeMap<EdgeId, isize>, dimension: Dimension, ) -> Result<Atom, DiagramError>
Symbolic dimension and signed propagator powers follow the runtime UV
representation, retaining its four-argument denom wrapper.
Sourcepub fn superficial_degree_of_divergence_of(
&self,
subgraph: &SuBitGraph,
dimension: i32,
) -> Result<i32, DiagramError>
pub fn superficial_degree_of_divergence_of( &self, subgraph: &SuBitGraph, dimension: i32, ) -> Result<i32, DiagramError>
Local superficial degree for a half-edge selection, including its boundary vertices and excluding physical external momentum carriers.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn integral_family(
&self,
kinematics: &Kinematics,
independent_dot_products: &[Atom],
) -> Result<IntegralFamily, DiagramError>
pub fn integral_family( &self, kinematics: &Kinematics, independent_dot_products: &[Atom], ) -> Result<IntegralFamily, DiagramError>
Complete the graph propagators with preferred or automatic scalar products.
Physical propagators retain their edge order. Candidates are tried in
order, skipping redundant entries; automatic products fill any remaining
directions. Pass an empty slice for automatic completion. Dependent
propagators must be extracted with Self::propagator_family and
partial-fractioned before completing the resulting families.
Sourcepub fn propagator_family(
&self,
kinematics: &Kinematics,
) -> Result<IntegralFamily, DiagramError>
pub fn propagator_family( &self, kinematics: &Kinematics, ) -> Result<IntegralFamily, DiagramError>
Build an integral family from the diagram’s internal quadratic propagators.
Denominators follow ascending internal edge IDs, retaining repeated
propagators and bridges. The stored loop routing supplies momentum names;
dependent external coordinates are eliminated by that same routing.
External carriers and dummy edges are excluded by the shared denominator
builder. Symbolic masses follow its conventions, including UFO ZERO.
Widths, prescriptions and custom UFO denominator formulas are not inferred.
Tree diagrams have no loop-integral family and return an error.
Use IntegralFamily::from_diagram to append auxiliary scalar products
and obtain a complete independent denominator basis.
Sourcepub fn ordered_propagators(
&self,
kinematics: &Kinematics,
) -> Result<Vec<(EdgeId, Atom)>, DiagramError>
pub fn ordered_propagators( &self, kinematics: &Kinematics, ) -> Result<Vec<(EdgeId, Atom)>, DiagramError>
Extract internal quadratic propagators together with their source edge IDs.
Entries follow ascending edge IDs and use the same routing, masses and
exclusions as Self::propagator_family. Repeated propagators and
bridges retain separate entries, allowing consumers to preserve graph
provenance without reconstructing denominator-selection rules.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn momentum_subgraph(&self) -> SuBitGraph
pub fn momentum_subgraph(&self) -> SuBitGraph
Momentum-carrying half-edges, excluding dummy attachments.
Sourcepub fn internal_subgraph(&self) -> SuBitGraph
pub fn internal_subgraph(&self) -> SuBitGraph
Propagator half-edges, excluding both dangling and sewn externals.
pub fn momentum_basis_of( &self, subgraph: &SuBitGraph, ) -> Result<LoopMomentumBasis, DiagramError>
pub fn loop_momentum_bases_of( &self, subgraph: &SuBitGraph, limit: usize, ) -> Result<Vec<LoopMomentumBasis>, DiagramError>
Sourcepub fn compatible_momentum_basis_of(
&self,
subgraph: &SuBitGraph,
parent: &LoopMomentumBasis,
) -> Result<LoopMomentumBasis, DiagramError>
pub fn compatible_momentum_basis_of( &self, subgraph: &SuBitGraph, parent: &LoopMomentumBasis, ) -> Result<LoopMomentumBasis, DiagramError>
Reuse the parent’s loop momenta on the selected propagators, routing
with the same forest constraints as Self::momentum_basis_of.
Sourcepub fn contracted_momentum_basis_of(
&self,
subgraph: &SuBitGraph,
contracted: &InternalSubGraph,
) -> Result<LoopMomentumBasis, DiagramError>
pub fn contracted_momentum_basis_of( &self, subgraph: &SuBitGraph, contracted: &InternalSubGraph, ) -> Result<LoopMomentumBasis, DiagramError>
Route subgraph with each component of contracted shrunk to a node,
using the same forest constraints as Self::momentum_basis_of.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn excise(
&self,
subgraph: &SuBitGraph,
isolated_vertices: &[VertexId],
) -> Result<Self, DiagramError>
pub fn excise( &self, subgraph: &SuBitGraph, isolated_vertices: &[VertexId], ) -> Result<Self, DiagramError>
Excise an independent diagram, preserving the valence of retained vertices.
Vertices touched by the selection retain their whole incident crown. Only internal edges with both halves selected remain paired; every other incident half becomes a dangling boundary leg. In particular, an omitted edge joining two retained vertices becomes two independent external legs. Sewn initial-state carriers are opened using the amplitude particle-flow convention. No external wavefunctions are inserted at new boundaries.
Local numerator fragments follow Self::numerator_of. Half-edge, edge
and vertex indices are relabeled, and an independent momentum basis is
computed. Ambiguous references to an edge split into two legs at the same
vertex are rejected rather than assigned to an arbitrary leg.
A proper region has unit overall factor, numerator prefactor, projector and symmetry factor, and does not inherit whole-diagram physical or spectator cuts: it is never selection-only. Selecting every half-edge and isolated vertex returns an exact independent clone, including the original routing, global metadata and any selection-only state.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn initial_state_tree(&self) -> (SuBitGraph, Vec<EdgeId>)
pub fn initial_state_tree(&self) -> (SuBitGraph, Vec<EdgeId>)
Native half-edge selection removed from topology threshold sides.
Sewn external connections define the initial state. The edge list records the loop-independent paired edges whose attached crowns form the selection.
Source§impl FeynmanDiagram
impl FeynmanDiagram
Sourcepub fn uv_expansion_of(
&self,
subgraph: &SuBitGraph,
uv_mass: &Atom,
dimension: i32,
numerator: Option<&Atom>,
edge_powers: &BTreeMap<EdgeId, isize>,
) -> Result<Atom, DiagramError>
pub fn uv_expansion_of( &self, subgraph: &SuBitGraph, uv_mass: &Atom, dimension: i32, numerator: Option<&Atom>, edge_powers: &BTreeMap<EdgeId, isize>, ) -> Result<Atom, DiagramError>
Expand the selected local integrand through its UV degree of divergence.
Only the selected region’s independent loop momenta are hard. For each loop-dependent propagator, write q = k + p and use t² / [(k + t p)² - t² m² - (1 - t²) uv_mass²]. The numerator is evaluated at k/t + p. Keeping powers through t⁰ after multiplication by t^(-dimension * loops) retains all superficially divergent terms. The bookkeeping scale is then set to one.
The result uses edge momenta and tagged denom propagators, as does
denominator_of. Negate it for an additive local counterterm. A supplied
numerator replaces the selected local numerator and must use edge momenta.
Signed edge_powers override internal propagator powers, defaulting to one;
zero omits a denominator and negative powers move it to the numerator.
Powers do not change the selected region or its independent loop momenta.
Entries outside the selected internal edges are ignored, as in denominator_of.
Projectors, overall factors and numerator prefactors are not added.
Empty and tree regions return zero. This is one simultaneous UV limit,
not a recursive forest subtraction or an integrated pole counterterm.
Source§impl FeynmanDiagram
impl FeynmanDiagram
pub fn builder( model: impl Into<Arc<Model>>, name: impl Into<String>, ) -> FeynmanDiagramBuilder
pub fn model(&self) -> &Model
pub fn model_arc(&self) -> Arc<Model>
pub fn id(&self) -> DiagramId
pub fn name(&self) -> &str
Sourcepub fn symmetry_factor(&self) -> u64
pub fn symmetry_factor(&self) -> u64
Return the raw automorphism order retained as generation provenance.
This value is diagnostic only. Self::overall_factor is the
authoritative symbolic weight and may also include grouping or fermion
signs, so runtime consumers must not apply the symmetry factor again.
pub fn overall_factor(&self) -> &Atom
pub fn numerator(&self) -> &SymbolicTensor<PartialStructure>
Sourcepub fn with_numerator_fragments(
self,
vertices: impl IntoIterator<Item = (VertexId, SymbolicTensor<PartialStructure>)>,
edges: impl IntoIterator<Item = (EdgeId, SymbolicTensor<PartialStructure>)>,
) -> Result<Self, DiagramError>
pub fn with_numerator_fragments( self, vertices: impl IntoIterator<Item = (VertexId, SymbolicTensor<PartialStructure>)>, edges: impl IntoIterator<Item = (EdgeId, SymbolicTensor<PartialStructure>)>, ) -> Result<Self, DiagramError>
Replace local numerator fragments in the finalized index frame and rebuild their product. Fragment edits preserve topology and routing.
Sourcepub fn denominator_expression(&self) -> Result<Atom, DiagramError>
pub fn denominator_expression(&self) -> Result<Atom, DiagramError>
Product of internal quadratic propagators in GammaLoop’s tagged form.
Each denom(edge, Q(edge), mass², Q(edge)² - mass²) uses the symbolic
dimension gammalooprs::dim and the same momenta as the numerator. Masses
remain symbolic except the UFO ZERO parameter. External carriers,
widths, and an imaginary prescription are excluded. Custom UFO
propagator denominators are not instantiated here.
Sourcepub fn numerator_prefactor(&self) -> &SymbolicTensor<PartialStructure>
pub fn numerator_prefactor(&self) -> &SymbolicTensor<PartialStructure>
Global numerator multiplier supplied by the generation request.
Sourcepub fn projector(&self) -> &SymbolicTensor<PartialStructure>
pub fn projector(&self) -> &SymbolicTensor<PartialStructure>
External-state projector applied to the generated numerator.
Sourcepub fn loop_momentum_basis(&self) -> &LoopMomentumBasis
pub fn loop_momentum_basis(&self) -> &LoopMomentumBasis
The routing selected during diagram finalization.
Sourcepub fn cuts(&self) -> &[DiagramCut]
pub fn cuts(&self) -> &[DiagramCut]
Physical cut partitions retained by cross-section generation.
Sourcepub fn cut_particles(
&self,
cut: &DiagramCut,
) -> Result<Vec<ParticleId>, DiagramError>
pub fn cut_particles( &self, cut: &DiagramCut, ) -> Result<Vec<ParticleId>, DiagramError>
Physical final-state particles in the stored order of a finalized cut.
The native left side contains the incoming endpoint of each sewn initial state. A source endpoint on that side carries the stored species into the final state; a target endpoint carries its antiparticle. The same orientation determines the positive-energy cut momentum routing.
Sourcepub fn topology_threshold_candidates(&self) -> &[DiagramThresholdCandidate]
pub fn topology_threshold_candidates(&self) -> &[DiagramThresholdCandidate]
Complete topology-only s-channel inventory used for threshold construction.
Sourcepub fn spectator_cuts(&self) -> &[DiagramSpectatorCut]
pub fn spectator_cuts(&self) -> &[DiagramSpectatorCut]
Spectator cuts that selected a selection-only cross-section diagram.
Invariant, enforced by Self::validate: a diagram with paired
external connections has either at least one physical cut, or is
selection-only, with a non-empty list of the spectator cuts that
selected it; never neither. A selection-only diagram has no physical
cuts and no threshold candidates, and a diagram without paired external
connections has no spectator cuts. Selection-only diagrams support
listing, display, export and re-import; amplitude and integrand
construction refuse them, since physical-cut finalization for spectators
does not exist.
Sourcepub fn is_selection_only(&self) -> bool
pub fn is_selection_only(&self) -> bool
Whether only spectator cuts selected this cross-section diagram.
Sourcepub fn with_spectator_cuts(
self,
spectator_cuts: Vec<DiagramSpectatorCut>,
) -> Result<Self, DiagramError>
pub fn with_spectator_cuts( self, spectator_cuts: Vec<DiagramSpectatorCut>, ) -> Result<Self, DiagramError>
Replace the spectator cuts of a selection-only diagram and refresh its ID.
pub fn underlying(&self) -> &HedgeGraph<DiagramEdge, DiagramVertex>
pub fn vertices(&self) -> impl Iterator<Item = (VertexId, &DiagramVertex)>
pub fn edges( &self, ) -> impl Iterator<Item = (EdgeId, EdgeEndpoints, &DiagramEdge)>
pub fn vertex(&self, id: impl Into<Option<VertexId>>) -> Option<&DiagramVertex>
Sourcepub fn map_data<V, E>(
&self,
map_vertex: V,
map_edge: E,
) -> Result<Self, DiagramError>where
V: FnMut(VertexId, &DiagramVertex) -> DiagramVertex,
E: FnMut(EdgeId, EdgeEndpoints, &DiagramEdge) -> DiagramEdge,
pub fn map_data<V, E>(
&self,
map_vertex: V,
map_edge: E,
) -> Result<Self, DiagramError>where
V: FnMut(VertexId, &DiagramVertex) -> DiagramVertex,
E: FnMut(EdgeId, EdgeEndpoints, &DiagramEdge) -> DiagramEdge,
Transform vertex and edge metadata without changing the diagram topology or stable identifiers.
Sourcepub fn canonical_key(&self) -> Result<CanonicalDiagramKey, DiagramError>
pub fn canonical_key(&self) -> Result<CanonicalDiagramKey, DiagramError>
Build a deterministic key for the model-resolved colored topology.
Canonical labeling is delegated to Symbolica’s graph implementation.
Particle/antiparticle edge representations are normalized so reversing
a directed edge with Self::reverse_edge does not change the key.
Sourcepub fn reverse_edge(&self, edge_id: EdgeId) -> Result<Self, DiagramError>
pub fn reverse_edge(&self, edge_id: EdgeId) -> Result<Self, DiagramError>
Reverse a directed edge while preserving its physical particle flow.
Reversal swaps the endpoints and replaces the referenced particle with its antiparticle. Undirected edges are unchanged. The returned diagram is fully model-validated and retains all stable identifiers.
Sourcepub fn relabel_external_legs(
&self,
relabeling: &BTreeMap<usize, usize>,
) -> Result<Self, DiagramError>
pub fn relabel_external_legs( &self, relabeling: &BTreeMap<usize, usize>, ) -> Result<Self, DiagramError>
Atomically relabel external indices, leaving unspecified legs unchanged.
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Return this diagram with a finalized deterministic name.
Sourcepub fn with_overall_factor(self, factor: Atom) -> Self
pub fn with_overall_factor(self, factor: Atom) -> Self
Return this diagram with a finalized numerator-independent multiplier.
Sourcepub fn with_numerator(
self,
numerator: SymbolicTensor<PartialStructure>,
) -> Result<Self, DiagramError>
pub fn with_numerator( self, numerator: SymbolicTensor<PartialStructure>, ) -> Result<Self, DiagramError>
Return this diagram with a replacement scalar or tensor numerator.
The replacement becomes the numerator fragment of the first interaction vertex; every other vertex and edge fragment becomes one. This keeps the aggregate numerator authoritative while preserving the interaction and particle assignments needed to interpret the topology. A diagram without an interaction vertex cannot own such a replacement. Diagram IDs identify the model-resolved topology and remain unchanged.
Sourcepub fn with_numerator_prefactor(
self,
prefactor: SymbolicTensor<PartialStructure>,
) -> Self
pub fn with_numerator_prefactor( self, prefactor: SymbolicTensor<PartialStructure>, ) -> Self
Replace the global numerator multiplier in the finalized index frame.
Local numerator fragments, their aggregate, topology and routing remain unchanged. This replaces the previous multiplier without multiplying it into the local fragments or re-inferring its logical ports and proofs.
Sourcepub fn with_projector(self, projector: SymbolicTensor<PartialStructure>) -> Self
pub fn with_projector(self, projector: SymbolicTensor<PartialStructure>) -> Self
Return this diagram with a replacement external-state projector.
The projector is numerator payload and therefore does not alter the topology-derived diagram ID.
Sourcepub fn with_cuts(self, cuts: Vec<DiagramCut>) -> Result<Self, DiagramError>
pub fn with_cuts(self, cuts: Vec<DiagramCut>) -> Result<Self, DiagramError>
Replace the finalized physical cuts and refresh the content-derived ID.
Installing physical cuts supersedes a selection-only state, so any
spectator cuts are dropped when cuts is non-empty.
Sourcepub fn with_topology_threshold_candidates(
self,
candidates: Vec<DiagramThresholdCandidate>,
) -> Result<Self, DiagramError>
pub fn with_topology_threshold_candidates( self, candidates: Vec<DiagramThresholdCandidate>, ) -> Result<Self, DiagramError>
Replace the complete topology-only threshold inventory.
Sourcepub fn with_topology_threshold_partitions(
self,
partitions: Vec<(Vec<DiagramHalfEdge>, Vec<DiagramHalfEdge>)>,
) -> Result<Self, DiagramError>
pub fn with_topology_threshold_partitions( self, partitions: Vec<(Vec<DiagramHalfEdge>, Vec<DiagramHalfEdge>)>, ) -> Result<Self, DiagramError>
Install topology-only threshold candidates from complete half-edge partitions.
Sourcepub fn with_cut_partitions(
self,
partitions: Vec<(Vec<DiagramHalfEdge>, Vec<DiagramHalfEdge>)>,
) -> Result<Self, DiagramError>
pub fn with_cut_partitions( self, partitions: Vec<(Vec<DiagramHalfEdge>, Vec<DiagramHalfEdge>)>, ) -> Result<Self, DiagramError>
Install physical cuts from authoritative left/right half-edge partitions.
The oriented crossing endpoints, coupling-order summaries, and loop counts are derived from this diagram’s finalized topology. This is the appropriate constructor when a valid partition is transported onto an isomorphic representative whose interaction assignment may differ. Supplied half-edge IDs must already use this diagram’s edge-ID frame.
Sourcepub fn half_edge_id(&self, half_edge: DiagramHalfEdge) -> Option<Hedge>
pub fn half_edge_id(&self, half_edge: DiagramHalfEdge) -> Option<Hedge>
Resolve a stable endpoint reference to its native Linnet half-edge.
Sourcepub fn half_edges(&self) -> impl Iterator<Item = DiagramHalfEdge> + '_
pub fn half_edges(&self) -> impl Iterator<Item = DiagramHalfEdge> + '_
Enumerate existing half-edges, in their native channel order.
Sourcepub fn with_loop_momentum_edges(
self,
requested: &[EdgeId],
) -> Result<Self, DiagramError>
pub fn with_loop_momentum_edges( self, requested: &[EdgeId], ) -> Result<Self, DiagramError>
Select a spanning-forest routing by its ordered independent edges.
Sourcepub fn with_loop_momentum_tree_edges(
self,
requested: &[EdgeId],
) -> Result<Self, DiagramError>
pub fn with_loop_momentum_tree_edges( self, requested: &[EdgeId], ) -> Result<Self, DiagramError>
Select a spanning-forest routing by its ordered tree edges.
The requested edges are validated and materialized directly. This is useful when a generator already chose a deterministic spanning forest: it does not enumerate the other spanning forests of the diagram.
Sourcepub fn with_canonical_loop_momentum_basis(self) -> Result<Self, DiagramError>
pub fn with_canonical_loop_momentum_basis(self) -> Result<Self, DiagramError>
Select the first spanning-forest routing in the canonical topology
order historically used by GammaLoop’s sorted_g graphs.
Stable FeynKit edge IDs remain the momentum labels. Only the ordering used to choose the default tree is changed, so the coordinate convention is fixed before downstream transport.
Sourcepub fn with_first_loop_momentum_basis_in_edge_order(
self,
ordered: &[EdgeId],
) -> Result<Self, DiagramError>
pub fn with_first_loop_momentum_basis_in_edge_order( self, ordered: &[EdgeId], ) -> Result<Self, DiagramError>
Select the first depth-first basis for an explicit internal-edge order.
Paired cross-section connections root the traversal at the attachment retained as hedge zero by legacy sewing (the outgoing side), in connection order. One-sided amplitude connections use their only attachment. No other spanning forests are enumerated. Generators can therefore reproduce a pre-existing half-edge insertion convention without moving topology or routing ownership into a downstream runtime.
pub fn to_json(&self) -> Result<String, DiagramError>
pub fn from_json( model: impl Into<Arc<Model>>, input: &str, ) -> Result<Self, DiagramError>
Sourcepub fn validate(&self) -> Result<(), DiagramError>
pub fn validate(&self) -> Result<(), DiagramError>
Check model references and the structural invariants expected of a generated Feynman diagram.
Sourcepub fn to_dot(&self) -> Result<String, DiagramError>
pub fn to_dot(&self) -> Result<String, DiagramError>
Serialize to a stable DOT dialect that can be parsed by Self::from_dot.
Sourcepub fn from_dot(
model: impl Into<Arc<Model>>,
input: &str,
) -> Result<Self, DiagramError>
pub fn from_dot( model: impl Into<Arc<Model>>, input: &str, ) -> Result<Self, DiagramError>
Parse compact model-aware DOT or the stable dialect emitted by Self::to_dot.
Sourcepub fn from_dot_set(
model: impl Into<Arc<Model>>,
input: &str,
) -> Result<Vec<Self>, DiagramError>
pub fn from_dot_set( model: impl Into<Arc<Model>>, input: &str, ) -> Result<Vec<Self>, DiagramError>
Parse one or more model-aware FeynKit DOT diagrams from a single document.
Each graph accepts the same compact or annotated dialect as Self::from_dot.
Annotated exports must carry the structure fingerprint of model; numeric
parameter values may differ. A legacy full model fingerprint is accepted
only for the unchanged model.
This is the canonical
import path for a set of finalized cross-section diagrams because their
typed physical cuts are retained graph by graph.
pub fn loop_count(&self) -> usize
Sourcepub fn superficial_degree_of_divergence(
&self,
dimension: i32,
) -> Result<i32, DiagramError>
pub fn superficial_degree_of_divergence( &self, dimension: i32, ) -> Result<i32, DiagramError>
Return the local superficial UV degree in dimension spacetime dimensions.
This is dimension * loops + sum(vertex degrees) + sum(edge degrees - 2).
Degrees come from the stored local numerators; each internal propagator
contributes its quadratic denominator. External legs, the projector, and
diagram-wide prefactors are excluded, as in GammaLoop’s local UV counting.
All momenta at a vertex scale together. This is a superficial bound, not
a test of cancellations in the contracted numerator or of subdivergences.
Zero means logarithmic, positive means power divergent, and negative means
superficially convergent.
Sourcepub fn loop_momentum_bases(
&self,
) -> Result<Vec<LoopMomentumBasis>, DiagramError>
pub fn loop_momentum_bases( &self, ) -> Result<Vec<LoopMomentumBasis>, DiagramError>
Enumerate every spanning-forest-induced loop momentum basis.
Sourcepub fn loop_momentum_bases_with_limit(
&self,
limit: usize,
) -> Result<Vec<LoopMomentumBasis>, DiagramError>
pub fn loop_momentum_bases_with_limit( &self, limit: usize, ) -> Result<Vec<LoopMomentumBasis>, DiagramError>
Enumerate at most limit loop momentum bases.
Trait Implementations§
Source§impl Clone for FeynmanDiagram
impl Clone for FeynmanDiagram
Source§fn clone(&self) -> FeynmanDiagram
fn clone(&self) -> FeynmanDiagram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FeynmanDiagram
impl Debug for FeynmanDiagram
Auto Trait Implementations§
impl !Freeze for FeynmanDiagram
impl !RefUnwindSafe for FeynmanDiagram
impl !UnwindSafe for FeynmanDiagram
impl Send for FeynmanDiagram
impl Sync for FeynmanDiagram
impl Unpin for FeynmanDiagram
impl UnsafeUnpin for FeynmanDiagram
Blanket Implementations§
§impl<T> AtomComponentOptimizable<()> for T
impl<T> AtomComponentOptimizable<()> for T
fn optimize_atom_components(self) -> T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.