DisplaySettings
DisplaySettings
class DisplaySettingsImmutable 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. Typst/plain source supports ports layout; alternative layouts and custom spacing require a rich HTML or SVG renderer.
Examples
from symbolica.community.tensor import DisplaySettings
settings = DisplaySettings(component_style="array", index_style="alphabet")Attributes
| Name | Description |
|---|---|
commas |
Show comma separators. |
component_style |
Concrete component labels: “superscript” for A(x,7)^{0,1},. |
factor_gap |
Spacing between rendered factors, using the same length units as index_gap. |
index_gap |
Spacing between rendered indices, as a finite Typst length using. |
index_style |
“alphabet” assigns representation-specific letters to generated indices;. |
invariant_style |
Choose compact or degree-explicit scalar invariant notation. |
parentheses |
Include the optional grouping parentheses used by tensor notation. |
show_dimensions |
Include representation dimensions in index notation. |
symbol_scripts |
Render index and component information using symbol scripts where supported. |
tensor_layout |
Rich layout: “ports” places indices by tensor axes; “schoonschip”. |
tensor_view |
Concrete-tensor HTML: “interactive” provides a component explorer with. |
commas
DisplaySettings.commas: typing.Optional[builtins.bool]Show comma separators. None follows the layout: enabled for “call”,
Returns
bool or NoneShow comma separators. None follows the layout: enabled for “call”, disabled otherwise.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().commascomponent_style
DisplaySettings.component_style: typing.Literal['superscript', 'array']Concrete component labels: “superscript” for A(x,7)^{0,1},
Returns
strConcrete 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_stylefactor_gap
DisplaySettings.factor_gap: builtins.strSpacing between rendered factors, using the same length units as index_gap.
Returns
strSpacing between rendered factors, using the same length units as index_gap.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().factor_gapindex_gap
DisplaySettings.index_gap: builtins.strSpacing between rendered indices, as a finite Typst length using
Returns
strSpacing between rendered indices, as a finite Typst length using pt, mm, cm, in, em, or %.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().index_gapindex_style
DisplaySettings.index_style: typing.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_styleinvariant_style
DisplaySettings.invariant_style: typing.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_style
'explicit'parentheses
DisplaySettings.parentheses: builtins.boolInclude the optional grouping parentheses used by tensor notation.
Returns
boolInclude the optional grouping parentheses used by tensor notation.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().parenthesesshow_dimensions
DisplaySettings.show_dimensions: builtins.boolInclude representation dimensions in index notation.
Returns
boolInclude 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_dimensionssymbol_scripts
DisplaySettings.symbol_scripts: builtins.boolRender index and component information using symbol scripts where supported.
Returns
boolRender index and component information using symbol scripts where supported.
Examples
from symbolica.community.tensor import DisplaySettings
value = DisplaySettings().symbol_scriptstensor_layout
DisplaySettings.tensor_layout: typing.Literal['ports', 'schoonschip', 'call']Rich layout: “ports” places indices by tensor axes; “schoonschip”
Returns
strRich 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_layouttensor_view
DisplaySettings.tensor_view: typing.Literal['interactive', 'matrix']Concrete-tensor HTML: “interactive” provides a component explorer with
Returns
strConcrete-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_viewMethods
| Name | Description |
|---|---|
__new__ |
Choose tensor notation, index labels, and component presentation. |
__repr__ |
Return a readable object description for inspection. |
call |
Select the call tensor layout with default options. |
ports |
Select the ports tensor layout with default options. |
schoonschip |
Select the schoonschip tensor layout with default options. |
__new__
DisplaySettings.__new__(
tensor_layout: typing.Literal['ports', 'schoonschip', 'call'] = 'ports',
show_dimensions: builtins.bool = False,
parentheses: builtins.bool = True,
commas: typing.Optional[builtins.bool] = None,
symbol_scripts: builtins.bool = True,
index_gap: builtins.str = '0.08em',
factor_gap: builtins.str = '0.12em',
index_style: typing.Literal['alphabet', 'graph', 'raw'] = 'alphabet',
component_style: typing.Literal['superscript', 'array'] = 'superscript',
tensor_view: typing.Literal['interactive', 'matrix'] = 'interactive',
invariant_style: typing.Literal['compact', 'explicit'] = 'compact',
) -> DisplaySettingsChoose tensor notation, index labels, and component presentation.
Parameters
tensor_layout(str, default “ports”) Rich layout: “ports” places indices by tensor axes; “schoonschip” uses compact contracted-vector notation; “call” uses function-call notation.show_dimensions(bool, default 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, default True) Include the optional grouping parentheses used by tensor notation.commas(bool or None, default None) Show comma separators. None follows the layout: enabled for “call”, disabled otherwise.symbol_scripts(bool, default True) Render index and component information using symbol scripts where supported.index_gap(str, default “0.08em”) Spacing between rendered indices, as a finite Typst length using pt, mm, cm, in, em, or %.factor_gap(str, default “0.12em”) Spacing between rendered factors, using the same length units as index_gap.index_style(str, default “alphabet”) “alphabet” assigns representation-specific letters to generated indices; “graph” shows graph identities; “raw” retains the original labels.component_style(str, default “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(str, default “interactive”) Concrete-tensor HTML: “interactive” provides a component explorer with a Memory grid / Matrix toggle; “matrix” selects static mathematical output.invariant_style({“compact”, “explicit”}, default “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.
Returns
DisplaySettingsImmutable 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")__repr__
DisplaySettings.__repr__() -> builtins.strReturn a readable object description for inspection.
Examples
from symbolica.community import tensor as sp
settings = sp.DisplaySettings()
text = repr(settings)call
DisplaySettings.call() -> DisplaySettingsSelect the call tensor layout with default options.
Returns
DisplaySettingsDefault 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
'call'ports
DisplaySettings.ports() -> DisplaySettingsSelect the ports tensor layout with default options.
Returns
DisplaySettingsDefault presentation with this layout.
Examples
from symbolica.community.tensor import DisplaySettings
DisplaySettings.ports().tensor_layout
'ports'schoonschip
DisplaySettings.schoonschip() -> DisplaySettingsSelect the schoonschip tensor layout with default options.
Returns
DisplaySettingsDefault 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_layout
'schoonschip'