a
    kh0                     @   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J t dddidks&J d S )NZq0z$\left|q0\right\rangle$0z,$\left|q0\right\rangle=\left|0\right\rangle$)r    r   r   Z/var/www/auris/lib/python3.9/site-packages/sympy/physics/quantum/tests/test_circuitplot.pytest_render_label	   s    r   c                   C   s   t tddksJ d S )Nr   zMz(0))strr   r   r   r   r   test_Mz   s    r   c                  C   s    t d} t| ddksJ d S )NQr   zQ(0))r   r   ZQgater   r   r   test_create1   s    r   c                  C   s$   t d} t| dgddks J d S )Nr      r   zC((1),Q(0)))r   r   r   r   r   r   test_createc   s    r   c                   C   s.   t dddgksJ t ddg dks*J dS )zTest the labeller utility   q_1q_0   jZj_2Zj_1Zj_0N)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@J |jdksNJ |jddgks`J | tddd}|jdks~J |jdksJ |jg ksJ 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   ngatesnqubitsr%   r#   cr   r   r   	test_cnot   s    
r,   c                  C   sl   t std nddlm}  | tddtd dtdd}|jdksHJ |jdksVJ |j	ddgkshJ d S )	Nr!   r   r"   r   r   r$   r   r   )
r&   r   r'   r#   r   r   r   r(   r)   r%   r*   r   r   r   test_ex10   s    
 r-   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sJ |jdksJ |jg dksJ 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   test_ex4;   s    
6
r/   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    r,   r-   r/   r   r   r   r   <module>   s    