<commit_before>"""Module that defines indexed objects with arbitrary transformation properties.

    The classes Indexed, IndexedElement and Idx represent a matrix element M(i, j)
    as in the following graph:

       1) The IndexedElement class represents an element of the indexed object.
                  |
               ___|___
              '       '
               M(i, j)
              /   \__\____
              |           \
              |            \
              |     2) The Idx class represent indices and each Idx can
              |        optionally contain information about its range.
              |
    3) The Indexed class represents the `stem' of an indexed object, here `M'.
    The stem used by itself is usually taken to represent the entire array.


    Examples
    ========

    To express the above matrix element example you would write:

    >>> from sympy.tensor import Indexed, Idx
    >>> from sympy import symbols
    >>> i, j, n, m = symbols('i j n m', integer=True)
    >>> M = Indexed('M')
    >>> M(i, j)
    M(i, j)

    If the indexed objects will be converted to component based arrays, e.g.
    numpy arrays, you also need to provide (symbolic) dimensions.  This is done
    with the Idx class:

    >>> ii = Idx(i, m)
    >>> jj = Idx(j, n)
    >>> M(ii, jj)
    M(i, j)
    >>> M(ii, jj).dimensions
    [m, n]
    >>> M(ii, jj).ranges
    [(0, -1 + m), (0, -1 + n)]

    To express a matrix-vector product in terms of Indexed objects:

    >>> x = Indexed('x')
    >>> M(ii, jj)*x(jj)
    M(i, j)*x(j)


    TODO:  (some ideas for improvement)

    o test and guarantee numpy compatibility

    o functions to operate on the indexed expressions
       - check_conformance()
       - determine_resulting_indices()
       - determine_summation_indices()
       - identify standard constructs, e.g matrix-vector product in a subexpression

    o functions to generate component based arrays (numpy and sympy.Matrix)
       - generate a single array directly from Indexed<commit_msg>tensor: skip doctest that depends on factor order<commit_after>"""Module that defines indexed objects with arbitrary transformation properties.

    The classes Indexed, IndexedElement and Idx represent a matrix element M(i, j)
    as in the following graph:

       1) The IndexedElement class represents an element of the indexed object.
                  |
               ___|___
              '       '
               M(i, j)
              /   \__\____
              |           \
              |            \
              |     2) The Idx class represent indices and each Idx can
              |        optionally contain information about its range.
              |
    3) The Indexed class represents the `stem' of an indexed object, here `M'.
    The stem used by itself is usually taken to represent the entire array.


    Examples
    ========

    To express the above matrix element example you would write:

    >>> from sympy.tensor import Indexed, Idx
    >>> from sympy import symbols
    >>> i, j, n, m = symbols('i j n m', integer=True)
    >>> M = Indexed('M')
    >>> M(i, j)
    M(i, j)

    If the indexed objects will be converted to component based arrays, e.g.
    numpy arrays, you also need to provide (symbolic) dimensions.  This is done
    with the Idx class:

    >>> ii = Idx(i, m)
    >>> jj = Idx(j, n)
    >>> M(ii, jj)
    M(i, j)
    >>> M(ii, jj).dimensions
    [m, n]
    >>> M(ii, jj).ranges
    [(0, -1 + m), (0, -1 + n)]

    To express a matrix-vector product in terms of Indexed objects:

    >>> x = Indexed('x')
    >>> M(ii, jj)*x(jj)     #doctest: +SKIP
    M(i, j)*x(j)


    TODO:  (some ideas for improvement)

    o test and guarantee numpy compatibility

    o functions to operate on the indexed expressions
       - check_conformance()
       - determine_resulting_indices()
       - determine_summation_indices()
       - identify standard constructs, e.g matrix-vector product in a subexpression

    o functions to generate component based arrays (numpy and sympy.Matrix)
       - generate a single array directly from Indexed
{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.003401360544217687, 'mean_word_length': 2.0541543026706233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2191871', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1146, 'n_words': 468}