§
    &�’jó ã            
       óT  — d Z ddlZddlZddlmZmZ ddlmZm	Z	 ddl
mZmZmZmZ ddlmZmZmZ ddlmZmZ dd	lmZ d
Zg d¢ZdddddœZdddddœZi dd“dd“dd“dd“dd“dd“dd“dd “d!d"“d#d$“d%d&“d'd(“d)d*“d+d,“d-d.“d/d0“d1d2“d3d4i¥ZeZe                     ¦   «         Zd5ed+<   eZ i dd“dd6“dd“dd“dd“dd“dd7“dd “d!d8“d#d$“d%d&“d'd9“d)d*“d+d:“d-d.“d/d0“d1d;“d3d4i¥Z!e!Z"i dd“dd<“dd“dd“dd“d!d=“d#d$“d%d>“d'd?“d)d@“d+d,“d-d.“d/dA“d1dB“dCdD“dEdF“Z#e#                     ¦   «         Z$dGe$d<   dHe$dC<   dIe$dE<   i dd“ddJ“dd“dd“ddK“d!d=“d#d$“d%d>“d'dL“d)dM“d+dN“d-d.“d/dA“d1dB“dCdO“dEdP“Z%e%                     ¦   «         Z&dQe&dC<   dRe&dE<   i dd“dd“dd“dd7“d!d8“d#d$“d%d>“d'dS“d)d*“d+d:“d-d.“d/d2“dCdT“dEdU“dVdA“dWdX“Z'e'                     ¦   «         Z(dYe(dC<   dZe(dW<   e!e"d[œZ)eeee d\œZ*e'e(d[œZ+e#e$e%e&d\œZ,g d]¢Z-g d^¢Z.ddddd_dd`dadbdcœ	Z/dddddœZ0 G de„ dfe1¦  «        Z2 G dg„ dhe2¦  «        Z3di„ Z4 G dj„ dk¦  «        Z5 G dl„ dme5¦  «        Z6 G dn„ doe5¦  «        Z7 G dp„ dqe¦  «        Z8 G dr„ dse¦  «        Z9dt„ Z: G du„ dve¦  «        Z; G dw„ dxe¦  «        Z<d‚dz„Z=dƒd{„Z>dƒd|„Z?	 	 	 d„d„Z@	 	 	 d…d�„ZAdS )†zn
Find a few eigenvectors and eigenvalues of a matrix.


Uses ARPACK: https://github.com/opencollab/arpack-ng

é    N)ÚaslinearoperatorÚLinearOperator)ÚeyeÚissparse)ÚeigÚeighÚ	lu_factorÚlu_solve)Úconvert_pydata_sparse_to_scipyÚisdenseÚis_pydata_spmatrix)ÚgmresÚsplué   )Ú
_arpacklibzrestructuredtext en)ÚeigsÚeigshÚArpackErrorÚArpackNoConvergenceÚsÚdÚcÚz)Úfr   ÚFÚDé   é   zNormal exit.z�Maximum number of iterations taken. All possible eigenvalues of OP has been found. IPARAM(5) returns the number of wanted converged Ritz values.é   zONo longer an informational error. Deprecated starting with release 2 of ARPACK.é   z™No shifts could be applied during a cycle of the Implicitly restarted Arnoldi iteration. One possibility is to increase the size of NCV relative to NEV. éÿÿÿÿzN must be positive.éþÿÿÿzNEV must be positive.éýÿÿÿz)NCV-NEV >= 2 and less than or equal to N.éüÿÿÿzRThe maximum number of Arnoldi update iterations allowed must be greater than zero.éûÿÿÿz8 WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'iúÿÿÿzBMAT must be one of 'I' or 'G'.iùÿÿÿz5Length of private work array WORKL is not sufficient.iøÿÿÿz0Error return from LAPACK eigenvalue calculation;i÷ÿÿÿzStarting vector is zero.iöÿÿÿzIPARAM(7) must be 1,2,3,4.iõÿÿÿz.IPARAM(7) = 1 and BMAT = 'G' are incompatible.iôÿÿÿz"IPARAM(1) must be equal to 0 or 1.ióÿÿÿz&NEV and WHICH = 'BE' are incompatible.iñØÿÿzÃCould not build an Arnoldi factorization. IPARAM(5) returns the size of the current Arnoldi factorization. The user is advised to check that enough workspace and array storage has been allocated.zIPARAM(7) must be 1,2,3.zRMaximum number of iterations taken. All possible eigenvalues of OP has been found.z9NCV must be greater than NEV and less than or equal to N.z4WHICH must be one of 'LM', 'SM', 'LA', 'SA' or 'BE'.z`Error return from trid. eigenvalue calculation; Informational error from LAPACK routine dsteqr .zIPARAM(7) must be 1,2,3,4,5.z'NEV and WHICH = 'BE' are incompatible. as  The Schur form computed by LAPACK routine dlahqr could not be reordered by LAPACK routine dtrsen. Re-enter subroutine dneupd  with IPARAM(5)NCV and increase the size of the arrays DR and DI to have dimension at least dimension NCV and allocate at least NCV columns for Z. NOTE: Not necessary if Z and V share the same space. Please notify the authors if this erroroccurs.z7WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'z5Length of private work WORKL array is not sufficient.zdError return from calculation of a real Schur form. Informational error from LAPACK routine dlahqr .z^Error return from calculation of eigenvectors. Informational error from LAPACK routine dtrevc.z HOWMNY = 'S' not yet implementedz1HOWMNY must be one of 'A' or 'P' if RVEC = .true.iòÿÿÿz<DNAUPD  did not find any eigenvalues to sufficient accuracy.iñÿÿÿzßDNEUPD got a different count of the number of converged Ritz values than DNAUPD got.  This indicates the user probably made an error in passing data from DNAUPD to DNEUPD or that the data was modified before entering DNEUPDav  The Schur form computed by LAPACK routine slahqr could not be reordered by LAPACK routine strsen . Re-enter subroutine dneupd  with IPARAM(5)=NCV and increase the size of the arrays DR and DI to have dimension at least dimension NCV and allocate at least NCV columns for Z. NOTE: Not necessary if Z and V share the same space. Please notify the authors if this error occurs.z;SNAUPD did not find any eigenvalues to sufficient accuracy.zßSNEUPD got a different count of the number of converged Ritz values than SNAUPD got.  This indicates the user probably made an error in passing data from SNAUPD to SNEUPD or that the data was modified before entering SNEUPDak  The Schur form computed by LAPACK routine csheqr could not be reordered by LAPACK routine ztrsen. Re-enter subroutine zneupd with IPARAM(5)=NCV and increase the size of the array D to have dimension at least dimension NCV and allocate at least NCV columns for Z. NOTE: Not necessary if Z and V share the same space. Please notify the authors if this error occurs.z)NCV-NEV >= 1 and less than or equal to N.zLError return from LAPACK eigenvalue calculation. This should never happened.z^Error return from calculation of eigenvectors. Informational error from LAPACK routine ztrevc.zIPARAM(7) must be 1,2,3z;ZNAUPD did not find any eigenvalues to sufficient accuracy.zßZNEUPD got a different count of the number of converged Ritz values than ZNAUPD got.  This indicates the user probably made an error in passing data from ZNAUPD to ZNEUPD or that the data was modified before entering ZNEUPDz;CNAUPD did not find any eigenvalues to sufficient accuracy.zßCNEUPD got a different count of the number of converged Ritz values than CNAUPD got.  This indicates the user probably made an error in passing data from CNAUPD to CNEUPD or that the data was modified before entering CNEUPDz]Error return from trid. eigenvalue calculation; Information error from LAPACK routine dsteqr.z<DSAUPD  did not find any eigenvalues to sufficient accuracy.z1HOWMNY must be one of 'A' or 'S' if RVEC = .true.iðÿÿÿiïÿÿÿzåDSEUPD  got a different count of the number of converged Ritz values than DSAUPD  got.  This indicates the user probably made an error in passing data from DSAUPD  to DSEUPD  or that the data was modified before entering  DSEUPD.z<SSAUPD  did not find any eigenvalues to sufficient accuracy.zåSSEUPD  got a different count of the number of converged Ritz values than SSAUPD  got.  This indicates the user probably made an error in passing data from SSAUPD  to SSEUPD  or that the data was modified before entering  SSEUPD.)r   r   )r   r   r   r   )ÚLMÚSMÚLAÚSAÚBE)r&   r'   ÚLRÚSRÚLIÚSIé   é   é   é   )	r&   r'   r+   r,   r-   r.   r(   r)   r*   )ÚAÚPÚSc                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   z
    ARPACK error
    Nc                 ó”   •— |€t           }|                     |d¦  «        }t          ¦   «                              d|› d|› �¦  «         d S )NzUnknown errorzARPACK error z: )Ú_NAUPD_ERRORSÚgetÚsuperÚ__init__)ÚselfÚinfoÚinfodictÚmsgÚ	__class__s       €úVC:\Projects\DSCons\.venv\Lib\site-packages\scipy\sparse\linalg\_eigen\arpack\arpack.pyr;   zArpackError.__init__  sP   ø€ ØÐÝ$ˆHà�lŠl˜4 Ñ1Ô1ˆÝ‰Œ×ÒÐ6¨Ð6Ð6°Ð6Ð6Ñ7Ô7Ð7Ð7Ð7ó    ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r;   Ú__classcell__)r@   s   @rA   r   r     sG   ø€ € € € € ðð ð8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8rB   r   c                   ó   — e Zd ZdZd„ ZdS )r   zß
    ARPACK iteration did not converge

    Attributes
    ----------
    eigenvalues : ndarray
        Partial result. Converged eigenvalues.
    eigenvectors : ndarray
        Partial result. Converged eigenvectors.

    c                 ó^   — t                                | dd|i¦  «         || _        || _        d S )Nr!   )r   r;   ÚeigenvaluesÚeigenvectors)r<   r?   rK   rL   s       rA   r;   zArpackNoConvergence.__init__2  s4   € Ý×Ò˜T 2¨¨C yÑ1Ô1Ð1Ø&ˆÔØ(ˆÔÐÐrB   N)rD   rE   rF   rG   r;   © rB   rA   r   r   %  s-   € € € € € ð
ð 
ð)ð )ð )ð )ð )rB   r   c                 ó.   — t          d| z  dz   d¦  «        S )zy
    Choose number of lanczos vectors based on target number
    of singular/eigen values and vectors to compute, k.
    r   r   é   )Úmax)Úks    rA   Ú
choose_ncvrR   8  s   € õ
 ˆq�1‰u�q‰y˜"ÑÔÐrB   c                   ó    — e Zd Z	 	 dd„Zd„ ZdS )Ú_ArpackParamsr   Nr&   r   c           
      óš  — |dk    rt          d|› �¦  «        ‚|	€|dz  }	|	dk    rt          d|	› �¦  «        ‚|dvr't          j        |d¦  «        rd}nt          d¦  «        ‚|�t          j        |d|¬	¦  «        | _        d
}n3|                     dd|g¬¦  «                             |¦  «        | _        d}|€d| _        n|| _        |€t          |¦  «        }t          ||¦  «        | _
        || _        t          j        ||f|¦  «        | _        |
| _        || _        i d|“dd“dd“dd“dd“dd“dd“dt           |
         “dd“d|“dd“dt#          |	¦  «        “d|“d|“dd“d| j
        “d|“i d d“d!d
“d"d“d#d“d$d“d%d“d&d“d'd“d(d“d)d“d*d“d+d“d,d“d-d“d.d“d/d“d0d“¥ddddddddd1œ¥| _        || _        || _        d2| _        d S )3Nr   zk must be positive, k=é
   z"maxiter must be positive, maxiter=ÚfdFDr   z)matrix type must be 'f', 'd', 'F', or 'D'T)ÚcopyÚdtyper   ç      ð¿ç      ð?©ÚlowÚhighÚsizeÚtolÚgetv0_rnorm0g        Ú
