ó
Ħĵ\c           @   s×   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
 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 d  d l m Z d   Z d	   Z d
   Z d S(   i˙˙˙˙(   t   expt   It   Matrixt   pit   sqrtt   Symbol(   t   range(   t   QFTt   IQFTt   RkGate(   t   ZGatet   SwapGatet   HadamardGatet   CGatet	   PhaseGatet   TGate(   t   Qubit(   t   qapply(   t	   representc          C   s  t  d  }  t d |   j |  k s* t  t d |   j d k sH t  t d d  t d  k si t  t d d  t d  k s t  t d d  t d  k sĞ t  t t d |   d d t	 d d g d t
 d t t d |   g g  k s t  d  S(   Nt   xi   i   i   i    t   nqubits(   i   (   R   R	   t   kt   AssertionErrort   targetsR
   R   R   R   R   R    R   R   (   R   (    (    sC   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_qft.pyt   test_RkGate   s    !!!c       	   C   s$  t  d d  j   t d d  t d  t d
 t d   t d  t d t d   t d t d   t d  k s t  t d d  j   t d  t d t	 d d   t d t	 d d   t d  t d t	 d d   t d  t d d  k st  t
 t  d d  d d t g  t d  D]M }  g  t d  D]4 } t d t t d  | |  d t d  ^ qF^ q3 k st  t  d d	  j   s­t  t t  d d  j   t d d d   j   t t d  t d  t d  t d d d   j   k s t  d  S(   Ni    i   i   i   iŝ˙˙˙iŭ˙˙˙R   i   i   (   i    (   i    (   i   (   i   (   i    (   i    (   R   t	   decomposeR   R   R   R   R   R   R   R	   R   R   R   R    R   R   R   R   R   t   expand(   t   jt   i(    (    sC   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_qft.pyt   test_quantum_fourier   s    Yxo1c          C   sg   t  d d  }  t |  d d } t |  j   d d } | j d d  | j d d  k sc t  d  S(   Ni    i   R   t   preci
   (   R   R   R   t   evalfR   (   t   ct   at   b(    (    sC   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_qft.pyt   test_qft_represent+   s    N(   t   sympyR    R   R   R   R   R   t   sympy.core.compatibilityR   t   sympy.physics.quantum.qftR   R   R	   t   sympy.physics.quantum.gateR
   R   R   R   R   R   t   sympy.physics.quantum.qubitR   t   sympy.physics.quantum.qapplyR   t   sympy.physics.quantum.representR   R   R   R#   (    (    (    sC   lib/python2.7/site-packages/sympy/physics/quantum/tests/test_qft.pyt   <module>   s   ..		