DisplaySettings
symbolica.community.tensor Class
DisplaySettings(tensor_layout: Literal['ports', 'schoonschip', 'call'] = 'ports', show_dimensions: bool = False, parentheses: bool = True, commas: Optional[bool] = None, symbol_scripts: bool = True, index_gap: str = '0.08em', factor_gap: str = '0.12em', index_style: Literal['alphabet', 'graph', 'raw'] = 'alphabet', component_style: Literal['superscript', 'array'] = 'superscript', tensor_view: Literal['interactive', 'matrix'] = 'interactive', invariant_style: Literal['compact', 'explicit'] = 'compact') Immutable presentation options for tensor notation and component displays.
Formatting does not change indices, tensor algebra, or component order. The defaults use representation-specific index alphabets and an interactive component explorer. The direct MathML pager supports rich layouts and gaps; static Typst/plain source supports ports layout. HTML uses direct MathML; customizable Typst projects and SVG exports retain the Typst notation backend.
Examples
from symbolica.community.tensor import DisplaySettings
settings = DisplaySettings(component_style="array", index_style="alphabet")Constructor
#Choose tensor notation, index labels, and component presentation.
Returns
DisplaySettings
Immutable settings to pass to formatting methods.
Notes
The tensor_view option affects concrete tensor HTML, not symbolic TensorExpression algebra or TensorNetwork graph rendering.
Examples
from symbolica.community.tensor import DisplaySettings
settings = DisplaySettings(component_style="array", tensor_view="matrix")Parameters
| Name | Type | Default | Description |
|---|---|---|---|
tensor_layout | Literal[ | 'ports' | Rich layout: "ports" places indices by tensor axes; "schoonschip" uses compact contracted-vector notation; "call" uses function-call notation. |
show_dimensions | bool | False | Include representation dimensions in index notation and scalar invariants. Invariants then show their degree and representation, such as C_2(F_3). |
parentheses | bool | True | Include the optional grouping parentheses used by tensor notation. |
commas | Optional[ | None | Show comma separators. None follows the layout: enabled for "call", disabled otherwise. |
symbol_scripts | bool | True | Render index and component information using symbol scripts where supported. |
index_gap | str | '0.08em' | Spacing between rendered indices, as a finite length using pt, mm, cm, in, em, or %. |
factor_gap | str | '0.12em' | Spacing between rendered factors, using the same length units as index_gap. |
index_style | Literal[ | 'alphabet' | "alphabet" assigns representation-specific letters to generated indices; "graph" shows graph identities; "raw" retains the original labels. |
component_style | Literal[ | 'superscript' | Concrete component labels: "superscript" for A(x,7)^{0,1}, or "array" for A(x,7)[0,1]. Scalar arguments stay in parentheses. |
tensor_view | Literal[ | 'interactive' | Concrete-tensor HTML: "interactive" provides a component explorer with a Memory grid / Matrix toggle; "matrix" selects static mathematical output. |
invariant_style | Literal[ | 'compact' | Compact quadratic color notation uses C_F, C_A and T_R. Explicit notation uses C_2(F), C_2(A) and I_2(F). Both use C_k(R), I_k(R) and G_k(R, S) for higher invariants. show_dimensions adds the dimension to each representation label and disables quadratic aliases. Older scalar symbols have no representation dimension to display. |
Member details
tensor_layout
Property · read-only#tensor_layout: Literal['ports', 'schoonschip', 'call'] Rich layout: "ports" places indices by tensor axes; "schoonschip"
Returns
str
Rich layout: "ports" places indices by tensor axes; "schoonschip" uses compact contracted-vector notation; "call" uses function-call notation.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().tensor_layoutindex_style
Property · read-only#index_style: Literal['alphabet', 'graph', 'raw'] "alphabet" assigns representation-specific letters to generated indices;
Returns
str
"alphabet" assigns representation-specific letters to generated indices; "graph" shows graph identities; "raw" retains the original labels.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().index_stylecomponent_style
Property · read-only#component_style: Literal['superscript', 'array'] Concrete component labels: "superscript" for A(x,7)^{0,1},
Returns
str
Concrete component labels: "superscript" for A(x,7)^{0,1}, or "array" for A(x,7)[0,1]. Scalar arguments stay in parentheses.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().component_styletensor_view
Property · read-only#tensor_view: Literal['interactive', 'matrix'] Concrete-tensor HTML: "interactive" provides a component explorer with
Returns
str
Concrete-tensor HTML: "interactive" provides a component explorer with a Memory grid / Matrix toggle; "matrix" selects static mathematical output.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().tensor_viewinvariant_style
Property · read-only#invariant_style: Literal['compact', 'explicit'] Choose compact or degree-explicit scalar invariant notation.
Returns
str
"compact" uses C_F, C_A and T_R for the quadratic color invariants; "explicit" uses C_2(F), C_2(A) and I_2(F). Higher degrees use C_k(R), I_k(R) and G_k(R, S) in either style.
Examples
from symbolica.community.tensor import DisplaySettings
DisplaySettings(invariant_style="explicit").invariant_styleshow_dimensions
Property · read-only#show_dimensions: boolInclude representation dimensions in index notation.
Returns
bool
Include representation dimensions in index notation and scalar invariants. Invariants then show their degree and representation, such as C_2(F_3).
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().show_dimensionsparentheses
Property · read-only#parentheses: boolInclude the optional grouping parentheses used by tensor notation.
Returns
bool
Include the optional grouping parentheses used by tensor notation.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().parenthesescommas
Property · read-only#commas: Optional[bool] Show comma separators. None follows the layout: enabled for "call",
Returns
bool or None
Show comma separators. None follows the layout: enabled for "call", disabled otherwise.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().commassymbol_scripts
Property · read-only#symbol_scripts: boolRender index and component information using symbol scripts where supported.
Returns
bool
Render index and component information using symbol scripts where supported.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().symbol_scriptsindex_gap
Property · read-only#index_gap: strSpacing between rendered indices, as a finite length using
Returns
str
Spacing between rendered indices, as a finite length using pt, mm, cm, in, em, or %.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().index_gapfactor_gap
Property · read-only#factor_gap: strSpacing between rendered factors, using the same length units as index_gap.
Returns
str
Spacing between rendered factors, using the same length units as index_gap.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().factor_gapports
Static method#ports() -> DisplaySettingsSelect the ports tensor layout with default options.
Returns
DisplaySettings
Default presentation with this layout.
Examples
from symbolica.community.tensor import DisplaySettings
DisplaySettings.ports().tensor_layoutschoonschip
Static method#schoonschip() -> DisplaySettingsSelect the schoonschip tensor layout with default options.
Returns
DisplaySettings
Default presentation with this layout.
Notes
Use with rich HTML or SVG rendering. Plain and Typst source methods require ports layout.
Examples
from symbolica.community.tensor import DisplaySettings
DisplaySettings.schoonschip().tensor_layoutcall
Static method#call() -> DisplaySettingsSelect the call tensor layout with default options.
Returns
DisplaySettings
Default presentation with this layout; comma separators are enabled.
Notes
Use with rich HTML or SVG rendering. Plain and Typst source methods require ports layout.
Examples
from symbolica.community.tensor import DisplaySettings
DisplaySettings.call().tensor_layout__repr__
Method#__repr__() -> strReturn a readable object description for inspection.
Examples
from symbolica.community import tensor as sp
settings = sp.DisplaySettings()
text = repr(settings)View generated signature source: docs/api/python/spynso3.pyi:389