aitr_betajÚaitr_rnorm1Ú
aitr_wnormÚ
aup2_rnormÚidoÚwhichÚbmatr=   ÚiterÚmaxiterÚmodeÚnÚnconvÚncvÚnevÚnpÚshiftÚgetv0_firstÚ
getv0_iterÚ
getv0_itryÚ
getv0_orthÚ	aitr_iterÚaitr_jÚ
aitr_orth1Ú
aitr_orth2Úaitr_restartÚ
aitr_step3Ú
aitr_step4Ú	aitr_ierrÚ
aup2_initvÚ	aup2_iterÚ
aup2_getv0)Ú
aup2_cnormÚaup2_kpluspÚaup2_nevÚ	aup2_nev0Úaup2_np0Úaup2_numcnvÚaup2_updateÚaup2_ushiftF)Ú
ValueErrorrp   Úcan_castÚarrayÚresidÚuniformÚastypeÚsigmarR   Úminrn   rl   ÚzerosÚvrg   rk   Ú
WHICH_DICTÚintÚarpack_dictrQ   ÚtpÚ	converged)r<   rl   rQ   r–   Úrngrk   r�   rn   Úv0rj   rg   r`   r=   s                rA   r;   z_ArpackParams.__init__A  s>  € à�Š6ˆ6ÝÐ9°aÐ9Ð9Ñ:Ô:Ð:àˆ?Ø˜"‘fˆGØ�aŠ<ˆ<ÝÐKÀ'ÐKÐKÑLÔLÐLà�VÐÐåŒ{˜2˜sÑ#Ô#ð NØ��å Ð!LÑMÔMÐMàˆ>åœ "¨4°rÐ:Ñ:Ô:ˆDŒJØˆDˆDð Ÿš¨°C¸q¸c˜ÑBÔB×IÒIÈ"ÑMÔMˆDŒJØˆDàˆ=àˆDŒJˆJàˆDŒJàˆ;Ý˜Q‘-”-ˆCÝ�s˜A‘;”;ˆŒØˆŒÝ”˜1˜c˜( BÑ'Ô'ˆŒØˆŒ
ð ˆŒ	ð+
Ø�3ð+
à˜Cð+
ð ˜#ð+
ð ˜3ð	+
ð
 ˜#ð+
ð ˜#ð+
ð �1ð+
ð •Z Ô&ð+
ð �Að+
ð �Dð+
ð �Að+
ð •s˜7‘|”|ð+
ð �Dð+
ð �ð+
ð �Qð+
ð  �4”8ð!+
ð" �1ð#+
ð +
ð$ �!ð%+
ð& �Qð'+
ð( ˜1ð)+
ð* ˜!ð++
ð, ˜!ð-+
ð. ˜!ð/+
ð0 ˜ð1+
ð2 �að3+
ð4 ˜!ð5+
ð6 ˜!ð7+
ð8 ˜Að9+
ð: ˜!ð;+
ð< ˜!ð=+
ð> ˜ð?+
ð@ ˜!ðA+
ðB ˜ðC+
ðD ˜!ðE+
ð +
ðF ØØØØØØØðU+
ð +
ð +
ˆÔðZ ˆŒØˆŒØˆŒˆˆrB   c           	      óN  — d}| j         d         }| j         d         }	 |                      d¦  «        \  }}nP# t          $ rC}|› d|› d�}t          j        d¦  «        }t          j        | j        df¦  «        }d}Y d }~nd }~ww xY wt          d	|› d
|› d| j        › d�||¦  «        ‚)Nz<No convergence (%d iterations, %d/%d eigenvectors converged)rm   ri   Tz [ú])r   r   zNo convergence (z iterations, ú/z eigenvectors converged))r•   Úextractr   rp   r‘   rl   r   rQ   )r<   r?   Úk_okÚnum_iterÚevÚvecÚerrs          rA   Ú_raise_no_convergencez#_ArpackParams._raise_no_convergence›  sö   € ØLˆØÔ Ô(ˆØÔ# FÔ+ˆð	Ø—l’l 4Ñ(Ô(‰GˆB��øÝð 	ð 	ð 	ØÐ"Ð"˜CÐ"Ð"Ð"ˆCÝ”˜$‘”ˆBÝ”(˜DœF A˜;Ñ'Ô'ˆCØˆDˆDˆDˆDˆDˆDøøøøð		øøøõ
 "ð #M°Xð #Mð #MØ%)ð#Mð #MØ,0¬Fð#Mð #Mð #Mà"$ cñ+ô +ð 	+s   ž7 ·
BÁ9A?Á?B)r   NNNNr&   r   )rD   rE   rF   r;   r£   rM   rB   rA   rT   rT   @  sB   € € € € € ØGKØ/0ðXð Xð Xð Xðt+ð +ð +ð +ð +rB   rT   c                   ó(   — e Zd Z	 	 	 dd„Zd„ Zd„ ZdS )	Ú_SymmetricArpackParamsr   Nr&   r   c                 ó¦  ‡ ‡‡‡‡— |dk    rK‰€t          d¦  «        ‚‰�t          d¦  «        ‚‰�t          d¦  «        ‚‰‰ _        d„ ‰ _        d‰ _        �n¨|dk    r\‰€t          d¦  «        ‚‰€t          d	¦  «        ‚‰€t          d
¦  «        ‚ˆˆfd„‰ _        ‰‰ _        ‰‰ _        ‰‰ _        d‰ _        �nF|dk    rc‰�t          d¦  «        ‚‰€t          d¦  «        ‚‰€‰‰ _        ‰‰ _        d„ ‰ _        d‰ _        nþˆˆfd„‰ _        ‰‰ _        ‰‰ _        d‰ _        nÝ|dk    rT‰€t          d¦  «        ‚‰�t          d¦  «        ‚‰€t          d¦  «        ‚‰‰ _        ˆˆ fd„‰ _        ‰‰ _        d‰ _        nƒ|dk    rj‰€t          d¦  «        ‚‰€t          d¦  «        ‚‰‰ _        ‰‰ _        ‰€ˆˆˆfd„‰ _        d„ ‰ _        d‰ _        n/ˆˆˆˆfd„‰ _        ‰‰ _        d‰ _        nt          d|› d�¦  «        ‚|t          vr*t          dd                      t          ¦  «        › �¦  «        ‚||k    rt          d!|› �¦  «        ‚t          j
                             |¦  «        ‰ _        t                               ‰ |||‰ j        |‰|	|
|||¦  «         ‰ j        dk    rd"nd‰ j        d#<   ‰ j        |k    s‰ j        |k    rt          d$‰ j        › �¦  «        ‚t          j        d|z  ‰ j        ¬%¦  «        ‰ _        t          j        ‰ j        ‰ j        d&z   z  ‰ j        ¬%¦  «        ‰ _        t*          ‰ j                 }|d'vrt          d(¦  «        ‚t,          j        |d)z            ‰ _        t,          j        |d*z            ‰ _        t4          |         ‰ _        t8          |         ‰ _        t          j        d+t          j        ¬%¦  «        ‰ _        d S ),Nr   ú#matvec must be specified for mode=1ú'M_matvec cannot be specified for mode=1ú*Minv_matvec cannot be specified for mode=1c                 ó   — | S rC   rM   ©Úxs    rA   ú<lambda>z1_SymmetricArpackParams.__init__.<locals>.<lambda>ë  ó   € ˜q€ rB   ÚIr   ú#matvec must be specified for mode=2ú%M_matvec must be specified for mode=2ú(Minv_matvec must be specified for mode=2c                 ó,   •—  ‰ ‰| ¦  «        ¦  «        S rC   rM   ©r¬   ÚMinv_matvecÚmatvecs    €€rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>õ  ó   ø€   ¨F¨F°1©I¬IÑ 6Ô 6€ rB   ÚGr    z'matvec must not be specified for mode=3z(Minv_matvec must be specified for mode=3c                 ó   — | S rC   rM   r«   s    rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>  ó   €  1€ rB   c                 ó,   •—  ‰ ‰| ¦  «        ¦  «        S rC   rM   )r¬   ÚM_matvecrµ   s    €€rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>  s   ø€  K K°°¸±´Ñ$<Ô$<€ rB   r/   z#matvec must be specified for mode=4z)M_matvec must not be specified for mode=4z(Minv_matvec must be specified for mode=4c                 ó@   •— ‰                       ‰| ¦  «        ¦  «        S rC   ©ÚOPa)r¬   r¶   r<   s    €€rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>  s   ø€  §¢¨¨°©¬Ñ 3Ô 3€ rB   r   z#matvec must be specified for mode=5z(Minv_matvec must be specified for mode=5c                 ó8   •—  ‰ ‰| ¦  «        ‰| z  z   ¦  «        S rC   rM   )r¬   rµ   r¶   r�   s    €€€rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>  s"   ø€  K K°°°q±	´	¸EÀA¹IÑ0EÑ$FÔ$F€ rB   c                 ó   — | S rC   rM   r«   s    rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>   rº   rB   c                 óJ   •—  ‰ ‰| ¦  «        ‰ ‰| ¦  «        z  z   ¦  «        S rC   rM   )r¬   r¼   rµ   r¶   r�   s    €€€€rA   r­   z1_SymmetricArpackParams.__init__.<locals>.<lambda>#  s5   ø€  K K°°°q±	´	Ø27¸(¸(À1¹+¼+Ñ2Eñ1Fñ %Gô %G€ rB   úmode=ú not implementedzwhich must be one of ú zk must be less than ndim(A), k=r   rh   zncv must be k<ncv<=n, ncv=©rY   r2   )r   r   z Input matrix is not real-valued.Ú
saupd_wrapÚ
seupd_wrapé   ) r‰   ÚOPÚBrh   r¿   ÚOPbÚA_matvecÚ_SEUPD_WHICHÚjoinrp   ÚrandomÚdefault_rngr˜   rT   r;   r•   rn   r‘   r–   ÚworkdÚworklÚ
_type_convr   Ú__dict__Ú_arpack_solverÚ_arpack_extractÚ_SAUPD_ERRORSÚiterate_infodictÚ_SEUPD_ERRORSÚextract_infodictÚint32Úipntr©r<   rl   rQ   r–   r¶   rk   r¼   rµ   r�   rn   r™   rj   rg   r`   r˜   Últrs   `   ` ```       rA   r;   z_SymmetricArpackParams.__init__¬  sH  øøøøø€ ðl �1Š9ˆ9Øˆ~Ý Ð!FÑGÔGÐGØÐ#Ý Ð!JÑKÔKÐKØÐ&Ý Ð!MÑNÔNÐNàˆDŒGØ �[ˆDŒFØˆDŒI‰IØ�QŠYˆYØˆ~Ý Ð!FÑGÔGÐGØÐÝ Ð!HÑIÔIÐIØÐ"Ý Ð!KÑLÔLÐLà6Ð6Ð6Ð6Ð6ˆDŒGØ"ˆDŒHØˆDŒHØˆDŒFØˆDŒI‰IØ�QŠYˆYØÐ!Ý Ð!JÑKÔKÐKØÐ"Ý Ð!KÑLÔLÐLàÐØ%�”Ø&�”Ø$˜�”Ø�”	�	à<Ð<Ð<Ð<Ð<�”Ø&�”Ø!�”Ø�”	�	Ø�QŠYˆYØˆ~Ý Ð!FÑGÔGÐGØÐ#Ý Ð!LÑMÔMÐMØÐ"Ý Ð!KÑLÔLÐLØ"ˆDŒHØ3Ð3Ð3Ð3Ð3ˆDŒGØˆDŒFØˆDŒIˆIØ�QŠYˆYØˆ~Ý Ð!FÑGÔGÐGØÐ"Ý Ð!KÑLÔLÐLà"ˆDŒHØ"ˆDŒMàÐØFÐFÐFÐFÐFÐF�”Ø$˜�”Ø�”	�	ðGð Gð Gð Gð Gð Gð G�”à!�”Ø�”	�	åÐ; TÐ;Ð;Ð;Ñ<Ô<Ð<à�Ð$Ð$ÝÐM°S·X²X½lÑ5KÔ5KÐMÐMÑNÔNÐNØ�Š6ˆ6ÝÐB¸qÐBÐBÑCÔCÐCå”9×(Ò(¨Ñ-Ô-ˆŒÝ×Ò˜t Q¨¨2¨t¬x¸¸uÀcÈ2Ø&¨¨sñ	4ô 	4ð 	4ð )-¬	°SÒ(8Ð(8 1 1¸aˆÔ˜Ñ àŒ8�aŠ<ˆ<˜4œ8 qš=˜=ÝÐD¸$¼(ÐDÐDÑEÔEÐEå”X˜a !™e¨4¬7Ð3Ñ3Ô3ˆŒ
Ý”X˜dœh¨$¬(°Q©,Ñ7¸t¼wÐGÑGÔGˆŒ
å˜œÔ!ˆØ�jÐ Ð ÝÐ?Ñ@Ô@Ð@å(Ô1°#¸Ñ2DÔEˆÔÝ)Ô2°3¸Ñ3EÔFˆÔå -¨cÔ 2ˆÔÝ -¨cÔ 2ˆÔå”X˜b­¬Ð1Ñ1Ô1ˆŒ
ˆ
ˆ
rB   c                 óÞ  — |                       | j        | j        | j        | j        | j        | j        ¦  «         t          | j        d         | j        d         | j        z   ¦  «        }t          | j        d         | j        d         | j        z   ¦  «        }| j        d         dk    �rx| j	        dk    r*|  
                    | j        |         ¦  «        | j        |<   d S | j	        dk    rR|                      | j        |         ¦  «        | j        |<   |                      | j        |         ¦  «        | j        |<   d S | j	        dk    rƒt          | j        d         | j        d         | j        z   ¦  «        }|                      | j        |         ¦  «        }|                      || j        | j        |         z  z   ¦  «        | j        |<   d S t          | j        d         | j        d         | j        z   ¦  «        }|                      | j        |         ¦  «        | j        |<   d S | j        d         dk    r*|                      | j        |         ¦  «        | j        |<   d S | j        d         dk    rt!          d¦  «        ‚| j        d         dk    rG| j                             d	d
| j        g¬¦  «                             | j        ¦  «        | j        d d …<   d S | j        d         dk    r*|  
                    | j        |         ¦  «        | j        |<   d S d| _        | j        d         dk    rd S | j        d         dk    r|                      ¦   «          d S t/          | j        d         | j        ¬¦  «        ‚)Nr   r   rf   r   r   r    ú.ARPACK requested user shifts. Assure ISHIFT==0r/   rZ   r[   r\   Tr=   ©r>   )rÖ   r•   rŒ   r’   rÝ   rÒ   rÓ   Úslicerl   rk   rÊ   rÌ   r¿   rÍ   r�   rË   r‰   r˜   r�   rŽ   r–   r—   r£   r   rÙ   )r<   ÚxsliceÚysliceÚBxsliceÚAxs        rA   Úiteratez_SymmetricArpackParams.iterateG  s;  € Ø×Ò˜DÔ,¨d¬j¸$¼&À$Ä*Ø œJ¨¬
ñ	4ô 	4ð 	4õ �t”z !”} d¤j°¤m°d´fÑ&<Ñ=Ô=ˆÝ�t”z !”} d¤j°¤m°d´fÑ&<Ñ=Ô=ˆØÔ˜EÔ" aÒ'Ñ'àŒy˜AŠ~ˆ~Ø%)§W¢W¨T¬Z¸Ô-?Ñ%@Ô%@�”
˜6Ñ"Ð"Ð"Ø”˜a’�Ø%)§X¢X¨d¬j¸Ô.@Ñ%AÔ%A�”
˜6Ñ"Ø%)§X¢X¨d¬j¸Ô.@Ñ%AÔ%A�”
˜6Ñ"Ð"Ð"Ø”˜a’�Ý ¤
¨1¤¨t¬z¸!¬}¸t¼vÑ/EÑFÔF�Ø—]’] 4¤:¨fÔ#5Ñ6Ô6�Ø%)§X¢X¨b°D´JØ48´J¸wÔ4Gñ5Hñ /Iñ &Jô &J�”
˜6Ñ"Ð"Ð"õ   ¤
¨1¤¨t¬z¸!¬}¸t¼vÑ/EÑFÔF�Ø%)§X¢X¨d¬j¸Ô.AÑ%BÔ%B�”
˜6Ñ"Ð"Ð"àÔ˜eÔ$¨Ò)Ð)Ø!%§¢¨¬
°6Ô(:Ñ!;Ô!;ˆDŒJ�vÑÐÐàÔ˜eÔ$¨Ò)Ð)ÝÐMÑNÔNÐNàÔ˜eÔ$¨Ò)Ð)à œH×,Ò,°¸CØ37´6°(ð -ñ <ô <ß<BºFÀ4Ä7¹O¼Oð ŒJ�q�q�q‰MˆMˆMð Ô˜eÔ$¨Ò)Ð)Ø!%§¢¨¬°FÔ);Ñ!<Ô!<ˆDŒJ�vÑÐÐð "ˆDŒNàÔ Ô'¨1Ò,Ð,Ø�ØÔ! &Ô)¨QÒ.Ð.Ø×*Ò*Ñ,Ô,Ð,Ð,Ð,å! $Ô"2°6Ô":Ø+/Ô+@ðBñ Bô Bð BrB   c                 ól  — |}d}d| j         d<   t          d         }t          j        | j        t          j        ¬¦  «        }t          j        | j        | j        ¬¦  «        }t          j        | j        | j        f| j        d¬¦  «        }|  	                    | j         |||||| j
        | j        | j        | j        | j        | j        ¦  «         | j         d         }|dk    rt!          || j        ¬¦  «        ‚| j         d         }|d |…         }|r&|d d …d |…f                              d	¬
¦  «        }||fS |S )Nr   r=   r3   rÆ   r   ©rY   Úorderrâ   rm   ÚC)rë   )r•   ÚHOWMNY_DICTrp   r‘   rn   rÜ   rQ   r–   rl   r×   r�   rŒ   r’   rÝ   rÒ   rÓ   r   rÛ   rX   )	r<   Úreturn_eigenvectorsÚrvecÚierrÚhowmnyÚsselectr   r   rž   s	            rA   r�   z_SymmetricArpackParams.extractv  s:  € Ø"ˆØˆØ#$ˆÔ˜Ñ Ý˜SÔ!ˆÝ”(˜4œ8­2¬8Ð4Ñ4Ô4ˆÝŒH�T”V 4¤7Ð+Ñ+Ô+ˆÝŒH�d”f˜dœhÐ'¨t¬w¸cÐBÑBÔBˆà×ÒØÔ˜d F¨G°Q¸¸4¼:ØŒJ˜œ ¤
¨D¬JØŒJñ	
ô 	
ð 	
ð Ô Ô'ˆØ�1Š9ˆ9Ý˜d¨TÔ-BÐCÑCÔCÐCØÔ Ô(ˆØˆeˆtˆeŒHˆàð 	Ø�!�!�!�U�d�U�(”× Ò  sÐ Ñ+Ô+ˆAØ�a�4ˆKàˆHrB   ©
r   NNNNNNr&   r   N©rD   rE   rF   r;   rè   r�   rM   rB   rA   r¥   r¥   «  sX   € € € € € ØLPØNOØðY2ð Y2ð Y2ð Y2ðv-Bð -Bð -Bð^ð ð ð ð rB   r¥   c                   ó(   — e Zd Z	 	 	 dd„Zd„ Zd„ ZdS )	Ú_UnsymmetricArpackParamsr   Nr&   r   c                 óò  ‡ ‡‡‡— |dk    rK‰€t          d¦  «        ‚‰�t          d¦  «        ‚‰�t          d¦  «        ‚‰‰ _        d„ ‰ _        d‰ _        �n|dk    r[‰€t          d¦  «        ‚‰€t          d	¦  «        ‚‰€t          d
¦  «        ‚ˆˆfd„‰ _        ‰‰ _        ‰‰ _        ‰‰ _        d‰ _        n´|dv r�‰€t          d¦  «        ‚‰€t          d¦  «        ‚‰‰ _        |dv r|dk    r‰‰ _        n*t          d¦  «        ‚|dk    rˆfd„‰ _        n
ˆfd„‰ _        ‰€d„ ‰ _        d‰ _        ‰ j        ‰ _        n-‰‰ _        d‰ _        ˆˆ fd„‰ _        nt          d|› d�¦  «        ‚|t          vr*t          dd                     t          ¦  «        › �¦  «        ‚||dz
  k    rt          d|› �¦  «        ‚t          j
                             |¦  «        ‰ _        t                               ‰ |||||||	|
|||¦  «         ‰ j        dk    rdnd‰ j        d<   ‰ j        |k    s‰ j        |dz   k    rt          d‰ j        › �¦  «        ‚t          j        d|z  ‰ j        ¬¦  «        ‰ _        t          j        d‰ j        z  ‰ j        dz   z  ‰ j        ¬¦  «        ‰ _        t*          ‰ j                 }t,          j        |d z            ‰ _        t,          j        |d!z            ‰ _        t4          |         ‰ _        t8          |         ‰ _        t          j        d"t          j        ¬¦  «        ‰ _        ‰ j        d#v r9t          j        ‰ j        ‰ j                              ¦   «         ¬¦  «        ‰ _!        d S d ‰ _!        d S )$Nr   r§   r¨   r©   c                 ó   — | S rC   rM   r«   s    rA   r­   z3_UnsymmetricArpackParams.__init__.<locals>.<lambda>Á  r®   rB   r¯   r   r°   r±   r²   c                 ó,   •—  ‰ ‰| ¦  «        ¦  «        S rC   rM   r´   s    €€rA   r­   z3_UnsymmetricArpackParams.__init__.<locals>.<lambda>Ë  r·   rB   r¸   ©r    r/   z*matvec must be specified for mode in (3,4)z/Minv_matvec must be specified for mode in (3,4)ÚDFr    zmode=4 invalid for complex Ac                 ó>   •— t          j         ‰| ¦  «        ¦  «        S rC   )rp   Úreal©r¬   rµ   s    €rA   r­   z3_UnsymmetricArpackParams.__init__.<locals>.<lambda>à  ó   ø€ ­¬°°¸Q±´Ñ)@Ô)@€ rB   c                 ó>   •— t          j         ‰| ¦  «        ¦  «        S rC   )rp   Úimagrþ   s    €rA   r­   z3_UnsymmetricArpackParams.__init__.<locals>.<lambda>â  rÿ   rB   c                 ó   — | S rC   rM   r«   s    rA   r­   z3_UnsymmetricArpackParams.__init__.<locals>.<lambda>ä  rº   rB   c                 ó@   •— ‰                       ‰| ¦  «        ¦  «        S rC   r¾   )r¬   r¼   r<   s    €€rA   r­   z3_UnsymmetricArpackParams.__init__.<locals>.<lambda>ê  s   ø€  D§H¢H¨X¨X°a©[¬[Ñ$9Ô$9€ rB   rÃ   rÄ   zParameter which must be one of rÅ   z!k must be less than ndim(A)-1, k=r   rh   zncv must be k+1<ncv<=n, ncv=rÆ   Ú
naupd_wrapÚ
neupd_wrapé   ÚFD)"r‰   rÊ   rË   rh   r¿   rÌ   r¶   Ú_NEUPD_WHICHrÏ   rp   rÐ   rÑ   r˜   rT   r;   r•   rn   r‘   r–   rÒ   rÓ   rÔ   r   rÕ   rÖ   r×   r8   rÙ   Ú_NEUPD_ERRORSrÛ   rÜ   rÝ   ÚlowerÚrworkrÞ   s   `   ` ``        rA   r;   z!_UnsymmetricArpackParams.__init__“  sÂ  øøøø€ ðJ �1Š9ˆ9Øˆ~Ý Ð!FÑGÔGÐGØÐ#Ý Ð!JÑKÔKÐKØÐ&Ý Ð!MÑNÔNÐNàˆDŒGØ �[ˆDŒFØˆDŒI‰IØ�QŠYˆYØˆ~Ý Ð!FÑGÔGÐGØÐÝ Ð!HÑIÔIÐIØÐ"Ý Ð!KÑLÔLÐLà6Ð6Ð6Ð6Ð6ˆDŒGØ"ˆDŒHØˆDŒHØˆDŒFØˆDŒIˆIØ�Vˆ^ˆ^Øˆ~Ý ð "5ñ 6ô 6ð 6àÐ"Ý ð "5ñ 6ô 6ð 6ð !ˆDŒKØ�TˆzˆzØ˜1’9�9Ø*�D”H�Hå$Ð%CÑDÔDÐDà˜1’9�9Ø@Ð@Ð@Ð@�D”H�Hà@Ð@Ð@Ð@�D”HØÐØ$˜�”Ø�”	Øœ(�”�à!�”Ø�”	Ø9Ð9Ð9Ð9Ð9�”�åÐ; TÐ;Ð;Ð;Ñ<Ô<Ð<à�Ð$Ð$Ýð :Ø!$§¢­,Ñ!7Ô!7ð:ð :ñ ;ô ;ð ;à��A‘Š:ˆ:ÝÐDÀÐDÐDÑEÔEÐEå”9×(Ò(¨Ñ-Ô-ˆŒÝ×Ò˜t Q¨¨2¨s°D¸%ÀÀbÈ'Ø$ cñ	+ô 	+ð 	+ð )-¬	°SÒ(8Ð(8 1 1¸aˆÔ˜Ñ àŒ8�aŠ<ˆ<˜4œ8 q¨1¡uÒ,Ð,ÝÐF¸D¼HÐFÐFÑGÔGÐGå”X˜a !™e¨4¬7Ð3Ñ3Ô3ˆŒ
Ý”X˜a $¤(™l¨d¬h¸©lÑ;À4Ä7ÐKÑKÔKˆŒ
å˜œÔ!ˆÝ(Ô1°#¸Ñ2DÔEˆÔÝ)Ô2°3¸Ñ3EÔFˆÔå -¨cÔ 2ˆÔÝ -¨cÔ 2ˆÔå”X˜b­¬Ð1Ñ1Ô1ˆŒ
àŒ7�dˆ?ˆ?Ýœ $¤(°$´'·-²-±/´/ÐBÑBÔBˆDŒJˆJˆJàˆDŒJˆJˆJrB   c           	      ó’  — | j         dv r9|                      | j        | j        | j        | j        | j        | j        ¦  «         n>|                      | j        | j        | j        | j        | j        | j        | j        ¦  «         t          | j        d         | j        d         | j
        z   ¦  «        }t          | j        d         | j        d         | j
        z   ¦  «        }| j        d         dk    r‹| j        dv r*|                      | j        |         ¦  «        | j        |<   d S t          | j        d         | j        d         | j
        z   ¦  «        }|                      | j        |         ¦  «        | j        |<   d S | j        d         dk    r*|                      | j        |         ¦  «        | j        |<   d S | j        d         dk    rt          d¦  «        ‚| j        d         d	k    rÇ| j         dv rG| j                             d
d| j
        g¬¦  «                             | j         ¦  «        | j        d d …<   d S | j                             d
d| j
        dg¬¦  «                             t(          j        ¦  «                             | j         ¦  «                             ¦   «         | j        d d …<   d S | j        d         dk    r*|                      | j        |         ¦  «        | j        |<   d S d| _        | j        d         dk    rd S | j        d         dk    r|                      ¦   «          d S t3          | j        d         | j        ¬¦  «        ‚)NÚfdr   r   rf   ©r   r   r   r    rá   r/   rZ   r[   r\   r   Tr=   )r=   r>   )r–   rÖ   r•   rŒ   r’   rÝ   rÒ   rÓ   r  rã   rl   rk   rÊ   r¿   rË   r‰   r˜   r�   rŽ   Úviewrp   Ú
complex128Úravelr—   r£   r   rÙ   )r<   rä   rå   ræ   s       rA   rè   z _UnsymmetricArpackParams.iterate  s  € ØŒ7�dˆ?ˆ?Ø×ÒØÔ  $¤*¨d¬f°d´jÀ$Ä*Ø”
ñô ð ð ð ×ÒØÔ  $¤*¨d¬f°d´jÀ$Ä*Ø”
˜DœJñô ð õ
 �t”z !”} d¤j°¤m°d´fÑ&<Ñ=Ô=ˆÝ�t”z !”} d¤j°¤m°d´fÑ&<Ñ=Ô=ˆàÔ˜EÔ" aÒ'Ð'àŒy˜FÐ"Ð"Ø%)§W¢W¨T¬Z¸Ô-?Ñ%@Ô%@�”
˜6Ñ"Ð"Ð"å ¤
¨1¤¨t¬z¸!¬}¸t¼vÑ/EÑFÔF�Ø%)§X¢X¨d¬j¸Ô.AÑ%BÔ%B�”
˜6Ñ"Ð"Ð"àÔ˜eÔ$¨Ò)Ð)Ø!%§¢¨¬
°6Ô(:Ñ!;Ô!;ˆDŒJ�vÑÐÐàÔ˜eÔ$¨Ò)Ð)ÝÐMÑNÔNÐNàÔ˜eÔ$¨Ò)Ð)ØŒw˜$ˆˆà $¤× 0Ò 0°TÀØ7;´v°hð !1ñ !@ô !@ß@FÂÀtÄwÁÄð ”
˜1˜1˜1‘��ð !%¤× 0Ò 0°TÀÈ4Ì6ÐSTÈ+Ð 0ñ !ô !ß’$•r”}Ñ%Ô%§f¢f¨T¬W¡o¤o·e²e±g´gð ”
˜1˜1˜1‘��ð Ô˜eÔ$¨Ò)Ð)Ø!%§¢¨¬°FÔ);Ñ!<Ô!<ˆDŒJ�vÑÐÐð "ˆDŒNàÔ Ô'¨1Ò,Ð,Ø�ØÔ! &Ô)¨QÒ.Ð.Ø×*Ò*Ñ,Ô,Ð,Ð,Ð,å! tÔ'7¸Ô'?Ø+/Ô+@ðBñ Bô Bð BrB   c                 ól  — | j         | j        }}d}d| j        d<   t          d         }t	          j        | j        t          j        ¬¦  «        }t          t	          j	        | j
        ¦  «        ¦  «        }t          t	          j        | j
        ¦  «        ¦  «        }t	          j        d| j        z  | j        ¦  «        }	| j        dv �r—t	          j        |dz   g| j        ¬¦  «        }
t	          j        |dz   g| j        ¬¦  «        }t	          j        ||dz   g| j        d¬	¦  «        }|                      | j        ||||
|||||	| j        | j        | j        | j        | j        ¦  «         | j        d         }|dk    rt'          || j        ¬
¦  «        ‚| j        d         }|
d|z  z   }|                     | j                             ¦   «         ¦  «        }|dk    r’d}||k    rˆt/          ||         j        ¦  «        dk    r_||k     rT|d d …|f         d|d d …|dz   f         z  z   |d d …|f<   |d d …|f                              ¦   «         |d d …|dz   f<   |dz  }n|dz  }|dz  }||k    °ˆ�nùd}||k    �rðt/          ||         j        ¦  «        dk    rAt	          j        |d d …|f         |                      |d d …|f         ¦  «        ¦  «        ||<   �n…||k     �ry|d d …|f         d|d d …|dz   f         z  z   |d d …|f<   |d d …|f                              ¦   «         |d d …|dz   f<   t	          j        |d d …|f         |                      |d d …|f         ¦  «        ¦  «        t	          j        |d d …|dz   f         |                      |d d …|dz   f         ¦  «        ¦  «        z   dt	          j        |d d …|f         |                      |d d …|dz   f         ¦  «        ¦  «        t	          j        |d d …|dz   f         |                      |d d …|f         ¦  «        ¦  «        z
  z  z   ||<   ||                              ¦   «         ||dz   <   |dz  }n|dz  }|dz  }||k    �°ð||k    r|d |…         }|d d …d |…f         }�n®| j        dv r|}n| j        dv rd|| j
        z
  z  }| j        dv rt	          j        |j	        ¦  «        }nQ| j        dv r't	          j        t/          |j        ¦  «        ¦  «        }n!t	          j        t/          |¦  «        ¦  «        }| j        dv r|| d …         d d d…         }n| j        dv r
|d |…         }||         }|d d …|f         }nÒt	          j        |g| j        ¬¦  «        }t	          j        ||g| j        d¬	¦  «        }|                      | j        |||||| j
        |	| j        | j        | j        | j        | j        | j        ¦  «         | j        d         }|dk    rt'          || j        ¬
¦  «        ‚| j        d         }|d |…         }|d d …d |…f         }|r||fS |S )Nr   r=   r3   rÆ   r    r  r   r   rê   râ   rm   ù              ð?r  rú   )r+   r,   )r-   r.   )r+   r&   r-   r!   )r,   r'   r.   ) rQ   rl   r•   rí   rp   r‘   rn   rÜ   Úfloatrý   r�   r  r–   r×   rŒ   r’   rÝ   rÒ   rÓ   r   rÛ   rŽ   ÚupperÚabsÚ	conjugateÚdotr¶   Úconjrk   rg   Úargsortr  )r<   rî   rQ   rl   rð   rñ   rò   ÚsigmarÚsigmaiÚworkevÚdrÚdiÚzrÚ	nreturnedr   r   ÚiÚrdÚindrž   s                       rA   r�   z _UnsymmetricArpackParams.extractD  s©  € ØŒv�t”vˆ1ˆàˆØ#$ˆÔ˜Ñ Ý˜SÔ!ˆÝ”(˜4œ8­2¬8Ð4Ñ4Ô4ˆÝ•r”w˜tœzÑ*Ô*Ñ+Ô+ˆÝ•r”w˜tœzÑ*Ô*Ñ+Ô+ˆÝ”˜!˜dœh™,¨¬Ñ0Ô0ˆàŒ7�dˆ?‰?Ý”˜1˜q™5˜'¨¬Ð1Ñ1Ô1ˆBÝ”˜1˜q™5˜'¨¬Ð1Ñ1Ô1ˆBå”˜1˜a !™e˜*¨D¬G¸3Ð?Ñ?Ô?ˆBð × Ò ØÔ Ð"5°v¸wÈÈBØ�F˜F F¨D¬J¸¼ÀÄ
Ø”
˜DœJñô ð ð Ô# FÔ+ˆDà�qŠyˆyÝ! $°Ô1FÐGÑGÔGÐGØÔ(¨Ô1ˆIð �T˜B‘Y‘ˆAð —	’	˜$œ'Ÿ-š-™/œ/Ñ*Ô*ˆAð ˜Š{ˆ{Ø�Ø˜1’f�få˜1˜Qœ4œ9‘~”~¨Ò*Ð*ð ˜qš5˜5Ø&(¨¨¨¨A¨¤h°¸¸1¸1¸1¸aÀ!¹e¸8¼Ñ1DÑ&D˜A˜a˜a˜a ˜d™GØ*+¨A¨A¨A¨q¨D¬'×*;Ò*;Ñ*=Ô*=˜A˜a˜a˜a  Q¡˜h™KØ ™F˜A˜Að &¨™N˜IØ˜‘F�Að ˜1’f�fùð* �Ø˜1’f‘fÝ˜1˜Qœ4œ9‘~”~¨Ò*Ð*Ý!œv b¨¨¨¨A¨¤h°·²¸B¸q¸q¸qÀ!¸t¼HÑ0EÔ0EÑFÔF˜˜!™™à˜qš5™5Ø&(¨¨¨¨A¨¤h°¸¸1¸1¸1¸aÀ!¹e¸8¼Ñ1DÑ&D˜A˜a˜a˜a ˜d™GØ*+¨A¨A¨A¨q¨D¬'×*;Ò*;Ñ*=Ô*=˜A˜a˜a˜a  Q¡˜h™KÝ%'¤V¨B¨q¨q¨q°!¨t¬HØ,0¯KªK¸¸1¸1¸1¸a¸4¼Ñ,AÔ,Añ&Cô &Cå')¤v¨b°°°°A¸±E°¬lØ.2¯kªk¸"¸Q¸Q¸QÀÀAÁ¸X¼,Ñ.GÔ.Gñ(Iô (Iñ&Ið ')­B¬F°2°a°a°a¸°d´8Ø37·;²;¸rÀ!À!À!ÀQÈÁUÀ(¼|Ñ3LÔ3Lñ-Nô -Nå.0¬f°R¸¸¸¸1¸q¹5¸´\Ø59·[²[ÀÀAÀAÀAÀqÀDÄÑ5JÔ5Jñ/Lô /Lñ-Lñ 'Mñ	%M˜A˜a™Dð ()¨¤t§y¢y¡{¤{˜A˜a !™e™HØ ™F˜A˜Að &¨™N˜IØ˜‘F�Að/ ˜1’f‘fð8 ˜AŠ~ˆ~à�j�y�j”M�Ø�a�a�a˜˜)˜�mÔ$�‘ð ”9 Ð&Ð&Ø�B�BØ”Y &Ð(Ð(Ø˜a $¤*™nÑ-�Bà”: Ð-Ð-Ýœ* R¤WÑ-Ô-�C�CØ”Z <Ð/Ð/õ œ*¥S¨¬¡\¤\Ñ2Ô2�C�Cåœ*¥S¨¡W¤WÑ-Ô-�Cà”:Ð!3Ð3Ð3Ø˜q˜b˜c˜cœ( 4 4 R 4œ.�C�CØ”ZÐ#5Ð5Ð5Ø˜b˜q˜bœ'�Cà�c”F�Ø�a�a�a˜�f”I��å”˜!˜ D¤GÐ,Ñ,Ô,ˆAÝ”˜!˜Q˜ t¤w°cÐ:Ñ:Ô:ˆAØ× Ò ØÔ Ð"5°v¸wÈÈ1Ø”
˜F D¤J°´¸¼
ÀDÄJØ”
˜DœJñ(ô (ð (ð
 Ô# FÔ+ˆDà�qŠyˆyÝ! $°Ô1FÐGÑGÔGÐGàÔ# GÔ,ˆDØ�%�4�%”ˆAØ�!�!�!�U�d�U�(”ˆAàð 	Ø�a�4ˆKàˆHrB   ró   rô   rM   rB   rA   rö   rö   ’  s]   € € € € € Ø:>Ø)-ØIMðyð yð yð yðv4Bð 4Bð 4BðlNð Nð Nð Nð NrB   rö   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚSpLuInvzl
    SpLuInv:
       helper class to repeatedly solve M*x=b
       using a sparse LU-decomposition of M
    c                 ó²   — t          |¦  «        | _        |j        | _        |j        | _        t	          j        | j        t          j        ¦  «         | _        d S rC   )r   ÚM_luÚshaperY   rp   Ú
issubdtypeÚcomplexfloatingÚisreal©r<   ÚMs     rA   r;   zSpLuInv.__init__Û  s@   € Ý˜‘G”GˆŒ	Ø”WˆŒ
Ø”WˆŒ
Ýœ-¨¬
µBÔ4FÑGÔGÐGˆŒˆˆrB   c                 óü  — t          j        |¦  «        }| j        r°t          j        |j        t           j        ¦  «        rŒ| j                             t          j        |¦  «         	                    | j        ¦  «        ¦  «        d| j                             t          j
        |¦  «         	                    | j        ¦  «        ¦  «        z  z   S | j                             | 	                    | j        ¦  «        ¦  «        S )Nr  )rp   Úasarrayr,  r*  rY   r+  r(  Úsolverý   rŽ   r  ©r<   r¬   s     rA   Ú_matveczSpLuInv._matvecá  sº   € õ ŒJ�q‰MŒMˆØŒ;ð 	9�2œ=¨¬µ"Ô2DÑEÔEð 	9Ø”I—O’O¥B¤G¨A¡J¤J×$5Ò$5°d´jÑ$AÔ$AÑBÔBØ˜4œ9Ÿ?š?­2¬7°1©:¬:×+<Ò+<¸T¼ZÑ+HÔ+HÑIÔIÑIñJð Kð ”9—?’? 1§8¢8¨D¬JÑ#7Ô#7Ñ8Ô8Ð8rB   N©rD   rE   rF   rG   r;   r3  rM   rB   rA   r&  r&  Ô  s?   € € € € € ðð ðHð Hð Hð9ð 9ð 9ð 9ð 9rB   r&  c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚLuInvzd
    LuInv:
       helper class to repeatedly solve M*x=b
       using an LU-decomposition of M
    c                 ó^   — t          |¦  «        | _        |j        | _        |j        | _        d S rC   )r	   r(  r)  rY   r-  s     rA   r;   zLuInv.__init__ó  s%   € Ý˜a‘L”LˆŒ	Ø”WˆŒ
Ø”WˆŒ
ˆ
ˆ
rB   c                 ó,   — t          | j        |¦  «        S rC   )r
   r(  r2  s     rA   r3  zLuInv._matvecø  s   € Ý˜œ	 1Ñ%Ô%Ð%rB   Nr4  rM   rB   rA   r6  r6  ì  s<   € € € € € ðð ðð ð ð
&ð &ð &ð &ð &rB   r6  c                 óâ   — t          j        |¦  «        }dt          j        |j        ¦  «        z  t          j        |j        ¦  «        j        z  }t          | |t          ||¦  «        d¬¦  «        S )z2
    gmres with looser termination condition.
    iè  r   )ÚrtolÚatol)	rp   r0  Úsqrtr_   ÚfinforY   Úepsr   rP   )r3   Úbr`   Úmin_tols       rA   Úgmres_looserA  ü  sZ   € õ 	Œ
