ó
~9­\c           @  s¨   d  d l  m Z m Z d  d l m Z d  d l m Z m Z d  d l m	 Z	 d e	 f d „  ƒ  YZ
 d „  Z d  d l m Z m Z d  d	 l m Z d
 „  Z e e d <d S(   iÿÿÿÿ(   t   print_functiont   division(   t   Basic(   t   adjointt	   conjugate(   t
   MatrixExprt	   Transposec           B  s}   e  Z d  Z e Z d „  Z e d „  ƒ Z e d „  ƒ Z e	 d „ Z
 d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z RS(   s]  
    The transpose of a matrix expression.

    This is a symbolic object that simply stores its argument without
    evaluating it. To actually compute the transpose, use the ``transpose()``
    function, or the ``.T`` attribute of matrices.

    Examples
    ========

    >>> from sympy.matrices import MatrixSymbol, Transpose
    >>> from sympy.functions import transpose
    >>> A = MatrixSymbol('A', 3, 5)
    >>> B = MatrixSymbol('B', 5, 3)
    >>> Transpose(A)
    A.T
    >>> A.T == transpose(A) == Transpose(A)
    True
    >>> Transpose(A*B)
    (A*B).T
    >>> transpose(A*B)
    B.T*A.T

    c         K  s‹   |  j  } | j d t ƒ r< t | t ƒ r< | j |   } n  t | d d  ƒ } | d  k	 r} | ƒ  } | d  k	 rs | St | ƒ St | ƒ Sd  S(   Nt   deept   _eval_transpose(	   t   argt   gett   Truet
   isinstanceR   t   doitt   getattrt   NoneR   (   t   selft   hintsR	   R   t   result(    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR   #   s    	!	c         C  s   |  j  d S(   Ni    (   t   args(   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR	   .   s    c         C  s   |  j  j d  d  d … S(   Niÿÿÿÿ(   R	   t   shape(   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR   2   s    c         C  s   |  j  j | | d | ƒS(   Nt   expand(   R	   t   _entry(   R   t   it   jR   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR   6   s    c         C  s   t  |  j ƒ S(   N(   R   R	   (   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyt   _eval_adjoint9   s    c         C  s   t  |  j ƒ S(   N(   R   R	   (   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyt   _eval_conjugate<   s    c         C  s   |  j  S(   N(   R	   (   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR   ?   s    c         C  s   d d l  m } | |  j ƒ S(   Ni   (   t   Trace(   t   traceR   R	   (   R   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyt   _eval_traceB   s    c         C  s   d d l  m } | |  j ƒ S(   Niÿÿÿÿ(   t   det(   t&   sympy.matrices.expressions.determinantR   R	   (   R   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyt   _eval_determinantF   s    c         C  s3   |  j  d j | ƒ } g  | D] } | j ƒ  ^ q S(   Ni    (   R   t   _eval_derivative_matrix_linest	   transpose(   R   t   xt   linesR   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR!   J   s    (   t   __name__t
   __module__t   __doc__R   t   is_TransposeR   t   propertyR	   R   t   FalseR   R   R   R   R   R    R!   (    (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR      s   						c         C  s   t  |  ƒ j d t ƒ S(   s   Matrix transposeR   (   R   R   R*   (   t   expr(    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyR"   O   s    (   t   askt   Q(   t   handlers_dictc         C  s#   t  t j |  ƒ | ƒ r |  j S|  S(   sÅ   
    >>> from sympy import MatrixSymbol, Q, assuming, refine
    >>> X = MatrixSymbol('X', 2, 2)
    >>> X.T
    X.T
    >>> with assuming(Q.symmetric(X)):
    ...     print(refine(X.T))
    X
    (   R,   R-   t	   symmetricR	   (   R+   t   assumptions(    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyt   refine_TransposeX   s    
N(   t
   __future__R    R   t   sympyR   t   sympy.functionsR   R   t"   sympy.matrices.expressions.matexprR   R   R"   t   sympy.assumptions.askR,   R-   t   sympy.assumptions.refineR.   R1   (    (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/transpose.pyt   <module>   s   G		