U
    	-e0                     @   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d Zdd	 Zd
d Zdd Zdd Zdd Zdd Zdd ZdS )    )labellerrender_labelMzCreateOneQubitGateCreateCGate)CNOTHSWAPCGateST)import_module)skipZ
matplotlibc                   C   s*   t ddkstt dddidks&td S )Nq0z$\left|q0\right\rangle$0z,$\left|q0\right\rangle=\left|0\right\rangle$)r   AssertionError r   r   m/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/sympy/physics/quantum/tests/test_circuitplot.pytest_render_label	   s    r   c                   C   s   t tddkstd S )Nr   zMz(0))strr   r   r   r   r   r   test_Mz   s    r   c                  C   s    t d} t| ddkstd S )NQr   zQ(0))r   r   r   ZQgater   r   r   test_create1   s    r   c                  C   s$   t d} t| dgddks td S )Nr      r   zC((1),Q(0)))r   r   r   r   r   r   r   test_createc   s    r   c                   C   s0   t dddgkstt dddddgks,td	S )
zTest the labeller utility   q_1q_0   jj_2j_1j_0N)r   r   r   r   r   r   test_labeller   s    r$   c                  C   s   t std nddlm}  | tdddtdd}|jdks@t|jdksNt|j	ddgks`t| tddd}|jdks~t|jdkst|j	g kstd	S )
zTest a simple cnot circuit. Right now this only makes sure the code doesn't
    raise an exception, and some simple properties
    matplotlib not installedr   CircuitPlotr   r   labelsr   r   N)
mplr   !sympy.physics.quantum.circuitplotr'   r   r   ngatesr   nqubitsr)   r'   cr   r   r   	test_cnot   s    
r0   c                  C   sl   t std nddlm}  | tddtd dtdd}|jdksHt|j	dksVt|j
ddgkshtd S )	Nr%   r   r&   r   r   r(   r   r   )r*   r   r+   r'   r   r   r   r,   r   r-   r)   r.   r   r   r   test_ex10   s    
 r1   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t	dd	d
}|j
dkst|jdkst|jdddgkstd S )Nr%   r   r&   r   )r   r   )r   r   r    r(      r!   r"   r#   )r*   r   r+   r'   r	   r   r
   r   r   r   r,   r   r-   r)   r.   r   r   r   test_ex4;   s    
6 r3   N)r+   r   r   r   r   r   Zsympy.physics.quantum.gater   r   r	   r
   r   r   Zsympy.externalr   Zsympy.testing.pytestr   r*   r   r   r   r   r$   r0   r1   r3   r   r   r   r   <module>   s    