Spenso · latest
On this page

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

NameTypeDefaultDescription
tensor_layoutLiteral['ports', 'schoonschip', 'call']'ports'

Rich layout: "ports" places indices by tensor axes; "schoonschip" uses compact contracted-vector notation; "call" uses function-call notation.

show_dimensionsboolFalse

Include representation dimensions in index notation and scalar invariants. Invariants then show their degree and representation, such as C_2(F_3).

parenthesesboolTrue

Include the optional grouping parentheses used by tensor notation.

commasOptional[bool]None

Show comma separators. None follows the layout: enabled for "call", disabled otherwise.

symbol_scriptsboolTrue

Render index and component information using symbol scripts where supported.

index_gapstr'0.08em'

Spacing between rendered indices, as a finite length using pt, mm, cm, in, em, or %.

factor_gapstr'0.12em'

Spacing between rendered factors, using the same length units as index_gap.

index_styleLiteral['alphabet', 'graph', 'raw']'alphabet'

"alphabet" assigns representation-specific letters to generated indices; "graph" shows graph identities; "raw" retains the original labels.

component_styleLiteral['superscript', 'array']'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_viewLiteral['interactive', 'matrix']'interactive'

Concrete-tensor HTML: "interactive" provides a component explorer with a Memory grid / Matrix toggle; "matrix" selects static mathematical output.

invariant_styleLiteral['compact', 'explicit']'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_layout

index_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_style

component_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_style

tensor_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_view

invariant_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_style

show_dimensions

Property · read-only#
show_dimensions: bool

Include 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_dimensions

parentheses

Property · read-only#
parentheses: bool

Include 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().parentheses

commas

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().commas

symbol_scripts

Property · read-only#
symbol_scripts: bool

Render 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_scripts

index_gap

Property · read-only#
index_gap: str

Spacing 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_gap

factor_gap

Property · read-only#
factor_gap: str

Spacing 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_gap

ports

Static method#
ports() -> DisplaySettings

Select the ports tensor layout with default options.

Returns

DisplaySettings

Default presentation with this layout.

Examples

from symbolica.community.tensor import DisplaySettings
DisplaySettings.ports().tensor_layout

schoonschip

Static method#
schoonschip() -> DisplaySettings

Select 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_layout

call

Static method#
call() -> DisplaySettings

Select 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__() -> str

Return a readable object description for inspection.

Examples

from symbolica.community import tensor as sp
settings = sp.DisplaySettings()
text = repr(settings)