�1‰Œ€AØ•R”W˜QœV‘_”_Ñ$¥r¤x°´Ñ'8Ô'8Ô'<Ñ<€GÝ��A�C  WÑ-Ô-°AÐ6Ñ6Ô6Ð6rB   c                   ó$   — e Zd ZdZedfd„Zd„ ZdS )ÚIterInvzb
    IterInv:
       helper class to repeatedly solve M*x=b
       using an iterative method.
    r   c                 ó,  — || _         t          |d¦  «        r|j        | _        n.t          j        |j        d         ¦  «        }||z  j        | _        |j        | _        |dk    r!dt          j        | j        ¦  «        j        z  }|| _        || _	        d S )NrY   r   r   r   )
r.  ÚhasattrrY   rp   r‘   r)  r=  r>  Úifuncr`   )r<   r.  rF  r`   r¬   s        rA   r;   zIterInv.__init__  s‡   € ØˆŒÝ�1�gÑÔð 	'ØœˆDŒJˆJå”˜œ œÑ$Ô$ˆAØ˜a™%œˆDŒJØ”WˆŒ
à�!Š8ˆ8ð •b”h˜tœzÑ*Ô*Ô.Ñ.ˆCØˆŒ
ØˆŒˆˆrB   c                 óœ   — |                       | j        || j        ¬¦  «        \  }}|dk    r t          d| j         j        › d|› d�¦  «        ‚|S )N©r`   r   zError in inverting M: function ú did not converge (info = ú).)rF  r.  r`   r‰   rD   ©r<   r¬   r?  r=   s       rA   r3  zIterInv._matvec  sk   € Ø—*’*˜TœV Q¨D¬H�*Ñ5Ô5‰ˆˆ4Ø�1Š9ˆ9Ýð5°$´*Ô2Eð 5ð 5Ø,0ð5ð 5ð 5ñô ð ð ˆrB   N)rD   rE   rF   rG   rA  r;   r3  rM   rB   rA   rC  rC    sH   € € € € € ðð ð !,°ð ð ð ð ð ð ð ð ð rB   rC  c                   ó:   — e Zd ZdZedfd„Zd„ Zed„ ¦   «         ZdS )Ú	IterOpInvzo
    IterOpInv:
       helper class to repeatedly solve [A-sigma*M]*x = b
       using an iterative method
    r   c                 óä  ‡‡‡— ‰| _         ‰| _        ‰| _        ˆˆˆfd„}ˆˆfd„}t          j        ‰j        d         ¦  «        }‰€2 ||¦  «        j        }	t          | j         j        ||	¬¦  «        | _        n1 ||¦  «        j        }	t          | j         j        ||	¬¦  «        | _        ‰j        | _        |dk    r&dt          j	        | j        j        ¦  «        j
        z  }|| _        || _        d S )Nc                 ó`   •— ‰                      | ¦  «        ‰‰                      | ¦  «        z  z
  S rC   ©r¶   )r¬   r3   r.  r�   s    €€€rA   Ú	mult_funcz%IterOpInv.__init__.<locals>.mult_func2  s'   ø€ Ø—8’8˜A‘;”; ¨¯ª°!©¬Ñ!4Ñ4Ð4rB   c                 ó:   •— ‰                      | ¦  «        ‰| z  z
  S rC   rP  )r¬   r3   r�   s    €€rA   Úmult_func_M_Nonez,IterOpInv.__init__.<locals>.mult_func_M_None5  s   ø€ Ø—8’8˜A‘;”; ¨¡Ñ*Ð*rB   r   rÆ   r   r   )r3   r.  r�   rp   r‘   r)  rY   r   rÊ   r=  r>  rF  r`   )
