expand_matrices_in_symbols_to_expressions

expand_matrices_in_symbols_to_expressions(symbols_to_expressions)[source]

A mapping of symbols to expression might contain matrix symbols. This method generates a mapping for each matrix component.

Examples

The matrix M is mapped to the 2*T. This method returns additional mappings for all matrix components of M.

>>> M = sy.MatrixSymbol("M", 2, 1)
>>> T = sy.MatrixSymbol("T", 2, 1)
>>> expand_matrices_in_symbols_to_expressions({
...     M: 2 * T,
...     T[0]: 1,
...     T[1]: 1,
... })
{M[0, 0]: 2*T[0, 0], M[1, 0]: 2*T[1, 0]}
Parameters:

symbols_to_expressions – Dictionary mapping symbols to expressions

Returns:

Dictionary with additional mappings of matrix components to expressions