format_tensor
symbolica.community.tensor Function
format_tensor(expression: Expression, show_dimensions: Optional[bool] = None, *, settings: Optional[DisplaySettings] = None) -> str Produce compact plain-text tensor notation.
Parameters
expressionExpressionSymbolica tensor syntax or scalar algebra to display. For a TensorExpression or component Tensor, prefer its formatting methods.
show_dimensionsbool, optionalOverride settings.show_dimensions for this call. None retains the selected settings, whose default omits dimensions.
settingsDisplaySettings, optionalTensor notation and display choices. Defaults to DisplaySettings().
Returns
str
Readable tensor text, suitable for logs or terminal output.
Notes
Only ports layout and default spacing are supported in this source format. Use to_html() or to_svg() for other layouts and custom gaps.
Examples
from symbolica import S
expression = S("x") + 1
from symbolica.community.tensor import format_tensor
output = format_tensor(expression)View generated signature source: docs/api/python/spynso3.pyi:10904