AmplitudeRender
Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.
AmplitudeRender
class AmplitudeRenderA rendered amplitude collection retaining its configured diagram snapshots.
Examples
from symbolica.community import hepkit as hep
process = hep.Model.phi4().process(["phi", "phi"], ["phi", "phi"])
amplitude = hep.Amplitude(process.generate_diagrams().diagrams)
drawing = amplitude.render(max_diagrams=None)Attributes
| Name | Description |
|---|---|
diagrams |
Rendered diagram snapshots in contribution order, bounded by max_diagrams. |
diagrams
AmplitudeRender.diagrams: builtins.list[DiagramRender]Rendered diagram snapshots in contribution order, bounded by max_diagrams.
Examples
Using the setup in the AmplitudeRender class example:
svg = drawing.diagrams[0].to_svg()Methods
| Name | Description |
|---|---|
__repr__ |
Summarize the number of rendered contributions in text-only frontends. |
_mime_ |
Display the configured collection in Marimo. |
_repr_html_ |
Display the configured collection in IPython and Jupyter. |
to_html |
Export the configured collection as interactive notebook HTML. |
__repr__
AmplitudeRender.__repr__() -> builtins.strSummarize the number of rendered contributions in text-only frontends.
Examples
Using the setup in the AmplitudeRender class example:
text = repr(drawing)_mime_
AmplitudeRender._mime_() -> tuple[builtins.str, builtins.str]Display the configured collection in Marimo.
Examples
Using the setup in the AmplitudeRender class example:
import marimo as mo
mo.as_html(drawing)_repr_html_
AmplitudeRender._repr_html_() -> builtins.strDisplay the configured collection in IPython and Jupyter.
Examples
Using the setup in the AmplitudeRender class example:
from IPython.display import display
display(drawing)to_html
AmplitudeRender.to_html() -> builtins.strExport the configured collection as interactive notebook HTML.
Examples
Using the setup in the AmplitudeRender class example:
html = drawing.to_html()