U
    	-e                     @   s   d dl mZ d dl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mZ d dlmZ d d	lmZ d d
lmZmZ dd Zdd Zdd ZG dd deZdd ZedZdd ZedddgidZdd ZdS )    )Expr)Mul)IInteger)symbols)	conjugate)Matrix)adjointDagger)import_module)skip)OperatorIdentityOperatorc                  C   s   t ddd} t| t| ks ttt|  t t|  ks>tt ddd}t||ksZtt d}tt|tstttd}t||kstt dd	d
}t|jd	kstd S )NxT)complexi)realp   AF)Zcommutative)	r   r
   r   AssertionErrorr   
isinstancer	   r   Zis_commutative)r   r   r   r    r   h/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/sympy/physics/quantum/tests/test_dagger.pytest_scalars   s    r   c                  C   s6   t d} tt| t gddgg}t||jks2td S )Nr         )r   r   r   r
   Hr   )r   mr   r   r   test_matrix    s    r   c                  C   s   t d} t }t| |  t| |  ks*tt| |  | tt| | | ksPtt| t|  t| d ksptt| t| t| kstd S )NOr   )r   r   r
   r   r   )r    r   r   r   r   test_dagger_mul&   s    & r!   c                   @   s   e Zd Zdd ZdS )Fooc                 C   s   t S N)r   )selfr   r   r   _eval_adjoint1   s    zFoo._eval_adjointN)__name__
__module____qualname__r%   r   r   r   r   r"   /   s   r"   c                  C   s   t  } t| }|tkstd S r#   )r"   r
   r   r   )fdr   r   r   test_eval_adjoint5   s    r+   numpyc                  C   sJ   t std t ddgddgg} |    }t| |k sFtd S )Nnumpy not installed.g      ?               @             g       @)	npr   arraycopy	transposer   r
   allr   )aadagr   r   r   test_numpy_dagger=   s
    r7   scipyfromlistsparse)Zimport_kwargsc                  C   sj   t std tstd ntj} | ddgddgg}|   }t j	t
||  dksftd S )Nr-   zscipy not installed.y      ?        r.   r/   y       @        g        )r0   r   r8   r:   Z
csr_matrixr2   r3   r   ZlinalgZnormr
   Ztodenser   )r:   r5   r6   r   r   r   test_scipy_sparse_daggerI   s    
r;   N) Zsympy.core.exprr   Zsympy.core.mulr   Zsympy.core.numbersr   r   Zsympy.core.symbolr   Z$sympy.functions.elementary.complexesr   Zsympy.matrices.denser   Zsympy.physics.quantum.daggerr	   r
   Zsympy.externalr   Zsympy.testing.pytestr   Zsympy.physics.quantum.operatorr   r   r   r   r!   r"   r+   r0   r7   r8   r;   r   r   r   r   <module>   s$   		