403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/sympy/stats/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/sympy/stats/__pycache__/random_matrix_models.cpython-310.pyc
o

�8Va�9�@s�ddlmZmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZddlmZmZmZmZddlmZddlmZddlmZgd�Ze�e�dd	��ZGd
d�de�Z Gdd
�d
e �Z!Gdd�de!�Z"Gdd�de!�Z#Gdd�de!�Z$dd�Z%dd�Z&dd�Z'dd�Z(Gdd�de �Z)Gdd�de)�Z*Gd d!�d!e)�Z+Gd"d#�d#e)�Z,d$d%�Z-d&d'�Z.d(d)�Z/d*d+�Z0d,d-�Z1d.d/�Z2d0d1�Z3d2S)3�)�Basic�exp�pi�Lambda�Trace�S�MatrixSymbol�Integral�gamma�Product�Dummy�Sum�Abs�IndexedBase�I)�_sympify)�_symbol_converter�Density�RandomMatrixSymbol�	is_random)�JointDistributionHandmade)�RandomMatrixPSpace)�ArrayComprehension)�CircularEnsemble�CircularUnitaryEnsemble�CircularOrthogonalEnsemble�CircularSymplecticEnsemble�GaussianEnsemble�GaussianUnitaryEnsemble�GaussianOrthogonalEnsemble�GaussianSymplecticEnsemble�joint_eigen_distribution�JointEigenDistribution�level_spacing_distributioncCsdS)NT�)�xr$r$�B/usr/lib/python3/dist-packages/sympy/stats/random_matrix_models.py�_sr'c@sBeZdZdZddd�Zedd��Zedd��Zdd	�Zd
d�Z	dS)
�RandomMatrixEnsembleModelz�
    Base class for random matrix ensembles.
    It acts as an umbrella and contains
    the methods common to all the ensembles
    defined in sympy.stats.random_matrix_models.
    NcCs6t|�t|�}}|jdkrtd|��t�|||�S)NFzGDimension of the random matrices must be integers, received %s instead.)rr�
is_integer�
ValueErrorr�__new__)�cls�sym�dimr$r$r&r+#s
�z!RandomMatrixEnsembleModel.__new__cC�
|jdS)Nr��args��selfr$r$r&�<lambda>*�
z"RandomMatrixEnsembleModel.<lambda>cCr/)N�r0r2r$r$r&r4+r5cCst|�S�N)r�r3�exprr$r$r&�density-sz!RandomMatrixEnsembleModel.densitycCs
|�|�Sr7)r:r8r$r$r&�__call__0s
z"RandomMatrixEnsembleModel.__call__r7)
�__name__�
__module__�__qualname__�__doc__r+�property�symbol�	dimensionr:r;r$r$r$r&r(s
r(c@� eZdZdZdd�Zdd�ZdS)�GaussianEnsembleModela
    Abstract class for Gaussian ensembles.
    Contains the properties common to all the
    gaussian ensembles.

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Random_matrix#Gaussian_ensembles
    .. [2] https://arxiv.org/pdf/1712.07903.pdf
    cs~t|�}�fdd�}tdddd�}t||�|d|f���}d�|�||dd|d}dt|d}|||S)	a
        Helper function for computing normalization
        constant for joint probability density of eigen
        values of Gaussian ensembles.

        References
        ==========

        .. [1] https://en.wikipedia.org/wiki/Selberg_integral#Mehta's_integral
        cs.td�t|�d�ttj�td��S)Nr6�)r
r�One)�j��betar$r&r4Ks.zGGaussianEnsembleModel._compute_normalization_constant.<locals>.<lambda>rGT��integer�positiver6rE�)rrr�doitr)r3rI�n�	prod_termrG�term1�term2�term3r$rHr&�_compute_normalization_constant?s(z5GaussianEnsembleModel._compute_normalization_constantcCs�|j}|�||�}td�}tdddd�}tdddd�}tdddd�}tt|�dt||d|d|f����}t|t	t
||||�|||d|f��}	t	|	|���|d|df���}
t|||d|f���}tt|�||
|�S)	z�
        Helper function for computing the joint
        probability distribution of eigen values
        of the random matrix.
        �l�iTrJrG�krEr6)