r<   r3   r.  r�   rF  r`   rQ  rS  r¬   rY   s
    ```      rA   r;   zIterOpInv.__init__-  s%  øøø€ ØˆŒØˆŒØˆŒ
ð	5ð 	5ð 	5ð 	5ð 	5ð 	5ð 	5ð	+ð 	+ð 	+ð 	+ð 	+ð 	+õ ŒH�Q”W˜Q”ZÑ Ô ˆØˆ9Ø$Ð$ QÑ'Ô'Ô-ˆEÝ$ T¤V¤\Ø%5Ø+0ð2ñ 2ô 2ˆDŒGˆGð �I˜a‘L”LÔ&ˆEÝ$ T¤V¤\Ø%.Ø+0ð2ñ 2ô 2ˆDŒGð ”WˆŒ
à�!Š8ˆ8ð •b”h˜tœwœ}Ñ-Ô-Ô1Ñ1ˆCØˆŒ
ØˆŒˆˆrB   c                 óœ   — |                       | j        || j        ¬¦  «        \  }}|dk    r t          d| j         j        › d|› d�¦  «        ‚|S )NrH  r   z)Error in inverting [A-sigma*M]: function rI  rJ  )rF  rÊ   r`   r‰   rD   rK  s       rA   r3  zIterOpInv._matvecL  sk   € Ø—*’*˜TœW a¨T¬X�*Ñ6Ô6‰ˆˆ4Ø�1Š9ˆ9Ýð5¸D¼JÔ<Oð 5ð 5Ø,0ð5ð 5ð 5ñô ð ð ˆrB   c                 ó   — | j         j        S rC   )rÊ   rY   )r<   s    rA   rY   zIterOpInv.dtypeU  s   € àŒwŒ}ÐrB   N)	rD   rE   rF   rG   rA  r;   r3  ÚpropertyrY   rM   rB   rA   rM  rM  &  sc   € € € € € ðð ð +6¸1ð ð ð ð ð>ð ð ð ðð ñ „Xðð ð rB   rM  Fc                 ó¼   — | j         dk    r-|r+t          j        | j        t          j        ¦  «        s| j        S t          | ¦  «        r| S |                      ¦   «         S )z:Convert sparse matrix to CSC (by transposing, if possible)Úcsr)Úformatrp   r*  rY   r+  ÚTr   Útocsc)r3   Ú	hermitians     rA   Ú_fast_spmatrix_to_cscr]  Z  sW   € à	Œ�EÒÐ˜iÐÝ”M !¤'­2Ô+=Ñ>Ô>ð 	àŒsˆ
Ý	˜AÑ	Ô	ð àˆà�wŠw‰yŒyÐrB   c                 óú   — t          | ¦  «        rt          | ¦  «        j        S t          | ¦  «        st	          | ¦  «        r%t          | |¬¦  «        } t          | ¦  «        j        S t          | |¬¦  «        j        S )N©r\  rH  )r   r6  r¶   r   r   r]  r&  rC  )r.  r\  r`   s      rA   Úget_inv_matvecr`  f  ss   € Ýˆq�z„zð *Ý�Q‰xŒxŒÐÝ	�!‰Œð *Õ*¨1Ñ-Ô-ð *Ý! !¨yÐ9Ñ9Ô9ˆÝ�q‰zŒzÔ Ð å�q˜cÐ"Ñ"Ô"Ô)Ð)rB   c                 óh  — |dk    rt          | ||¬¦  «        S |�€'t          | ¦  «        r�t          j        | j        t          j        ¦  «        st          j        |¦  «        dk    rt          j        | ¦  «        } n| dz   } | j        d d | j	        d         dz   …xx         |z  cc<   t          | ¦  «        j        S t          | ¦  «        st          | ¦  «        rE| |t          | j	        d         ¦  «        z  z
  } t          | |¬¦  «        } t!          | ¦  «        j        S t#          t%          | ¦  «        |||¬¦  «        j        S t          | ¦  «        st          | ¦  «        st          | ¦  «        r-t          |¦  «        sPt          |¦  «        sAt          | ¦  «        s2t#          t%          | ¦  «        t%          |¦  «        ||¬¦  «        j        S t          | ¦  «        st          |¦  «        rt          | ||z  z
  ¦  «        j        S | ||z  z
  }t          ||¬¦  «        }t!          |¦  «        j        S )Nr   ©r\  r`   y                r   r_  rH  )r`  r   rp   r*  rY   r+  r  rX   Úflatr)  r6  r¶   r   r   r   r]  r&  rM  r   )r3   r.  r�   r\  r`   rÊ   s         rA   Úget_OPinv_matvecrd  p  s.  € Ø�‚z€zÝ˜a¨9¸#Ð>Ñ>Ô>Ð>à�yå�1‰:Œ:ð 	7Ý”˜aœg¥rÔ'9Ñ:Ô:ð Ý”w˜u‘~”~¨Ò*Ð*Ý”G˜A‘J”J��à˜‘F�ØŒFÐ#Ð#�Q”W˜Q”Z !‘^Ð#Ð$Ð$Ô$¨Ñ-Ð$Ð$Ñ$Ý˜‘8”8”?Ð"Ý�a‰[Œ[ð 	7Õ.¨qÑ1Ô1ð 	7Ø�E�C ¤¨¤
