Skip to content

index(symbol=None) ΒΆ

Create an index variable.

Parameters:

Name Type Description Default
symbol str

A human-readable symbol. The symbol will be used for screen printing and LaTeX rendering. Must conform to the format described by the tsrex formal grammar.

None

Note

The symbol is only meant for human comprehension and is not used in equality/identity tests of the indices.

Returns:

Type Description
TsrEx

A single-index tensor expression.

Source code in funfact/lang/_tsrex.py
def index(symbol=None):
    '''Create an index variable.

    Args:
        symbol (str):
            A human-readable symbol.
            The symbol will be used for screen printing and LaTeX rendering.
            Must conform to the format described by the tsrex formal grammar.

    !!! note
        The symbol is only meant for human comprehension and is not used in
        equality/identity tests of the indices.

    Returns:
        TsrEx: A single-index tensor expression.
    '''
    return TsrEx(P.index(AbstractIndex(symbol), bound=False, kron=False))
Back to top