feynkit_cff/lib.rs
1//! Standalone Cross-Free Family (CFF) combinatorics.
2//!
3//! The crate exposes topology-only and generalized CFF generation. Both use
4//! the recursion owned by `three-dimensional-reps`; FeynKit provides graph
5//! adapters, surface views, residue construction, and Symbolica lowering. It deliberately has no knowledge of GammaLoop settings,
6//! numerical evaluators, or runtime threshold classification. Callers may
7//! construct a [`CffGraph`] explicitly or invoke the extension trait directly
8//! on a finalized FeynKit diagram.
9//!
10//! ```
11//! use feynkit_cff::{
12//! CffEdge, CffGenerator, CffGraph, EdgeFlow, EdgeId, VertexId,
13//! };
14//!
15//! let graph = CffGraph::new(
16//! 2,
17//! [
18//! CffEdge::external(EdgeId::new(0), VertexId::new(0), EdgeFlow::Incoming),
19//! CffEdge::external(EdgeId::new(1), VertexId::new(1), EdgeFlow::Outgoing),
20//! CffEdge::internal(EdgeId::new(2), VertexId::new(0), VertexId::new(1)),
21//! ],
22//! )?;
23//! let result = CffGenerator::default().generate(&graph)?;
24//! assert_eq!(result.report.acyclic_orientations, 2);
25//! # Ok::<_, feynkit_cff::CffError>(())
26//! ```
27
28#![forbid(unsafe_code)]
29
30mod algebra;
31mod error;
32mod expression;
33mod generation;
34mod graph;
35mod ids;
36mod orientation;
37mod surface;
38pub mod symbols;
39mod tree;
40
41pub use algebra::{CutPropagator, SurfacePole};
42pub use error::CffError;
43pub use expression::{CffExpression, OrientationData, OrientationExpression};
44pub use generation::{
45 CffGeneration, CffGenerator, CffOptions, CffReport, CffResult, FeynmanDiagramCffExt,
46 HedgeEdgeRole, HedgeGraphCffExt, ShiftRewrite,
47};
48pub use graph::{CffEdge, CffGraph, EdgeFlow, EdgeKind};
49pub use ids::{EdgeId, VertexId};
50pub use orientation::{
51 EdgeOrientation, GraphOrientation, GraphOrientationExt, OrientationId, OrientationWeight,
52};
53pub use surface::{
54 EnergySurface, EnergySurfaceId, ExternalShift, HSurface, HSurfaceId, RaisedEnergySurfaceData,
55 RaisedEnergySurfaceGroup, RaisedEnergySurfaceId, Surface, SurfaceCache, SurfaceId,
56 SurfaceIdMap, VertexSet,
57};
58pub use tree::{ExpressionTree, ExpressionTreeError, NodeId, TreeNode};
59
60/// Generalized CFF and LTD generation, including repeated poles and bounded
61/// numerator energy dependence, shared with GammaLoop's production runtime.
62pub use three_dimensional_reps as generalized;
63pub use three_dimensional_reps::{
64 Generate3DExpressionOptions, GeneratedThreeDExpression, ParsedGraph, ThreeDGraphSource,
65 generate_3d_expression,
66};