ó
~9­\c           @   sö  d  Z  d d l m Z d d l Z d d l m Z m Z m Z m Z m	 Z	 m
 Z
 m Z m Z m Z d d l m Z m Z d d l m
 Z
 d d l m Z d d l m Z d d	 l m Z d
 e f d „  ƒ  YZ e d d d d ƒ Z e d d d d ƒ Z e d d d d ƒ Z e d d d d ƒ Z e d d ƒ Z e d ƒ Z e d ƒ Z e d d ƒ Z  e d d ƒ Z! e d d ƒ Z" e d d d d ƒ Z# e d d d d ƒ Z$ e d d  ƒ Z% e d d! ƒ Z& e d d" d d# ƒ Z' e d d$ d d% ƒ Z( e d& ƒ Z) e d d' d d( ƒ Z* e d d) d d* ƒ Z+ e d d+ d d, ƒ Z, e d d- ƒ Z- e d d. ƒ Z. e d d/ d d0 ƒ Z/ e d d1 d d2 ƒ Z0 e d d3 ƒ Z1 e d d4 ƒ Z2 d5 e
 f d6 „  ƒ  YZ3 e3 e e e g d7 e4 d e4 d d8 d d ƒ d e4 d d8 d d9 ƒ d e4 d d8 d d8 d d ƒ d e4 d d8 d d8 d d9 ƒ d e4 d d8 d d: d d9 ƒ d  e4 d d: d d8 d d; ƒ d! e4 d d8 d d d d9 ƒ d" e4 d d ƒ d$ e4 d d: d d8 d d ƒ d& e4 d d< ƒ ƒ 
ƒZ5 e5 j6 e g d= e4 d' e4 d d8 d d: d d d d; ƒ d) e4 d d8 d d: d d9 d d; ƒ d+ e4 d d d d9 d d: d d< ƒ d- e4 d d d d9 d d: d d> ƒ d. e4 d d8 d d: d d9 d d9 ƒ d/ e4 d d8 d d8 ƒ d1 e4 d d8 d d d d9 ƒ d3 e4 d d: d d8 d d d d9 ƒ ƒ ƒZ7 e7 j6 e e e g ƒ Z8 e8 j6 e2 g ƒ Z9 d S(?   sÉ  
Definition of physical dimensions.

Unit systems will be constructed on top of these dimensions.