™OœOÑ+Ñ+ˆAÝ% a°9Ð=Ñ=Ô=ˆAÝ˜1‘:”:Ô$Ð$åÕ-¨aÑ0Ô0Ø ¨3ð0ñ 0ô 0Ü06ð7õ ˜‘”ð 
	&¥H¨Q¡K¤Kð 
	&Õ8JÈ1Ñ8MÔ8Mð 
	&Ý˜Q‘Z”Zð
	&Ý(0°©¬ð
	&Ý<NÈqÑ<QÔ<Qð
	&åÕ-¨aÑ0Ô0Ý-¨aÑ0Ô0Ø"¨ð-ñ -ô -ä-3ð4õ �Q‰ZŒZð 	&�7 1™:œ:ð 	&Ý˜˜U Q™Y™Ñ'Ô'Ô.Ð.à�U˜Q‘Y‘ˆBÝ& r°YÐ?Ñ?Ô?ˆBÝ˜2‘;”;Ô%Ð%rB   r&   Tc                 óÄ  — t          | ¦  «        } t          |¦  «        }| j        d         | j        d         k    rt          d| j        › d�¦  «        ‚|�§|j        | j        k    rt          d|j        › d| j        › �¦  «        ‚t          j        |j        ¦  «        j                             ¦   «         t          j        | j        ¦  «        j                             ¦   «         k    rt          j        dd	¬
¦  «         | j        d         }|dk    rt          d|› d�¦  «        ‚||dz
  k    r”t          j        dt          d	¬
