GenerationReport

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

GenerationReport

class GenerationReport

Counts and completion status from a diagram-generation run.

The report distinguishes explored topologies and interaction assignments from the physical diagrams retained after numerator checks.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.phi4()
process = model.process(["phi", "phi"], ["phi", "phi"])
result = process.generate_diagrams(loops=1)
diagram = result.diagrams[0]
report = result.report
assert report.completed
assert report.retained_count == len(result.diagrams)

Attributes

Name Description
completed Report whether generation finished without cancellation.
interaction_assignment_count Return the number of interaction assignments examined.
retained_count Return the number of diagrams retained after removing zero numerators.
topology_count Return the number of distinct topologies considered during generation.
zero_numerator_count Return the number of diagrams removed for having an exact zero numerator.

completed

GenerationReport.completed: builtins.bool

Report whether generation finished without cancellation.

Examples

Using the setup in the GenerationReport class example:

assert report.completed  # False means generation was cancelled

interaction_assignment_count

GenerationReport.interaction_assignment_count: builtins.int

Return the number of interaction assignments examined.

Examples

Using the setup in the GenerationReport class example:

assignments_tested = report.interaction_assignment_count

retained_count

GenerationReport.retained_count: builtins.int

Return the number of diagrams retained after removing zero numerators.

Examples

Using the setup in the GenerationReport class example:

assert report.retained_count == len(result.diagrams)

topology_count

GenerationReport.topology_count: builtins.int

Return the number of distinct topologies considered during generation.

Examples

Using the setup in the GenerationReport class example:

assert report.topology_count >= 1

zero_numerator_count

GenerationReport.zero_numerator_count: builtins.int

Return the number of diagrams removed for having an exact zero numerator.

Examples

Using the setup in the GenerationReport class example:

removed_zeroes = report.zero_numerator_count

Methods

Name Description
__repr__ Return a concise constructor-style generation summary.
_repr_html_ Render generation statistics as a compact HTML table.
_repr_pretty_ Write a concise generation summary to an IPython pretty printer.

__repr__

GenerationReport.__repr__() -> builtins.str

Return a concise constructor-style generation summary.

Examples

Using the setup in the GenerationReport class example:

print(result.report)

_repr_html_

GenerationReport._repr_html_() -> builtins.str

Render generation statistics as a compact HTML table.

Examples

Using the setup in the GenerationReport class example:

from IPython.display import display
display(report)

_repr_pretty_

GenerationReport._repr_pretty_(pretty: typing.Any, cycle: builtins.bool) -> None

Write a concise generation summary to an IPython pretty printer.

Examples

Using the setup in the GenerationReport class example:

from IPython.lib.pretty import pretty
text = pretty(report)

Parameters

  • pretty (object) The IPython pretty-printer object.
  • cycle (bool) Whether this object is part of a recursive formatting cycle.