Most of the examples in the doc use MKS system and are presented from the
computer point of view: from a human point, adding length to time is not legal
in MKS but it is in natural system; for a computer in natural system there is
no time dimension (but a velocity dimension instead) - in the basis - so the
question of adding time to length has no meaning.
iÿÿÿÿ(   t   divisionN(	   t   Integert   Matrixt   St   Symbolt   sympifyt   Basict   Tuplet   Dictt   default_sort_key(   t   reducet   string_types(   R   (   t   Expr(   t   Pow(   t   SymPyDeprecationWarningt	   Dimensionc           B   s@  e  Z d  Z d Z e ƒ  Z e Z e Z	 e Z
 e Z d d „ Z e d „  ƒ Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  e Z! e  Z" e d „ Z# e$ d „  ƒ Z% e$ d „  ƒ Z& e d d „ ƒ Z' d „  Z( RS(   s•  
    This class represent the dimension of a physical quantities.

    The ``Dimension`` constructor takes as parameters a name and an optional
    symbol.

    For example, in classical mechanics we know that time is different from
    temperature and dimensions make this difference (but they do not provide
    any measure of these quantites.

        >>> from sympy.physics.units import Dimension
        >>> length = Dimension('length')
        >>> length
        Dimension(length)
        >>> time = Dimension('time')
        >>> time
        Dimension(time)

    Dimensions can be composed using multiplication, division and
    exponentiation (by a number) to give new dimensions. Addition and
    subtraction is defined only when the two objects are the same dimension.

        >>> velocity = length / time
        >>> velocity
        Dimension(length/time)

    It is possible to use a dimension system object to get the dimensionsal
    dependencies of a dimension, for example the dimension system used by the
    SI units convention can be used:

        >>> from sympy.physics.units.dimensions import dimsys_SI
        >>> dimsys_SI.get_dimensional_dependencies(velocity)
        {'length': 1, 'time': -1}
        >>> length + length
        Dimension(length)
        >>> l2 = length**2
        >>> l2
        Dimension(length**2)
        >>> dimsys_SI.get_dimensional_dependencies(l2)
        {'length': 2}

    g      *@c         C   sÖ   t  | t ƒ r t | ƒ } n t | ƒ } t  | t ƒ sH t d ƒ ‚ n  t  | t ƒ rf t | ƒ } n$ | d  k	 rŠ t  | t ƒ sŠ t ‚ n  | d  k	 r® t j |  | | ƒ } n t j |  | ƒ } | | _	 | | _
 | S(   Ns2   Dimension name needs to be a valid math expression(   t
   isinstanceR   R   R   R   t	   TypeErrort   Nonet   AssertionErrort   __new__t   _namet   _symbol(   t   clst   namet   symbolt   obj(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR   Q   s    		c         C   s   |  j  S(   N(   R   (   t   self(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR   i   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR   m   s    c         C   s   t  j |  ƒ S(   N(   R   t   __hash__(   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR   q   s    c         C   s#   t  | t ƒ r |  j | j k St S(   N(   R   R   R   t   False(   R   t   other(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __eq__t   s    c         C   s2   |  j  d k r d |  j Sd |  j |  j  f Sd S(   sE   
        Display the string representation of the dimension.
        s   Dimension(%s)s   Dimension(%s, %s)N(   R   R   R   (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __str__y   s    c         C   s
   |  j  ƒ  S(   N(   R    (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __repr__‚   s    c         C   s   |  S(   N(    (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __neg__…   s    c      	   C   s®   t  d d d d d d d d ƒ j ƒ  |  j j s@ t d	 ƒ ‚ n  |  j } | t j k rg t d
 ƒ ‚ n  t t j ƒ } t	 i d | 6ƒ | | <t j
 d  t	 | ƒ f t _ d  S(   Nt   deprecated_since_versions   1.2t   issuei4  t   features$   do not call ._register_as_base_dim()t
   useinsteadt   DimensionSystems*   Base dimensions need to have symbolic names   already in dependencies dicti   i   (   R   t   warnR   t	   is_SymbolR   t   dimsys_defaultt   dimensional_dependenciest
   IndexErrort   dictR   t   argst   _args(   R   R   t   d(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   _register_as_base_dimˆ   s    	c         C   s‹   d d l  m } t | ƒ } t | t ƒ r‡ | j | ƒ rR t | j | ƒ ƒ } n  t | t ƒ rq |  | k rq |  St t |  ƒ j	 | ƒ S|  S(   Niÿÿÿÿ(   t   Quantity(
   t   sympy.physics.units.quantitiesR2   R   R   R   t   hasR   t   get_dimensional_exprt   supert   __add__(   R   R   R2   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR7   š   s    c         C   s   |  | S(   N(    (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __radd__¥   s    c         C   s   |  | S(   N(    (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __sub__¨   s    c         C   s   |  | S(   N(    (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __rsub__­   s    c         C   s   |  j  | ƒ S(   N(   t   _eval_power(   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __pow__²   s    c         C   s   t  | ƒ } t |  j | ƒ S(   N(   R   R   R   (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR;   µ   s    c         C   s   d d l  m } t | t ƒ rŒ | j | ƒ rF t | j | ƒ ƒ } n  t | t ƒ ri t |  j | j ƒ S| j sv |  St	 t |  ƒ j
 | ƒ S|  S(   Niÿÿÿÿ(   R2   (   R3   R2   R   R   R4   R   R5   R   t   free_symbolsR6   t   __mul__(   R   R   R2   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR>   ¹   s    	c         C   s   |  | S(   N(    (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __rmul__Å   s    c         C   s   |  t  | d ƒ S(   Niÿÿÿÿ(   R   (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __div__È   s    c         C   s   | t  |  d ƒ S(   Niÿÿÿÿ(   t   pow(   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __rdiv__Ë   s    c      	   C   sn   t  d d d d d d d d ƒ j ƒ  |  j } t j | ƒ } | rZ | i  k rZ i d	 d
 6Sd „  | j ƒ  Dƒ S(   NR#   s   1.2R$   i4  R%   s   do not callR&   R'   i   t   dimensionlessc         S   s%   i  |  ] \ } } | t  | ƒ “ q S(    (   t   str(   t   .0t   it   j(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>Ü   s   	 (   R   R(   R   R*   t   get_dimensional_dependenciest   items(   R   t   mark_dimensionlessR   t   dimdep(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRH   Ñ   s    	c         C   s    t  d „  d „  | j ƒ  Dƒ ƒ S(   Nc         S   s   |  | S(   N(    (   t   xt   y(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   <lambda>à   t    c         s   s%   |  ] \ } } t  | ƒ | Vq d  S(   N(   R   (   RE   R0   t   e(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys	   <genexpr>á   s    (   R
   RI   (   R   t   dependencies(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   _from_dimensional_dependenciesÞ   s    	c      	   C   s2   t  d d d d d d d d ƒ j ƒ  t j | ƒ S(	   NR#   s   1.2R$   i4  R%   s%   do not call from `Dimension` objects.R&   R'   (   R   R(   R*   RH   (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt&   _get_dimensional_dependencies_for_nameä   s    c         C   sZ   |  j  d k r t S| d k rG t d d d d d d ƒ j ƒ  t } n  | j |  ƒ i  k S(	   s”   
        Check if the dimension object really has a dimension.

        A dimension should have at least one component with non-zero power.
        i   R#   s   1.2R$   i4  R%   s   wrong classN(   R   t   TrueR   R   R(   R*   RH   (   R   R+   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   is_dimensionlessî   s    	c         C   sA   x: | j  |  ƒ j ƒ  D] } t | t t f ƒ s t Sq Wt Sd S(   s  
        Check if the dimension object has only integer powers.

        All the dimension powers should be integers, but rational powers may
        appear in intermediate steps. This method may be used to check that the
        final result is well-defined.
        N(   RH   t   valuesR   t   intR   R   RT   (   R   t   dim_syst   dpow(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   has_integer_powers   s    	N()   t   __name__t
   __module__t   __doc__t   _op_priorityR-   t   _dimensional_dependenciesRT   t   is_commutativeR   t	   is_numbert   is_positivet   is_realR   R   t   propertyR   R   R   R   R    R!   R"   R1   R7   R8   R9   R:   R<   R;   R>   R?   R@   RB   t   __truediv__t   __rtruediv__RH   t   classmethodRR   RS   RU   RZ   (    (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR      sD   *																		
R   t   lengthR   t   Lt   masst   Mt   timet   Tt   currentt   It   temperaturet   amount_of_substancet   luminous_intensityt   velocityt   accelerationt   momentumt   forcet   Ft   energyt   Et   powert   pressuret	   frequencyt   ft   actiont   At   volumet   voltaget   Ut	   impedancet   Zt   conductancet   Gt   capacitancet
   inductancet   charget   Qt   magnetic_densityt   Bt   magnetic_fluxt   informationR'   c           B   s  e  Z d  Z g  i  d d d „ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z d „  Z	 e
 d „ Z d „  Z g  i  d d d „ Z e d	 „  ƒ Z d
 „  Z d „  Z d „  Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z d „  Z d „  Z d „  Z e d „  ƒ Z e d „  ƒ Z RS(   sä  
    DimensionSystem represents a coherent set of dimensions.

    The constructor takes three parameters:

    - base dimensions;
    - derived dimensions: these are defined in terms of the base dimensions
      (for example velocity is defined from the division of length by time);
    - dependency of dimensions: how the derived dimensions depend
      on the base dimensions.

    Optionally either the ``derived_dims`` or the ``dimensional_dependencies``
    may be omitted.
    c   
         sY  t  | ƒ } | d  k	 s$ | d  k	 rF t d d d d d d ƒ j ƒ  n  d „  } g  | D] } | | ƒ ^ qV } g  | D] } | | ƒ ^ qu } x{ | D]s } | j } | | k rð t | | ƒ d k sá | | j | d  ƒ d k rð t d	 ƒ ‚ n  t i d | 6ƒ | | <q” Wd
 „  ‰ xH | j	 ƒ  D]: } | | ƒ } | | k r!| | k r!| j
 | ƒ q!q!W‡ f d †  ‰  ‡  ‡ f d †  | j ƒ  Dƒ } xY | D]Q } | | k r¹t d | ƒ ‚ n  | j | k r”t i d | j 6ƒ | | <q”q”W| j d t ƒ | j d t ƒ t | Œ  } t | Œ  } t d „  | j ƒ  Dƒ ƒ } t j |  | | | ƒ }	 |	 S(   NR#   s   1.2R$   i4  R&   s!   do not define a `name` or `descr`c         S   sh   t  |  t ƒ r$ t t |  ƒ ƒ }  n@ t  |  t ƒ r6 n. t  |  t ƒ rT t |  ƒ }  n t d |  ƒ ‚ |  S(   Ns   %s wrong type(   R   R   R   R   R   (   t   dim(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt	   parse_dimU  s    i   s!   Repeated value in base dimensionsc         S   sb   t  |  t ƒ r |  j St  |  t ƒ r/ t |  ƒ St  |  t ƒ rB |  St d t |  ƒ |  f ƒ ‚ d  S(   Ns   unrecognized type %s for %s(   R   R   R   R   R   R   t   type(   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   parse_dim_namek  s    
c            s    t  ‡  f d †  |  j ƒ  Dƒ ƒ S(   Nc            s%   i  |  ] \ } } | ˆ  | ƒ “ q S(    (    (   RE   RF   RG   (   R’   (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>{  s   	 (   R   RI   (   R0   (   R’   (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt
   parse_dictz  s    c            s+   i  |  ]! \ } } ˆ  | ƒ ˆ | ƒ “ q S(    (    (   RE   RF   RG   (   R“   R’   (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>~  s   	 s%   Dimension %s both in base and derivedt   keyc         S   s%   i  |  ] \ } } t  | ƒ | “ q S(    (   R   (   RE   RF   RG   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>  s   	 (   R-   R   R   R(   R   t   lent   getR,   R   t   keyst   appendRI   t
   ValueErrort   sortR	   R   R   R   (
   R   t	   base_dimst   derived_dimsR+   R   t   descrR   RF   R   R   (    (   R“   R’   s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR   K  sH    			
!c         C   s   |  j  d S(   Ni    (   R.   (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR›   ‘  s    c         C   s   |  j  d S(   Ni   (   R.   (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRœ   •  s    c         C   s   |  j  d S(   Ni   (   R.   (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR+   ™  s    c            sj  ˆ j  r" t |  j j ˆ i  ƒ ƒ Sˆ j r/ i  St j ‰  ˆ j rÄ t j	 t
 ƒ } g  ˆ j D] } ˆ  | ƒ ^ qZ } x; | D]3 } x* | j ƒ  D] \ } } | | c | 7<qŒ Wqy Wd „  | j ƒ  Dƒ Sˆ j rö ˆ  ˆ j ƒ } ‡ f d †  | j ƒ  Dƒ Sˆ j rf‡  f d †  ˆ j Dƒ }	 ˆ j |	 Œ  }
 t |
 t ƒ rCt j |
 ƒ S|
 j ˆ j k rYi  Sˆ  |
 ƒ Sn  d  S(   Nc         S   s+   i  |  ]! \ } } | d  k r | | “ q S(   i    (    (   RE   t   kt   v(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>­  s   	 c            s&   i  |  ] \ } } | ˆ  j  | “ q S(    (   t   exp(   RE   Rž   RŸ   (   R   (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>±  s   	 c         3   s$   |  ] } t  j ˆ  | ƒ ƒ Vq d  S(   N(   R   RR   (   RE   t   arg(   t   get_for_name(    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys	   <genexpr>´  s   (   R)   R-   R+   R–   t	   is_NumberR*   RS   t   is_Mult   collectionst   defaultdictRW   R.   RI   t   is_Powt   baset   is_Functiont   funcR   R   RH   (   R   R   t   retRF   t   dictsR0   Rž   RŸ   R   R.   t   result(    (   R¢   R   s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRS     s0    				"		c         C   sy   t  | t ƒ r | j } n  t  | t ƒ r9 t | ƒ } n  |  j | ƒ } | re | i  k re i d d 6Sd „  | j ƒ  Dƒ S(   Ni   RC   c         S   s%   i  |  ] \ } } | t  | ƒ “ q S(    (   RD   (   RE   RF   RG   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pys
   <dictcomp>È  s   	 (   R   R   R   R   R   RS   RI   (   R   R   RJ   RK   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRH   ¿  s    c         C   s(   |  j  | ƒ } |  j  | ƒ } | | k S(   N(   RH   (   R   t   dim1t   dim2t   deps1t   deps2(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   equivalent_dimsÊ  s    c      	   C   s’   | d  k	 s | d  k	 r@ t d d d d d d d d ƒ j ƒ  n  t |  j ƒ } | j | ƒ t t |  j ƒ t | ƒ t |  j	 ƒ t | ƒ | ƒ S(	   NR#   s   1.2R$   i4  R%   s(   name and descriptions of DimensionSystemR&   s&   do not specify `name` or `description`(
   R   R   R(   R-   R+   t   updateR'   t   tupleR›   Rœ   (   R   t   new_base_dimst   new_derived_dimst   new_dim_depsR   t   descriptiont   deps(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   extendÏ  s    c      	   C   s;   t  d d d d d d d d ƒ j ƒ  t t |  d	 t ƒƒ S(
   s  
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Sort dimensions given in argument using their str function.

        This function will ensure that we get always the same tuple for a given
        set of dimensions.
        R#   s   1.2R$   i4  R%   t	   sort_dimsR&   s!   sorted(..., key=default_sort_key)R”   (   R   R(   R´   t   sortedRD   (   t   dims(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR»   á  s    c      	   C   sS   t  d d d d d d d d ƒ j ƒ  |  j | ƒ } | d	 k rO t | ƒ ‚ n  | S(
   s    
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Shortcut to the get_dim method, using key access.
        R#   s   1.2R$   i4  R%   s   the get [ ] operatorR&   s   the dimension definitionN(   R   R(   t   get_dimR   t   KeyError(   R   R”   R0   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __getitem__õ  s    c      	   C   s2   t  d d d d d d d d ƒ j ƒ  |  j | ƒ S(	   s“   
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Wrapper to the method print_dim_base
        R#   s   1.2R$   i4  R%   s   call DimensionSystemR&   s   the dimension definition(   R   R(   t   print_dim_base(   R   t   unit(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   __call__	  s    c         C   s&   | j  d k r t S|  j | ƒ i  k S(   s”   
        Check if the dimension object really has a dimension.

        A dimension should have at least one component with non-zero power.
        i   (   R   RT   RH   (   R   t	   dimension(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRU     s    c         C   sX   t  g  ƒ } x3 |  j D]( } | j t  t j | ƒ j ƒ  ƒ ƒ q Wt t | d t ƒƒ S(   s’   
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        List all canonical dimension names.
        R”   (	   t   setR›   R³   R*   RH   R—   R´   R¼   RD   (   R   t   dimsetRF   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   list_can_dims#  s    	&c         C   s5   t  d „  g  |  j D] } |  j | ƒ ^ q ƒ } | S(   sp  
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Compute the inverse transformation matrix from the base to the
        canonical dimension basis.

        It corresponds to the matrix where columns are the vector of base
        dimensions in canonical basis.

        This matrix will almost never be used because dimensions are always
        defined with respect to the canonical basis, so no work has to be done
        to get them in this basis. Nonetheless if this matrix is not square
        (or not invertible) it means that we have chosen a bad basis.
        c         S   s   |  j  | ƒ S(   N(   t   row_join(   RL   RM   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRN   C  RO   (   R
   R›   t   dim_can_vector(   R   R0   t   matrix(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   inv_can_transf_matrix1  s    	(c         C   sA   t  d „  g  t |  j d t ƒD] } |  j | ƒ ^ q ƒ j ƒ  S(   s!  
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Return the canonical transformation matrix from the canonical to the
        base dimension basis.

        It is the inverse of the matrix computed with inv_can_transf_matrix().
        c         S   s   |  j  | ƒ S(   N(   RÈ   (   RL   RM   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRN   V  RO   R”   (   R
   R¼   R›   RD   RÉ   t   inv(   R   R0   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   can_transf_matrixG  s    	c         C   sF   g  } x3 |  j  D]( } | j t j | ƒ j | d ƒ ƒ q Wt | ƒ S(   s´   
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Dimensional representation in terms of the canonical base dimensions.
        i    (   RÇ   R˜   R*   RH   R–   R   (   R   R   t   vecR0   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRÉ   Z  s    	&c         C   s   |  j  t |  j | ƒ ƒ S(   s¦   
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.


        Vector representation in terms of the base dimensions.
        (   RÍ   R   RÉ   (   R   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt
   dim_vectorh  s    	c         C   s   |  j  | ƒ } g  |  j D]' } | j d k	 r7 | j n | j ^ q } t j } x+ t | | ƒ D] \ } } | | | 9} q_ W| S(   sY   
        Give the string expression of a dimension in term of the basis symbols.
        N(   RÏ   R›   R   R   R   R   t   Onet   zip(   R   R   R½   RF   t   symbolst   rest   st   p(    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyRÁ   s  s    7	c         C   s   t  |  j ƒ S(   sÔ   
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Give the dimension of the system.

        That is return the number of dimensions forming the basis.
        (   R•   R›   (   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR   ~  s    c         C   s
   |  j  j S(   s“   
        Useless method, kept for compatibility with previous versions.

        DO NOT USE.

        Check if the system is well defined.
        (   RË   t	   is_square(   R   (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   is_consistent‹  s    N(   R[   R\   R]   R   R   Rd   R›   Rœ   R+   RS   R   RH   R²   Rº   t   staticmethodR»   RÀ   RÃ   RU   RÇ   RË   RÍ   RÉ   RÏ   RÁ   R   R×   (    (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyR'   ;  s*   F	"				
			R+   i   iþÿÿÿi   iýÿÿÿi   R·   i   (:   R]   t
   __future__R    R¥   t   sympyR   R   R   R   R   R   R   R   R	   t   sympy.core.compatibilityR
   R   t   sympy.core.basict   sympy.core.exprR   t   sympy.core.powerR   t   sympy.utilities.exceptionsR   R   Rh   Rj   Rl   Rn   Rp   Rq   Rr   Rs   Rt   Ru   Rv   Rx   Rz   R{   R|   R~   R€   R   Rƒ   R…   R‡   Rˆ   R‰   R‹   R   RŽ   R'   R-   t
   dimsys_MKSRº   t   dimsys_MKSAt	   dimsys_SIR*   (    (    (    s=   lib/python2.7/site-packages/sympy/physics/units/dimensions.pyt   <module>   sŠ   @öÿ a		!!!!!'