¦  «         t          | ¦  «        rt          d¦  «        ‚t          | t          ¦  «        rt          d¦  «        ‚t          |t          ¦  «        rt          d¦  «        ‚t          | ||	¬¦  «        S |€”t          | ¦  «        j        }|�t          d¦  «        ‚|�t          d¦  «        ‚|€d}d}d}|
�t          d¦  «        ‚�nTd	}|
€t#          |d|¬¦  «        }nt          |
¦  «        }
|
j        }t          |¦  «        j        }�nt          j        | j        t          j        ¦  «        r|�t          d¦  «        ‚d}nn|�|                     ¦   «         dk    rd}nQ|                     ¦   «         dk    r*t          j        |¦  «        dk    rt          d¦  «        ‚d}nt          d¦  «        ‚t          | ¦  «        j        }|
�t          d¦  «        ‚|€t+          | ||d|¬¦  «        }nt          |¦  «        }|j        }|€d}nt          |¦  «        j        }t          j                             |¦  «        }t1          ||| j        j        |||||||||||¦  «        }|j        s|                     ¦   «          |j        ¯|                     |	¦  «        S ) a–  
    Find k eigenvalues and eigenvectors of the square matrix A.

    Solves ``A @ x[i] = w[i] * x[i]``, the standard eigenvalue problem
    for w[i] eigenvalues with corresponding eigenvectors x[i].

    If M is specified, solves ``A @ x[i] = w[i] * M @ x[i]``, the
    generalized eigenvalue problem for w[i] eigenvalues
    with corresponding eigenvectors x[i]

    Parameters
    ----------
    A : ndarray, sparse matrix or LinearOperator
        An array, sparse matrix, or LinearOperator representing
        the operation ``A @ x``, where A is a real or complex square matrix.
    k : int, optional
        The number of eigenvalues and eigenvectors desired.
        `k` must be smaller than N-1. It is not possible to compute all
        eigenvectors of a matrix.
    M : ndarray, sparse matrix or LinearOperator, optional
        An array, sparse matrix, or LinearOperator representing
        the operation M@x for the generalized eigenvalue problem

            A @ x = w * M @ x.

        M must represent a real symmetric matrix if A is real, and must
        represent a complex Hermitian matrix if A is complex. For best
        results, the data type of M should be the same as that of A.
        Additionally:

            If `sigma` is None, M is positive definite

            If sigma is specified, M is positive semi-definite

        If sigma is None, eigs requires an operator to compute the solution
        of the linear equation ``M @ x = b``.  This is done internally via a
        (sparse) LU decomposition for an explicit matrix M, or via an
        iterative solver for a general linear operator.  Alternatively,
        the user can supply the matrix or operator Minv, which gives
        ``x = Minv @ b = M^-1 @ b``.
    sigma : real or complex, optional
        Find eigenvalues near sigma using shift-invert mode.  This requires
        an operator to compute the solution of the linear system
        ``[A - sigma * M] @ x = b``, where M is the identity matrix if
        unspecified. This is computed internally via a (sparse) LU
        decomposition for explicit matrices A & M, or via an iterative
        solver if either A or M is a general linear operator.
        Alternatively, the user can supply the matrix or operator OPinv,
        which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
        For a real matrix A, shift-invert can either be done in imaginary
        mode or real mode, specified by the parameter OPpart ('r' or 'i').
        Note that when sigma is specified, the keyword 'which' (below)
        refers to the shifted eigenvalues ``w'[i]`` where:

            If A is real and OPpart == 'r' (default),
              ``w'[i] = 1/2 * [1/(w[i]-sigma) + 1/(w[i]-conj(sigma))]``.

            If A is real and OPpart == 'i',
              ``w'[i] = 1/2i * [1/(w[i]-sigma) - 1/(w[i]-conj(sigma))]``.

            If A is complex, ``w'[i] = 1/(w[i]-sigma)``.

    v0 : ndarray, optional
        Starting vector for iteration.
        Default: random
    ncv : int, optional
        The number of Lanczos vectors generated
        `ncv` must be greater than `k`; it is recommended that ``ncv > 2*k``.
        Default: ``min(n, max(2*k + 1, 20))``
    which : str, ['LM' | 'SM' | 'LR' | 'SR' | 'LI' | 'SI'], optional
        Which `k` eigenvectors and eigenvalues to find:

            'LM' : largest magnitude

            'SM' : smallest magnitude

            'LR' : largest real part

            'SR' : smallest real part

            'LI' : largest imaginary part

            'SI' : smallest imaginary part

        When sigma != None, 'which' refers to the shifted eigenvalues w'[i]
        (see discussion in 'sigma', above).  ARPACK is generally better
        at finding large values than small values.  If small eigenvalues are
        desired, consider using shift-invert mode for better performance.
    maxiter : int, optional
        Maximum number of Arnoldi update iterations allowed
        Default: ``n*10``
    tol : float, optional
        Relative accuracy for eigenvalues (stopping criterion)
        The default value of 0 implies machine precision.
    return_eigenvectors : bool, optional
        Return eigenvectors (True) in addition to eigenvalues
    Minv : ndarray, sparse matrix or LinearOperator, optional
        See notes in M, above.
    OPinv : ndarray, sparse matrix or LinearOperator, optional
        See notes in sigma, above.
    OPpart : {'r' or 'i'}, optional
        See notes in sigma, above
    rng : `numpy.random.Generator`, optional
        Pseudorandom number generator state. When `rng` is None, a new
        `numpy.random.Generator` is created using entropy from the
        operating system. Types other than `numpy.random.Generator` are
        passed to `numpy.random.default_rng` to instantiate a ``Generator``.

    Returns
    -------
    w : ndarray
        Array of k eigenvalues.
    v : ndarray
        An array of `k` eigenvectors.
        ``v[:, i]`` is the eigenvector corresponding to the eigenvalue w[i].

    Raises
    ------
    ArpackNoConvergence
        When the requested convergence is not obtained.
        The currently converged eigenvalues and eigenvectors can be found
        as ``eigenvalues`` and ``eigenvectors`` attributes of the exception
        object.

    See Also
    --------
    eigsh : eigenvalues and eigenvectors for symmetric matrix A
    svds : singular value decomposition for a matrix A

    Notes
    -----
    This function is a wrapper to the ARPACK [1]_ SNEUPD, DNEUPD, CNEUPD,
    ZNEUPD, functions which use the Implicitly Restarted Arnoldi Method to
    find the eigenvalues and eigenvectors [2]_.

    References
    ----------
    .. [1] ARPACK Software, https://github.com/opencollab/arpack-ng
    .. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang,  ARPACK USERS GUIDE:
       Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
       Arnoldi Methods. SIAM, Philadelphia, PA, 1998.

    Examples
    --------
    Find 6 eigenvectors of the identity matrix:

    >>> import numpy as np
    >>> from scipy.sparse.linalg import eigs
    >>> id = np.eye(13)
    >>> vals, vecs = eigs(id, k=6)
    >>> vals
    array([ 1.+0.j,  1.+0.j,  1.+0.j,  1.+0.j,  1.+0.j,  1.+0.j])
    >>> vecs.shape
    (13, 6)

    r   r   úexpected square matrix (shape=ú)Núwrong M dimensions ú, should be úZM does not have the same type precision as A. This may adversely affect ARPACK convergencer   ©Ú
