ó
¡¼™\c           @   sÎ   d  d l  m Z m Z m Z m Z m Z d  d l m Z m Z m	 Z	 m
 Z
 m Z m Z d  d l m Z d  d l m Z e d ƒ Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d S(   iÿÿÿÿ(   t   labellert   render_labelt   Mzt   CreateOneQubitGatet   CreateCGate(   t   CNOTt   Ht   SWAPt   CGatet   St   T(   t   import_module(   t   skipt
   matplotlibc           C   s>   t  d ƒ d k s t ‚ t  d i d d 6ƒ d k s: t ‚ d  S(   Nt   q0s   $\left|q0\right\rangle$t   0s,   $\left|q0\right\rangle=\left|0\right\rangle$(   R   t   AssertionError(    (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_render_label	   s    c           C   s"   t  t d ƒ ƒ d k s t ‚ d  S(   Ni    s   Mz(0)(   t   strR   R   (    (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_Mz   s    c          C   s.   t  d ƒ }  t |  d ƒ ƒ d k s* t ‚ d  S(   Nt   Qi    s   Q(0)(   R   R   R   (   t   Qgate(    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_create1   s    c          C   s4   t  d ƒ }  t |  d g d ƒ ƒ d k s0 t ‚ d  S(   NR   i   i    s   C((1),Q(0))(   R   R   R   (   R   (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_createc   s    c           C   sF   t  d ƒ d d g k s t ‚ t  d d ƒ d d d g k sB t ‚ d	 S(
   s   Test the labeller utilityi   t   q_1t   q_0i   t   jt   j_2t   j_1t   j_0N(   R    R   (    (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_labeller   s    c          C   sç   t  s t d ƒ n d d l m }  |  t d d ƒ d d t d ƒ ƒ} | j d k s\ t ‚ | j d k sq t ‚ | j	 d d	 g k sŒ t ‚ |  t d d ƒ d ƒ } | j d k s¹ t ‚ | j d k sÎ t ‚ | j	 g  k sã t ‚ d
 S(   sƒ   Test a simple cnot circuit. Right now this only makes sure the code doesn't
    raise an exception, and some simple properties
    s   matplotlib not installediÿÿÿÿ(   t   CircuitPloti   i    i   t   labelsR   R   N(
   t   mplR   t!   sympy.physics.quantum.circuitplotR   R   R    t   ngatesR   t   nqubitsR    (   R   t   c(    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt	   test_cnot   s    $c          C   sš   t  s t d ƒ n d d l m }  |  t d d ƒ t d ƒ d d t d ƒ ƒ} | j d k sf t ‚ | j	 d k s{ t ‚ | j
 d d	 g k s– t ‚ d  S(
   Ns   matplotlib not installediÿÿÿÿ(   R   i   i    i   R    R   R   (   R!   R   R"   R   R   R   R    R#   R   R$   R    (   R   R%   (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_ex10   s    .c          C   sí   t  s t d ƒ n d d l m }  |  t d d ƒ t d ƒ t d t d ƒ ƒ t d ƒ t d t d ƒ ƒ t d t d ƒ ƒ t d ƒ d d t	 d d	 ƒ ƒ} | j
 d
 k s¶ t ‚ | j d k sË t ‚ | j d d d g k sé t ‚ d  S(   Ns   matplotlib not installediÿÿÿÿ(   R   i    i   i   i   R    R   i   R   R   R   (   i    (   i    (   i   (   R!   R   R"   R   R   R   R   R	   R
   R    R#   R   R$   R    (   R   R%   (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   test_ex4;   s    {N(   R"   R    R   R   R   R   t   sympy.physics.quantum.gateR   R   R   R   R	   R
   t   sympy.externalR   t   sympy.utilities.pytestR   R!   R   R   R   R   R   R&   R'   R(   (    (    (    sK   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_circuitplot.pyt   <module>   s   (.							