U
    	-e                     @   s\  d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZmZm Z!m"Z#m$Z$m%Z&m'Z(m)Z*m+Z+m,Z,m-Z-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4m5Z5 d dl6m7Z7 dd Z8dd Z9dd Z:dd Z;dd Z<dd Z=dd  Z>d!d" Z?d#d$ Z@d%S )&    )Product)Lambda)IRationalpi)S)Dummy)Abs)exp)sqrt)Integral)Matrix)MatrixSymbol)Trace)IndexedBase)GaussianUnitaryEnsembledensityGaussianOrthogonalEnsembleGaussianSymplecticEnsemblejoint_eigen_distributionCircularUnitaryEnsembleCircularOrthogonalEnsembleCircularSymplecticEnsembleJointEigenDistributionlevel_spacing_distributionNormalBeta)JointDistributionHandmade)RandomMatrixSymbol)GaussianEnsembleRandomMatrixPSpace)raisesc                  C   s0   t dd} t| | jjkstttdd  d S )NG   c                   S   s
   t ddS )Nr"   g      @)r    r$   r$   e/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/sympy/stats/tests/test_random_matrix.py<lambda>        z'test_GaussianEnsemble.<locals>.<lambda>)r   r   pspacemodelAssertionErrorr!   
ValueError)r"   r$   r$   r%   test_GaussianEnsemble   s    
r,   c                  C   s~  t ddd} tdd}t|| tdtdt| d  d  dttdd   ksXtt	dd	d	d
t	dd	d	d
 }}t
d}t|t|d |d |d fdtd td|d d  d d|d d  d  d|d d  d   tt|| ||  d ||d df|ddf dttdd   s4tt	d}t|t|d|d  td|d  t  td  sztd S )NHr#   U      	   iTintegerZpositivejl            s    )r   GUEr   r   r
   r   r   r   r*   r   r   r   dummy_eqr   r   r	   r   )r-   r"   r3   r6   r7   r<   r$   r$   r%   test_GaussianUnitaryEnsemble"   s$    
BJ.
rA   c                  C   sz  t ddd} tddd}tdd}t|| tdt| d  d ttdt|d  d | kshttdd	d	d
tdd	d	d
 }}t	d}t
|t|d |d |d fdtd td|d d  d d|d d  d  d|d d  d   tt|| ||  ||d df|ddf dt  s6ttd}t|t||t t|d  t d  d svtd S )Nr-   r#   _HOr0   r/   r1   r3   Tr4   r6   r7   r8   r2   r=   r<   )r   r   GOEr   r
   r   r   r*   r   r   r   r@   r   r   r   r	   r   r   r-   rB   r"   r3   r6   r7   r<   r$   r$   r%   test_GaussianOrthogonalEnsemble1   s&    
FJ*
rF   c                  C   s  t ddd} tddd}tdd}t|| tdt| d  ttdt|d  | ks`ttdddd	td
ddd	 }}t	d}t
|t|d |d |d fdtd td|d d  d d|d d  d  d|d d  d   tt|| ||  d ||d df|ddf dttdd   s<ttd}t|t|td|d  td|d  dt   dtd   std S )Nr-   r#   rB   rC   r0   r/   r3   Tr4   r6   r7   r8      r1      r<   i   ir2   i  )r   r   GSEr   r
   r   r   r*   r   r   r   r@   r   r   r   r	   r   r   r   r   rE   r$   r$   r%   test_GaussianSymplecticEnsemble@   s&    
>J.
rJ   c                  C   s   t dd} tddddtdddd }}td}t| t|d |d	 |d ftttt	||  tt	||   d	 ||d df|dd	fd
t
d   std S Nr.   r#   r6   Tr4   ktr8   r/   0   )CUEr   r   r   r@   r   r   r	   r
   r   r   r*   )ZCUr6   rL   rM   r$   r$   r%   test_CircularUnitaryEnsembleO   s    
( 
rP   c                  C   s   t dd} tddddtdddd }}td}t| t|d |d	 |d ftttt	||  tt	||   ||d df|dd	fd
t
d	   std S rK   )COEr   r   r   r@   r   r   r	   r
   r   r   r*   )ZCOr6   rL   rM   r$   r$   r%   test_CircularOrthogonalEnsembleZ   s    
$ 
rR   c                  C   s   t dd} tddddtdddd }}td}t| t|d |d	 |d ftttt	||  tt	||   d
 ||d df|dd	fdt
d   std S )Nr.   r#   r6   Tr4   rL   rM   r8   r/   r1   i  )CSEr   r   r   r@   r   r   r	   r
   r   r   r*   )CSr6   rL   rM   r$   r$   r%   test_CircularSymplecticEnsemblee   s    
( 
rU   c                  C   s  t tdddtdddgtdddtdddgg} t| tt| d d d| d  | d	   d
| d  | d   | d	 d   d | d d  | d	 d  t| d d d| d  | d	   d
| d  | d   | d	 d  d | d d  | d	 d  kstttdd  d S )NZA00r   r8   ZA01ZA10ZA11)r   r   r/   )r8   r8   r1   )r   r8   )r8   r   c                   S   s   t tddgddggS )Nr8   r   r/   )r   r   r$   r$   r$   r%   r&   v   r'   z-test_JointEigenDistribution.<locals>.<lambda>)	r   r   r   r   r   r   r*   r!   r+   )Ar$   r$   r%   test_JointEigenDistributionp   s    J

^
rW   c                  C   s   t dd} | ddi}| j|jks(ttddd}tdd}tdt|d}tddd|d}tdddd d}|	 |ks~td| ||id| kstd| ||id| kstd| ||id| kstd| ||id| kstd S )Nr.   r/   XP)r)   r-   )r(   )
r?   Zxreplaceargsr*   r   rI   r    r   r   Zdoit)ZG1ZG2rX   r"   Zh_pspacer-   ZH2r$   r$   r%   test_issue_19841x   s    

r[   N)AZsympy.concrete.productsr   Zsympy.core.functionr   Zsympy.core.numbersr   r   r   Zsympy.core.singletonr   Zsympy.core.symbolr   Z$sympy.functions.elementary.complexesr	   Z&sympy.functions.elementary.exponentialr
   Z(sympy.functions.elementary.miscellaneousr   Zsympy.integrals.integralsr   Zsympy.matrices.denser   Z"sympy.matrices.expressions.matexprr   Z sympy.matrices.expressions.tracer   Zsympy.tensor.indexedr   Zsympy.statsr   r?   r   r   rD   r   rI   r   r   rO   r   rQ   r   rS   r   r   r   r   Zsympy.stats.joint_rv_typesr   Zsympy.stats.rvr   Z sympy.stats.random_matrix_modelsr   r    Zsympy.testing.pytestr!   r,   rA   rF   rJ   rP   rR   rU   rW   r[   r$   r$   r$   r%   <module>   s4   8