stacklevelzk=z must be greater than 0.zOk >= N - 1 for N * N square matrix. Attempting to use scipy.linalg.eig instead.zhCannot use scipy.linalg.eig for sparse A with k >= N - 1. Use scipy.linalg.eig(A.toarray()) or reduce k.zACannot use scipy.linalg.eig for LinearOperator A with k >= N - 1.zACannot use scipy.linalg.eig for LinearOperator M with k >= N - 1.)r?  Úrightú0OPinv should not be specified with sigma = None.z=OPpart should not be specified with sigma = None or complex Aú+Minv should not be specified with M = None.Trb  z;OPpart should not be specified with sigma=None or complex Ar    Úrr"  z%OPpart cannot be 'i' if sigma is realr/   zOPpart must be one of ('r','i')z4Minv should not be specified when sigma isspecified.F)r   r)  r‰   rp   rY   Úcharr
  ÚwarningsÚwarnÚRuntimeWarningr   Ú	TypeErrorÚ
isinstancer   r   r   r¶   r`  r*  r+  r  rd  rÐ   rÑ   rö   r—   rè   r�   )r3   rQ   r.  r�   rg   r™   rn   rj   r`   rî   ÚMinvÚOPinvÚOPpartr˜   rl   r¶   rk   r¼   rµ   Úparamss                       rA   r   r   “  sk  € õ~ 	' qÑ)Ô)€AÝ& qÑ)Ô)€AØ„wˆq„z�Q”W˜Q”ZÒÐÝÐD¸!¼'ÐDÐDÐDÑEÔEÐEØ€}ØŒ7�a”gÒÐÝÐQ°1´7ÐQÐQÈÌÐQÐQÑRÔRÐRÝŒ8�A”GÑÔÔ!×'Ò'Ñ)Ô)­R¬X°a´gÑ->Ô->Ô-C×-IÒ-IÑ-KÔ-KÒKÐKÝŒMð Ià%&ð(ñ (ô (ð (ð 	
Œ�Œ
€AàˆA‚v€vÝÐ9˜aÐ9Ð9Ð9Ñ:Ô:Ð:àˆA�‰E‚z€zÝŒð Då$°ð	4ñ 	4ô 	4ð 	4õ �A‰;Œ;ð 	*Ýð )ñ *ô *ð *õ �a�Ñ(Ô(ð 	2Ýð 1ñ 2ô 2ð 2å�a�Ñ(Ô(ð 	2Ýð 1ñ 2ô 2ð 2õ �1˜Ð!4Ð5Ñ5Ô5Ð5à€}Ý! !Ñ$Ô$Ô+ˆàÐÝð 2ñ 3ô 3ð 3àÐÝð 9ñ :ô :ð :ð ˆ9àˆDØˆHØˆKØÐÝ ð "<ñ =ô =ð =ñ  ð
 ˆDØˆ|Ý,¨Q¸$ÀCÐHÑHÔH��å'¨Ñ-Ô-�Ø"œk�Ý'¨Ñ*Ô*Ô1ˆH‰Hõ Œ=˜œ¥"Ô"4Ñ5Ô5ð 	@ØÐ!Ý ð "@ñ Aô Að AàˆDˆDØˆ^˜vŸ|š|™~œ~°Ò4Ð4ØˆDˆDØ�\Š\‰^Œ^˜sÒ"Ð"ÝŒw�u‰~Œ~ Ò"Ð"Ý Ð!HÑIÔIÐIØˆDˆDåÐ>Ñ?Ô?Ð?å! !Ñ$Ô$Ô+ˆØÐÝð *ñ +ô +ð +àˆ=Ý*¨1¨a°Ø5:ÀðEñ Eô EˆKˆKõ % UÑ+Ô+ˆEØœ,ˆKØˆ9ØˆHˆHå'¨Ñ*Ô*Ô1ˆHå
Œ)×
Ò
 Ñ
$Ô
$€CÝ% a¨¨A¬G¬L¸&À$Ø&.°¸UØ&)¨2¨w¸¸sÀCñIô I€Fð Ôð Ø�ŠÑÔÐð Ôð ð �>Š>Ð-Ñ.Ô.Ð.rB   Únormalc                 ó¸  — t          j        | j        t           j        ¦  «        rx|dk    rt	          d|› d�¦  «        ‚|dk    rt	          d¦  «        ‚|dk    rd}n|dk    rd	}t          | |||||||||	|
|¬
¦  «        }|	r|d         j        |d         fS |j        S | j        d         | j        d         k    rt	          d| j        › d�¦  «        ‚|�§|j        | j        k    rt	          d|j        › d| j        › �¦  «        ‚t          j        |j        ¦  «        j         	                    ¦   «         t          j        | j        ¦  «        j         	                    ¦   «         k    rt          j        dd¬¦  «         | j        d         }|dk    rt	          d¦  «        ‚||k    r•t          j        dt          d¬¦  «         t          | ¦  «        rt          d¦  «        ‚t          | t           ¦  «        rt          d¦  «        ‚t          |t           ¦  «        rt          d¦  «        ‚t#          | ||	 ¬¦  «        S |€…t%          | ¦  «        } | j        }|�t	          d¦  «        ‚|€d}d}d}|
�t	          d¦  «        ‚�ned}|
€t)          |d|¬¦  «        }nt%          |
¦  «        }
|
j        }t%          |¦  «        j        }�n"|
�t	          d¦  «        ‚|dk    rMd }d}|€t+          | ||d|¬¦  «        }nt%          |¦  «        }|j        }|€d}nÕt%          |¦  «        }|j        }n¾|d!k    rDd"}|€t+          | ||d|¬¦  «        }nt%          |¦  «        j        }t%          | ¦  «        j        }d}nt|d#k    r[d$}t%          | ¦  «        j        }|€t+          | ||d|¬¦  «        }nt%          |¦  «        j        }|€d}n(t%          |¦  «        j        }nt	          d%|› d&�¦  «        ‚t           j                             |¦  «        }t1          ||| j        j        |||||||||||¦  «        }|j        s|                     ¦   «          |j        ¯|                     |	¦  «        S )'aÂ!  
    Find k eigenvalues and eigenvectors of the real symmetric square matrix
    or complex Hermitian matrix A.

    Solves ``A @ x[i] = w[i] * x[i]``, the standard eigenvalue problem for
    w[i] eigenvalues with corresponding eigenvectors x[i].

    If M is specified, solves ``A @ x[i] = w[i] * M @ x[i]``, the
    generalized eigenvalue problem for w[i] eigenvalues
    with corresponding eigenvectors x[i].

    Note that there is no specialized routine for the case when A is a complex
    Hermitian matrix. In this case, ``eigsh()`` will call ``eigs()`` and return
    the real parts of the eigenvalues thus obtained.

    Parameters
    ----------
    A : ndarray, sparse matrix or LinearOperator
        A square operator representing the operation ``A @ x``, where ``A`` is
        real symmetric or complex Hermitian. For buckling mode (see below)
        ``A`` must additionally be positive-definite.
    k : int, optional
        The number of eigenvalues and eigenvectors desired.
        `k` must be smaller than N. It is not possible to compute all
        eigenvectors of a matrix.

    Returns
    -------
    w : array
        Array of k eigenvalues.
    v : array
        An array representing the `k` eigenvectors.  The column ``v[:, i]`` is
        the eigenvector corresponding to the eigenvalue ``w[i]``.

    Other Parameters
    ----------------
    M : An N x N matrix, array, sparse matrix, or linear operator representing
        the operation ``M @ x`` for the generalized eigenvalue problem

            A @ x = w * M @ x.

        M must represent a real symmetric matrix if A is real, and must
        represent a complex Hermitian matrix if A is complex. For best
        results, the data type of M should be the same as that of A.
        Additionally:

            If sigma is None, M is symmetric positive definite.

            If sigma is specified, M is symmetric positive semi-definite.

            In buckling mode, M is symmetric indefinite.

        If sigma is None, eigsh requires an operator to compute the solution
        of the linear equation ``M @ x = b``. This is done internally via a
        (sparse) LU decomposition for an explicit matrix M, or via an
        iterative solver for a general linear operator.  Alternatively,
        the user can supply the matrix or operator Minv, which gives
        ``x = Minv @ b = M^-1 @ b``.
    sigma : real
        Find eigenvalues near sigma using shift-invert mode.  This requires
        an operator to compute the solution of the linear system
        ``[A - sigma * M] x = b``, where M is the identity matrix if
        unspecified.  This is computed internally via a (sparse) LU
        decomposition for explicit matrices A & M, or via an iterative
        solver if either A or M is a general linear operator.
        Alternatively, the user can supply the matrix or operator `OPinv`,
        which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
        Regardless of the selected mode (normal, cayley, or buckling),
        `OPinv` should always be supplied as ``OPinv = [A - sigma * M]^-1``.

        Note that when sigma is specified, the keyword 'which' refers to
        the shifted eigenvalues ``w'[i]`` where:

            if ``mode == 'normal'``: ``w'[i] = 1 / (w[i] - sigma)``.

            if ``mode == 'cayley'``:  ``w'[i] = (w[i] + sigma) / (w[i] - sigma)``.

            if ``mode == 'buckling'``: ``w'[i] = w[i] / (w[i] - sigma)``.

        (see further discussion in 'mode' below)
    v0 : ndarray, optional
        Starting vector for iteration.
        Default: random
    ncv : int, optional
        The number of Lanczos vectors generated ncv must be greater than k and
        smaller than n; it is recommended that ``ncv > 2*k``.
        Default: ``min(n, max(2*k + 1, 20))``
    which : str ['LM' | 'SM' | 'LA' | 'SA' | 'BE']
        If A is a complex Hermitian matrix, 'BE' is invalid.
        Which `k` eigenvectors and eigenvalues to find:

            'LM' : Largest (in magnitude) eigenvalues.

            'SM' : Smallest (in magnitude) eigenvalues.

            'LA' : Largest (algebraic) eigenvalues.

            'SA' : Smallest (algebraic) eigenvalues.

            'BE' : Half (k/2) from each end of the spectrum.

        When k is odd, return one more (k/2+1) from the high end.
        When sigma != None, 'which' refers to the shifted eigenvalues ``w'[i]``
        (see discussion in 'sigma', above).  ARPACK is generally better
        at finding large values than small values.  If small eigenvalues are
        desired, consider using shift-invert mode for better performance.
    maxiter : int, optional
        Maximum number of Arnoldi update iterations allowed.
        Default: ``n*10``
    tol : float
        Relative accuracy for eigenvalues (stopping criterion).
        The default value of 0 implies machine precision.
    Minv : N x N matrix, array, sparse matrix, or LinearOperator
        See notes in M, above.
    OPinv : N x N matrix, array, sparse matrix, or LinearOperator
        See notes in sigma, above.
    return_eigenvectors : bool
        Return eigenvectors (True) in addition to eigenvalues.
        This value determines the order in which eigenvalues are sorted.
        The sort order is also dependent on the `which` variable.

            For which = 'LM' or 'SA':
                If `return_eigenvectors` is True, eigenvalues are sorted by
                algebraic value.

                If `return_eigenvectors` is False, eigenvalues are sorted by
                absolute value.

            For which = 'BE' or 'LA':
                eigenvalues are always sorted by algebraic value.

            For which = 'SM':
                If `return_eigenvectors` is True, eigenvalues are sorted by
                algebraic value.

                If `return_eigenvectors` is False, eigenvalues are sorted by
                decreasing absolute value.

    mode : string ['normal' | 'buckling' | 'cayley']
        Specify strategy to use for shift-invert mode.  This argument applies
        only for real-valued A and sigma != None.  For shift-invert mode,
        ARPACK internally solves the eigenvalue problem
        ``OP @ x'[i] = w'[i] * B @ x'[i]``
        and transforms the resulting Ritz vectors x'[i] and Ritz values w'[i]
        into the desired eigenvectors and eigenvalues of the problem
        ``A @ x[i] = w[i] * M @ x[i]``.
        The modes are as follows:

            'normal' :
                OP = [A - sigma * M]^-1 @ M,
                B = M,
                w'[i] = 1 / (w[i] - sigma)

            'buckling' :
                OP = [A - sigma * M]^-1 @ A,
                B = A,
                w'[i] = w[i] / (w[i] - sigma)

            'cayley' :
                OP = [A - sigma * M]^-1 @ [A + sigma * M],
                B = M,
                w'[i] = (w[i] + sigma) / (w[i] - sigma)

        The choice of mode will affect which eigenvalues are selected by
        the keyword 'which', and can also impact the stability of
        convergence (see [2] for a discussion).
    rng : `numpy.random.Generator`, optional
        Pseudorandom number generator state. When `rng` is None, a new
        `numpy.random.Generator` is created using entropy from the
        operating system. Types other than `numpy.random.Generator` are
        passed to `numpy.random.default_rng` to instantiate a ``Generator``.

    Raises
    ------
    ArpackNoConvergence
        When the requested convergence is not obtained.

        The currently converged eigenvalues and eigenvectors can be found
        as ``eigenvalues`` and ``eigenvectors`` attributes of the exception
        object.

    See Also
    --------
    eigs : eigenvalues and eigenvectors for a general (nonsymmetric) matrix A
    svds : singular value decomposition for a matrix A

    Notes
    -----
    This function is a wrapper to the ARPACK [1]_ SSEUPD and DSEUPD
    functions which use the Implicitly Restarted Lanczos Method to
    find the eigenvalues and eigenvectors [2]_.

    References
    ----------
    .. [1] ARPACK Software, https://github.com/opencollab/arpack-ng
    .. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang,  ARPACK USERS GUIDE:
       Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
       Arnoldi Methods. SIAM, Philadelphia, PA, 1998.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.sparse.linalg import eigsh
    >>> identity = np.eye(13)
    >>> eigenvalues, eigenvectors = eigsh(identity, k=6)
    >>> eigenvalues
    array([1., 1., 1., 1., 1., 1.])
    >>> eigenvectors.shape
    (13, 6)

    r{  rÃ   z% cannot be used with complex matrix Ar*   z/which='BE' cannot be used with complex matrix Ar(   r+   r)   r,   )