rBrTrrrrr
rNrrrr�tuple)r3rIrO�ZbnrUrVrGrWrQ�sub_termrR�symsr$r$r&�!_compute_joint_eigen_distributionRs.. z7GaussianEnsembleModel._compute_joint_eigen_distributionN)r<r=r>r?rTr\r$r$r$r&rD3srDc@�0eZdZedd��Zdd�Zdd�Zdd�Zd	S)
�GaussianUnitaryEnsembleModelcCs*|j}dt|�dtt|d�dS�NrE)rBrr)r3rOr$r$r&�normalization_constantes$z3GaussianUnitaryEnsembleModel.normalization_constantcCsV|j|j}}td|d�}td|||d�}t|tt|�dt|d��|�|�S�N�P��model�H��pspacerE�rBr`rrrrrr)r3r9rO�ZGUE�h_pspacerer$r$r&r:j�,z$GaussianUnitaryEnsembleModel.densitycC�|�td��Sr_�r\rr2r$r$r&r!p�z5GaussianUnitaryEnsembleModel.joint_eigen_distributioncCs:td�}dtd|dtdt|d�}t||�S)N�s� rE����rrrr�r3ro�fr$r$r&r#ss(
z7GaussianUnitaryEnsembleModel.level_spacing_distributionN�r<r=r>r@r`r:r!r#r$r$r$r&r^ds
r^c@r])
�GaussianOrthogonalEnsembleModelcCs4|j}td||�}ttt|�dt|d���S)N�_HrMrE�rBrr	rrr�r3rOrwr$r$r&r`ys"z6GaussianOrthogonalEnsembleModel.normalization_constantcCsV|j|j}}td|d�}td|||d�}t|tt|�dt|d��|�|�S)NrbrcrerfrMrErh)r3r9rO�ZGOErjrer$r$r&r:rkz'GaussianOrthogonalEnsembleModel.densitycC�|�tj�Sr7�r\rrFr2r$r$r&r!��z8GaussianOrthogonalEnsembleModel.joint_eigen_distributioncCs4td�}td|ttd|d�}t||�S)NrorErMrrrsr$r$r&r#�s"
z:GaussianOrthogonalEnsembleModel.level_spacing_distributionNrur$r$r$r&rvx�
rvc@r])
�GaussianSymplecticEnsembleModelcCs0|j}td||�}ttt|�t|d���S)NrwrErxryr$r$r&r`�sz6GaussianSymplecticEnsembleModel.normalization_constantcCsR|j|j}}td|d�}td|||d�}t|tt|�t|d��|�|�Srarh)r3r9rO�ZGSErjrer$r$r&r:�s(z'GaussianSymplecticEnsembleModel.densitycCrl�NrMrmr2r$r$r&r!�rnz8GaussianSymplecticEnsembleModel.joint_eigen_distributioncCsRtd�}td�dtd�dtd|dtddt|d�}t||�S)	NrorE���rMi�����	)rrrrrrsr$r$r&r#�s@
z:GaussianSymplecticEnsembleModel.level_spacing_distributionNrur$r$r$r&r�r~rcC�8t|�t|�}}t||�}t||d�}t||||d�S�Nrcrf)rrrDrr�r-r.rd�rmpr$r$r&r��
rcCr�)a-
    Represents Gaussian Unitary Ensembles.

    Examples
    ========

    >>> from sympy.stats import GaussianUnitaryEnsemble as GUE, density
    >>> from sympy import MatrixSymbol
    >>> G = GUE('U', 2)
    >>> X = MatrixSymbol('X', 2, 2)
    >>> density(G)(X)
    exp(-Trace(X**2))/(2*pi**2)
    rcrf)rrr^rrr�r$r$r&r��
rcCr�)aN
    Represents Gaussian Orthogonal Ensembles.

    Examples
    ========

    >>> from sympy.stats import GaussianOrthogonalEnsemble as GOE, density
    >>> from sympy import MatrixSymbol
    >>> G = GOE('U', 2)
    >>> X = MatrixSymbol('X', 2, 2)
    >>> density(G)(X)
    exp(-Trace(X**2)/2)/Integral(exp(-Trace(_H**2)/2), _H)
    rcrf)rrrvrrr�r$r$r&r�r�rcCr�)aN
    Represents Gaussian Symplectic Ensembles.

    Examples
    ========

    >>> from sympy.stats import GaussianSymplecticEnsemble as GSE, density
    >>> from sympy import MatrixSymbol
    >>> G = GSE('U', 2)
    >>> X = MatrixSymbol('X', 2, 2)
    >>> density(G)(X)
    exp(-2*Trace(X**2))/Integral(exp(-2*Trace(_H**2)), _H)
    rcrf)rrrrrr�r$r$r&r �r�r c@rC)�CircularEnsembleModelz�
    Abstract class for Circular ensembles.
    Contains the properties and methods
    common to all the circular ensembles.

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Circular_ensemble
    cCstd|��)NzeSupport for Haar measure hasn't been implemented yet, therefore the density of %s cannot be computed.)�NotImplementedErrorr8r$r$r&r:�s�zCircularEnsembleModel.densityc
Cs�|j}dt|t||dd�tt|dd��|}td�}tddd�tddd�tddd�}}}t|||d|f���}ttt	t
t||�t
t||��|||d|f���|d|df���}	tt
|�|	|�S)	z�
        Helper function to compute the joint distribution of phases
        of the complex eigen values of matrices belonging to any
        circular ensembles.
        rEr6�trVT)rKrGrW)rBrr
rrrrrNrrrrrrX)
r3rIrOrYr�rVrGrWr[rtr$r$r&r\�s8

�<��z7CircularEnsembleModel._compute_joint_eigen_distributionN)r<r=r>r?r:r\r$r$r$r&r��s
r�c@�eZdZdd�ZdS)�CircularUnitaryEnsembleModelcCrlr_rmr2r$r$r&r!rnz5CircularUnitaryEnsembleModel.joint_eigen_distributionN�r<r=r>r!r$r$r$r&r��r�c@r�)�CircularOrthogonalEnsembleModelcCr{r7r|r2r$r$r&r!r}z8CircularOrthogonalEnsembleModel.joint_eigen_distributionNr�r$r$r$r&r�r�r�c@r�)�CircularSymplecticEnsembleModelcCrlr�rmr2r$r$r&r!rnz8CircularSymplecticEnsembleModel.joint_eigen_distributionNr�r$r$r$r&r�r�r�cCr�r�)rrr�rrr�r$r$r&rr�rcCr�)a7
    Represents Cicular Unitary Ensembles.

    Examples
    ========

    >>> from sympy.stats import CircularUnitaryEnsemble as CUE
    >>> from sympy.stats import joint_eigen_distribution
    >>> C = CUE('U', 1)
    >>> joint_eigen_distribution(C)
    Lambda(t[1], Product(Abs(exp(I*t[_j]) - exp(I*t[_k]))**2, (_j, _k + 1, 1), (_k, 1, 0))/(2*pi))

    Note
    ====

    As can be seen above in the example, density of CiruclarUnitaryEnsemble
    is not evaluated becuase the exact definition is based on haar measure of
    unitary group which is not unique.
    rcrf)rrr�rrr�r$r$r&r�
rcCr�)a=
    Represents Cicular Orthogonal Ensembles.

    Examples
    ========

    >>> from sympy.stats import CircularOrthogonalEnsemble as COE
    >>> from sympy.stats import joint_eigen_distribution
    >>> C = COE('O', 1)
    >>> joint_eigen_distribution(C)
    Lambda(t[1], Product(Abs(exp(I*t[_j]) - exp(I*t[_k])), (_j, _k + 1, 1), (_k, 1, 0))/(2*pi))

    Note
    ====

    As can be seen above in the example, density of CiruclarOrthogonalEnsemble
    is not evaluated becuase the exact definition is based on haar measure of
    unitary group which is not unique.
    rcrf)rrr�rrr�r$r$r&r.r�rcCr�)a@
    Represents Cicular Symplectic Ensembles.

    Examples
    ========

    >>> from sympy.stats import CircularSymplecticEnsemble as CSE
    >>> from sympy.stats import joint_eigen_distribution
    >>> C = CSE('S', 1)
    >>> joint_eigen_distribution(C)
    Lambda(t[1], Product(Abs(exp(I*t[_j]) - exp(I*t[_k]))**4, (_j, _k + 1, 1), (_k, 1, 0))/(2*pi))

    Note
    ====

    As can be seen above in the example, density of CiruclarSymplecticEnsemble
    is not evaluated becuase the exact definition is based on haar measure of
    unitary group which is not unique.
    rcrf)rrr�rrr�r$r$r&rGr�rcCs"t|t�std|��|jj��S)aA
    For obtaining joint probability distribution
    of eigen values of random matrix.

    Parameters
    ==========

    mat: RandomMatrixSymbol
        The matrix symbol whose eigen values are to be considered.

    Returns
    =======

    Lambda

    Examples
    ========

    >>> from sympy.stats import GaussianUnitaryEnsemble as GUE
    >>> from sympy.stats import joint_eigen_distribution
    >>> U = GUE('U', 2)
    >>> joint_eigen_distribution(U)
    Lambda((l[1], l[2]), exp(-l[1]**2 - l[2]**2)*Product(Abs(l[_i] - l[_j])**2, (_j, _i + 1, 2), (_i, 1, 1))/pi)
    z&%s is not of type, RandomMatrixSymbol.)�
isinstancerr*rgrdr!��matr$r$r&r!`s
r!cCs2|jdd�}tdd�t|�D��rtd��t|�S)a�
    Creates joint distribution of eigen values of matrices with random
    expressions.

    Parameters
    ==========

    mat: Matrix
        The matrix under consideration.

    Returns
    =======

    JointDistributionHandmade

    Examples
    ========

    >>> from sympy.stats import Normal, JointEigenDistribution
    >>> from sympy import Matrix
    >>> A = [[Normal('A00', 0, 1), Normal('A01', 0, 1)],
    ... [Normal('A10', 0, 1), Normal('A11', 0, 1)]]
    >>> JointEigenDistribution(Matrix(A))
    JointDistributionHandmade(-sqrt(A00**2 - 2*A00*A11 + 4*A01*A10 + A11**2)/2
    + A00/2 + A11/2, sqrt(A00**2 - 2*A00*A11 + 4*A01*A10 + A11**2)/2 + A00/2 + A11/2)

    T)�multiplecss�|]}t|�VqdSr7)r)�.0�eigenvalr$r$r&�	<genexpr>�s�z)JointEigenDistribution.<locals>.<genexpr>zVEigen values don't have any random expression, joint distribution cannot be generated.)�	eigenvals�any�setr*r)r�r�r$r$r&r"}sr"cCs|jj��S)a�
    For obtaining distribution of level spacings.

    Parameters
    ==========

    mat: RandomMatrixSymbol
        The random matrix symbol whose eigen values are
        to be considered for finding the level spacings.

    Returns
    =======

    Lambda

    Examples
    ========

    >>> from sympy.stats import GaussianUnitaryEnsemble as GUE
    >>> from sympy.stats import level_spacing_distribution
    >>> U = GUE('U', 2)
    >>> level_spacing_distribution(U)
    Lambda(_s, 32*_s**2*exp(-4*_s**2/pi)/pi**2)

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Random_matrix#Distribution_of_level_spacings
    )rgrdr#r�r$r$r&r#�sr#N)4�sympyrrrrrrrr	r
rrr
rrr�sympy.core.sympifyr�sympy.stats.rvrrrr�sympy.stats.joint_rv_typesr�sympy.stats.random_matrixr�sympy.tensor.arrayr�__all__�registerr'r(rDr^rvrrrrr r�r�r�r�rrrrr!r"r#r$r$r$r&�<module>s:D
1""

Youez - 2016 - github.com/yon3zu
LinuXploit