r.  r�   rg   r™   rn   rj   r`   rî   rw  rx  r   r   rf  rg  Nrh  ri  rj  r   rk  zk must be greater than 0.zLk >= N for N * N square matrix. Attempting to use scipy.linalg.eigh instead.zfCannot use scipy.linalg.eigh for sparse A with k >= N. Use scipy.linalg.eigh(A.toarray()) or reduce k.z>Cannot use scipy.linalg.eigh for LinearOperator A with k >= N.z>Cannot use scipy.linalg.eigh for LinearOperator M with k >= N.)r?  Úeigvals_onlyrn  ro  Trb  z5Minv should not be specified when sigma is specified.r    Úbucklingr/   Úcayleyr   zunrecognized mode 'ú')rp   r*  rY   r+  r‰   r   rý   r)  rq  r
  rr  rs  rt  r   ru  rv  r   r   r   r¶   r`  rd  rÐ   rÑ   r¥   r—   rè   r�   )r3   rQ   r.  r�   rg   r™   rn   rj   r`   rî   rw  rx  rk   r˜   Úretrl   r¶   r¼   rµ   rz  s                       rA   r   r   š  s@  € õn 
„}�Q”W�bÔ0Ñ1Ô1ð Ø�8ÒÐÝÐP TÐPÐPÐPÑQÔQÐQØ�DŠ=ˆ=ÝÐNÑOÔOÐOØ�dŠ]ˆ]ØˆEˆEØ�dŠ]ˆ]ØˆEÝ�1�a˜1 E°¸2Ø G°Ø':ÀØð ñ  ô  ˆð
 ð 	Ø�q”6”;  A¤Ð&Ð&à”8ˆOà„wˆq„z�Q”W˜Q”ZÒÐÝÐD¸!¼'ÐDÐDÐDÑEÔEÐEØ€}ØŒ7�a”gÒÐÝÐQ°1´7ÐQÐQÈÌÐQÐQÑRÔRÐRÝŒ8�A”GÑÔÔ!×'Ò'Ñ)Ô)­R¬X°a´gÑ->Ô->Ô-C×-IÒ-IÑ-KÔ-KÒKÐKÝŒMð Ià%&ð(ñ (ô (ð (ð 	
Œ�Œ
€AàˆA‚v€vÝÐ4Ñ5Ô5Ð5àˆA‚v€vÝŒð Eå$°ð	4ñ 	4ô 	4ð 	4õ �A‰;Œ;ð 	*Ýð )ñ *ô *ð *õ �a�Ñ(Ô(ð 	.Ýð -ñ .ô .ð .å�a�Ñ(Ô(ð 	.Ýð -ñ .ô .ð .õ �A˜Ð-@Ð)@ÐAÑAÔAÐAà€}Ý˜QÑÔˆØ”ˆàÐÝÐOÑPÔPÐPØˆ9àˆDØˆHØˆKØÐÝ Ð!NÑOÔOÐOñ  ð ˆDØˆ|Ý,¨Q¸$ÀCÐHÑHÔH��å'¨Ñ-Ô-�Ø"œk�Ý'¨Ñ*Ô*Ô1ˆH‰Hð ÐÝð *ñ +ô +ð +ð �8ÒÐØˆDØˆFØˆ}Ý.¨q°!°UØ9=À3ðHñ Hô H��õ )¨Ñ/Ô/�Ø#œl�ØˆyØ��å$ QÑ'Ô'�Øœ8��ð �ZÒÐØˆDØˆ}Ý.¨q°!°UØ9=À3ðHñ Hô H��õ /¨uÑ5Ô5Ô<�Ý% aÑ(Ô(Ô/ˆFØˆHˆHð �XÒÐØˆDÝ% aÑ(Ô(Ô/ˆFØˆ}Ý.¨q°!°UØ9=À3ðHñ Hô H��õ /¨uÑ5Ô5Ô<�ØˆyØ��å+¨AÑ.Ô.Ô5��õ Ð:°4Ð:Ð:Ð:Ñ;Ô;Ð;Ý
Œ)×
Ò
 Ñ
$Ô
$€CÝ# A q¨!¬'¬,¸ÀØ$,¨k¸5Ø$'¨¨W°e¸SÀ#ñGô G€Fð Ôð Ø�ŠÑÔÐð Ôð ð �>Š>Ð-Ñ.Ô.Ð.rB   )F)Fr   )r0   NNr&   NNNr   TNNNN)r0   NNr&   NNNr   TNNr{  N)BrG   Únumpyrp   rr  Úscipy.sparse.linalg._interfacer   r   Úscipy.sparser   r   Úscipy.linalgr   r   r	   r
   Úscipy.sparse._sputilsr   r   r   Úscipy.sparse.linalgr   r   Ú r   Ú__docformat__Ú__all__rÔ   Ú_ndigitsÚDNAUPD_ERRORSÚSNAUPD_ERRORSrX   ÚZNAUPD_ERRORSÚCNAUPD_ERRORSÚDSAUPD_ERRORSÚSSAUPD_ERRORSÚDNEUPD_ERRORSÚSNEUPD_ERRORSÚZNEUPD_ERRORSÚCNEUPD_ERRORSÚDSEUPD_ERRORSÚSSEUPD_ERRORSrØ   r8   rÚ   r	  rÎ   r  r“   rí   ÚRuntimeErrorr   r   rR   rT   r¥   rö   r&  r6  rA  rC  rM  r]  r`  rd  r   r   rM   rB   rA   ú<module>r™     s:	  ððð ðJ Ð Ð Ð Ø €€€Ø KÐ KÐ KÐ KÐ KÐ KÐ KÐ KØ &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7ðð ð ð ð ð ð ð ð ð ð ,Ð +Ð +Ð +Ð +Ð +Ð +Ð +à Ð Ð Ð Ð Ð à%€à
AÐ
AÐ
A€ð ˜S s°Ð5Ð5€
Ø˜ !¨"Ð-Ð-€ðØ€~ðàð =ðð
 ð #ðð ð :ðð Ððð Ððð Ð3ðð ð 	%ðð ÐBðð  Ð)ð!ð" Ð?ð#ð$ Ð:ð%ð& Ð"ð'ð( Ð	%ð)ð* Ð	9ð+ð, Ð	-ð-ð. Ð	1ð/ð0 
ð Dð1ð €ð< €à×"Ò"Ñ$Ô$€Ø/€ˆcÑ à€ðØ€~ðàð 8ðð ð ð	ð ð +ðð Ððð Ððð ÐCðð ð 	%ðð Ð>ðð Ð)ðð  Ð?ð!ð" ð 	;ð#ð& Ð"ð'ð( Ð	'ð)ð* Ð	9ð+ð, Ð	-ð-ð. Ð	2ð/ð0 
ð Dð1ð €ð< €ðØ€~ðàð ðð Ððð Ððð Ð3ðð ÐAðð Ð)ðð Ð?ðð  ð 	;ð!ð$ ð 	:ð%ð( Ð	%ð)ð* Ð	9ð+ð, Ð	+ð-ð. Ð	<ð/ð0 ð 
ð1ð4 ð 
ð5€ðB ×"Ò"Ñ$Ô$€ð€ˆaÑ ð"€ˆcÑ ð(€ˆcÑ ð��Nð Øð ðð Ð*ðð Ð,ðð Ð@ðð ÐNðð Ð6ðð ÐLðð ð 3ðð" ð Gð#ð& Ð/ð'ð( ÐFð)ð* Ð8ð+ð, ÐIð-ð. ð "ð/ð2 ð 8ð3€ð@ ×"Ò"Ñ$Ô$€ð"€ˆcÑ ð(€ˆcÑ ðØ€~ðàÐðð Ððð ÐCð	ð
 Ð>ðð Ð)ðð Ð?ðð ð 
9ðð Ð"ðð Ð	'ðð Ð	9ðð Ð	1ðð Ð	Gðð Ð	<ðð  Ð	+ð!ð" ð ð#€ð0 ×"Ò"Ñ$Ô$€ð0€ˆcÑ ð €ˆcÑ ð $Ø#ð%ð %€à#Ø#Ø#Ø#ð%ð %€ð $Ø#ð%ð %€à#Ø#Ø#Ø#ð%ð %€ð .Ð-Ð-€ð 4Ð3Ð3€ð �1˜A Q¨a°qÀÈÐRSðð €
ð
 ˜A AÐ&Ð&€ð
8ð 
8ð 
8ð 
8ð 
8�,ñ 
8ô 
8ð 
8ð)ð )ð )ð )ð )˜+ñ )ô )ð )ð&ð ð ðh+ð h+ð h+ð h+ð h+ñ h+ô h+ð h+ðVdð dð dð dð d˜]ñ dô dð dðN@ð @ð @ð @ð @˜}ñ @ô @ð @ðD
9ð 9ð 9ð 9ð 9ˆnñ 9ô 9ð 9ð0&ð &ð &ð &ð &ˆNñ &ô &ð &ð 7ð 7ð 7ðð ð ð ð ˆnñ ô ð ðB1ð 1ð 1ð 1ð 1�ñ 1ô 1ð 1ðh	ð 	ð 	ð 	ð*ð *ð *ð *ð &ð  &ð  &ð  &ðF 59Ø<@Ø15ðD/ð D/ð D/ð D/ðN 6:Ø=AØ48ð[/ð [/ð [/ð [/ð [/ð [/rB   