ó
    Eñiþ ã            
       ó  • S r SSKrSSKrSSKJrJr  SSKJrJ	r	  SSK
JrJrJrJr  SSKJrJrJr  SSKJrJr  SS	KJr  S
r/ SQrSSSSS.rSSSSS.r0 SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S&_S'S(_S)S*_S+S,_S-S._S/S0_S1S2_S3S40Er\r\R=                  5       rS5\S+'   \r 0 SS_SS6_SS_SS_SS_SS_SS7_SS _S!S8_S#S$_S%S&_S'S9_S)S*_S+S:_S-S._S/S0_S1S;_S3S40Er!\!r"0 SS_SS<_SS_SS_SS_S!S=_S#S$_S%S>_S'S?_S)S@_S+S,_S-S._S/SA_S1SB_SCSD_SESF_r#\#R=                  5       r$SG\$S'   SH\$SC'   SI\$SE'   0 SS_SSJ_SS_SS_SSK_S!S=_S#S$_S%S>_S'SL_S)SM_S+SN_S-S._S/SA_S1SB_SCSO_SESP_r%\%R=                  5       r&SQ\&SC'   SR\&SE'   0 SS_SS_SS_SS7_S!S8_S#S$_S%S>_S'SS_S)S*_S+S:_S-S._S/S2_SCST_SESU_SVSA_SWSX_r'\'R=                  5       r(SY\(SC'   SZ\(SW'   \!\"S[.r)\\\\ S\.r*\'\(S[.r+\#\$\%\&S\.r,/ S]Qr-/ S^Qr.SSSSS_SS`SaSbSc.	r/SSSSd.r0 " Se Sf\15      r2 " Sg Sh\25      r3Si r4 " Sj Sk5      r5 " Sl Sm\55      r6 " Sn So\55      r7 " Sp Sq\5      r8 " Sr Ss\5      r9St r: " Su Sv\5      r; " Sw Sx\5      r<S~Sy jr=SSz jr>SS{ jr?   S€S| jr@   S�S} jrAg)‚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                   ó0   ^ • \ rS rSrSrSU 4S jjrSrU =r$ )r   i  z
ARPACK error
c                 óf   >• Uc  [         nUR                  US5      n[        TU ]  SU SU 35        g )NzUnknown errorzARPACK error z: )Ú_NAUPD_ERRORSÚgetÚsuperÚ__init__)ÚselfÚinfoÚinfodictÚmsgÚ	__class__s       €Úe/home/mande/repo/quber/.venv/lib/python3.13/site-packages/scipy/sparse/linalg/_eigen/arpack/arpack.pyr;   ÚArpackError.__init__  s8   ø€ ØÑÜ$ˆHà�l‰l˜4 Ó1ˆÜ‰Ñ˜=¨¨¨b°°Ð6Õ7ó    © ©N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r;   Ú__static_attributes__Ú__classcell__)r@   s   @rA   r   r     s   ø† ñ÷8õ 8rC   r   c                   ó   • \ rS rSrSrS rSrg)r   i%  z¿
ARPACK iteration did not converge

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

c                 óN   • [         R                  U SSU05        X l        X0l        g )Nr!   )r   r;   ÚeigenvaluesÚeigenvectors)r<   r?   rO   rP   s       rA   r;   ÚArpackNoConvergence.__init__2  s$   € Ü×Ñ˜T 2¨¨C yÔ1Ø&ÔØ(ÕrC   )rO   rP   N)rF   rG   rH   rI   rJ   r;   rK   rD   rC   rA   r   r   %  s   † ñ
õ)rC   r   c                 ó&   • [        SU -  S-   S5      $ )zm
Choose number of lanczos vectors based on target number
of singular/eigen values and vectors to compute, k.
r   r   é   )Úmax)Úks    rA   Ú
choose_ncvrV   8  s   € ô
 ˆq�1‰u�q‰y˜"ÓÐrC   c                   ó(   • \ rS rSr  SS jrS rSrg)Ú_ArpackParamsi@  Nc           
      ó`  • US::  a  [        SU 35      eU	c  US-  n	U	S::  a  [        SU	 35      eUS;  a*  [        R                  " US5      (       a  SnO[        S5      eUb  [        R                  " USUS	9U l        S
nO(UR                  SSU/S9R                  U5      U l        SnUc  SU l        OX`l        Uc  [        U5      n[        Xq5      U l
        Xl        [        R                  " X4U5      U l        X l        XPl        0 SU_SS_SS_SS_SS_SS_SS_S[         U
   _SS_SU_SS_S[#        U	5      _SU_SU_SS_SU R                  _SU_0 S S_S!S
_S"S_S#S_S$S_S%S_S&S_S'S_S(S_S)S_S*S_S+S_S,S_S-S_S.S_S/S_S0S_ESSSSSSSSS1.EU l        X l        X0l        S2U l        g )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)Ú
ValueErrorrt   Úcan_castÚarrayÚresidÚuniformÚastypeÚsigmarV   Úminrr   rp   ÚzerosÚvrk   ro   Ú
WHICH_DICTÚintÚarpack_dictrU   ÚtpÚ	converged)r<   rp   rU   rš   Úrngro   r“   rr   Úv0rn   rk   rd   r=   s                rA   r;   Ú_ArpackParams.__init__A  së  € à�‹6ÜÐ5°a°SÐ9Ó:Ð:à‰?Ø˜"‘fˆGØ�a‹<ÜÐAÀ'ÀÐKÓLÐLà�VÓä�{Š{˜2˜s×#Ñ#Ø‘ä Ð!LÓMÐMà‰>äŸš "¨4°rÑ:ˆDŒJØ‰Dð Ÿ™¨°C¸q¸c˜ÐB×IÑIÈ"ÓMˆDŒJØˆDà‰=àˆD�JàŒJà‰;Ü˜Q“-ˆCÜ�s“;ˆŒØŒÜ—’˜1˜( BÓ'ˆŒØŒ
ð Œ	ð+
Ø�3ð+
à˜Cð+
ð ˜#ð+
ð ˜3ð	+
ð
 ˜#ð+
ð ˜#ð+
ð �1ð+
ð ”Z Ñ&ð+
ð �Að+
ð �Dð+
ð �Að+
ð ”s˜7“|ð+
ð �Dð+
ð �ð+
ð �Qð+
ð  �4—8‘8ð!+
ð" �1ñ#+
ð$ �!ð%+
ð& �Qð'+
ð( ˜1ð)+
ð* ˜!ð++
ð, ˜!ð-+
ð. ˜!ð/+
ð0 ˜ð1+
ð2 �að3+
ð4 ˜!ð5+
ð6 ˜!ð7+
ð8 ˜Að9+
ð: ˜!ð;+
ð< ˜!ð=+
ð> ˜ð?+
ð@ ˜!ðA+
ðB ˜ðC+
ðD ˜!ñE+
ðF ØØØØØØØòU+
ˆÔðZ ŒØŒØˆ�rC   c           	      ó\  • SnU R                   S   nU R                   S   n U R                  S5      u  pE[        S	U S
U SU R                   S3XE5      e! [         aL  nU SU S3n[        R                  " S5      n[        R                  " U R
                  S45      nSn S nANqS nAff = f)Nz<No convergence (%d iterations, %d/%d eigenvectors converged)rq   rm   Tz [Ú])r   r   zNo convergence (z iterations, Ú/z eigenvectors converged))r™   Úextractr   rt   r•   rp   r   rU   )r<   r?   Úk_okÚnum_iterÚevÚvecÚerrs          rA   Ú_raise_no_convergenceÚ#_ArpackParams._raise_no_convergence›  s»   € ØLˆØ×Ñ Ñ(ˆØ×#Ñ# FÑ+ˆð	Ø—l‘l 4Ó(‰GˆBô "Ð$4°X°J¸mØ%) F¨!¨D¯F©F¨8Ð3Kð#Mà"$ó+ð 	+øô ó 	Ø�E˜˜C˜5 Ð"ˆCÜ—’˜$“ˆBÜ—(’(˜DŸF™F A˜;Ó'ˆCØ�Dûð		ús   ¢A Á
B+ÁAB&Â&B+)r™   r›   rU   ro   rp   rr   r�   r“   rš   r–   rk   )r   NNNNr&   r   )rF   rG   rH   rI   r;   r¨   rK   rD   rC   rA   rX   rX   @  s   † ØGKØ/0ôXõt+rC   rX   c                   ó0   • \ rS rSr   SS jrS rS rSrg)Ú_SymmetricArpackParamsi«  Nc                 ó‚  ^ ^^^^• US:X  aB  Tc  [        S5      eTb  [        S5      eTb  [        S5      eTT l        S T l        ST l        GO�US:X  aT  Tc  [        S5      eTc  [        S	5      eTc  [        S
5      eUU4S jT l        TT l        TT l        TT l        ST l        GO3US:X  a_  Tb  [        S5      eTc  [        S5      eTc  TT l        TT l        S T l        ST l        OðUU4S jT l        TT l        TT l        ST l        OÎUS:X  aL  Tc  [        S5      eTb  [        S5      eTc  [        S5      eTT l        UU 4S jT l        TT l        ST l        O|US:X  ag  Tc  [        S5      eTc  [        S5      eTT l        TT l        Tc  UUU4S jT l        S T l        ST l        O,UUUU4S jT l        TT l        ST l        O[        SU S35      eU[        ;  a!  [        SS R                  [        5       35      eX!:¼  a  [        S!U 35      e[        R                  R                  U5      T l        [        R                  T XUT R                  UTXšX¼U5        T R                  S:X  a  S"OST R                  S#'   T R                   U:”  d  T R                   U::  a  [        S$T R                    35      e[        R"                  " SU-  T R$                  S%9T l        [        R"                  " T R                   T R                   S&-   -  T R$                  S%9T l        [*        T R$                     nUS';  a  [        S(5      e[,        R.                  US)-      T l        [,        R.                  US*-      T l        [4        U   T l        [8        U   T l        [        R"                  " S+[        R<                  S%9T l        g ),Nr   ú#matvec must be specified for mode=1ú'M_matvec cannot be specified for mode=1ú*Minv_matvec cannot be specified for mode=1c                 ó   • U $ rE   rD   ©Úxs    rA   Ú<lambda>Ú1_SymmetricArpackParams.__init__.<locals>.<lambda>ë  ó   € ™qrC   ÚIr   ú#matvec must be specified for mode=2ú%M_matvec must be specified for mode=2ú(Minv_matvec must be specified for mode=2c                 ó    >• T" T" U 5      5      $ rE   rD   ©r²   ÚMinv_matvecÚmatvecs    €€rA   r³   r´   õ  ó   ø€ ¡©F°1«IÔ 6rC   ÚGr    z'matvec must not be specified for mode=3z(Minv_matvec must be specified for mode=3c                 ó   • U $ rE   rD   r±   s    rA   r³   r´     ó   € ¡1rC   c                 ó    >• T" T" U 5      5      $ rE   rD   )r²   ÚM_matvecr¼   s    €€rA   r³   r´     s   ø€ ¡K±¸³Ô$<rC   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                 ó2   >• TR                  T" U 5      5      $ rE   ©ÚOPa)r²   r½   r<   s    €€rA   r³   r´     s   ø€  §¡©°«Ô 3rC   r   z#matvec must be specified for mode=5z(Minv_matvec must be specified for mode=5c                 ó,   >• T" T" U 5      TU -  -   5      $ rE   rD   )r²   r¼   r½   r“   s    €€€rA   r³   r´     s   ø€ ¡K±°q³	¸EÀA¹IÑ0EÔ$FrC   c                 ó   • U $ rE   rD   r±   s    rA   r³   r´      rÁ   rC   c                 ó8   >• T" T" U 5      TT" U 5      -  -   5      $ rE   rD   )r²   rÃ   r¼   r½   r“   s    €€€€rA   r³   r´   #  s#   ø€ ¡K±°q³	Ø27¹(À1»+Ñ2Eñ1Fô %GrC   úmode=ú not implementedzwhich must be one of Ú zk must be less than ndim(A), k=r   rl   zncv must be k<ncv<=n, ncv=©r]   r2   )r   r   z Input matrix is not real-valued.Ú
saupd_wrapÚ
seupd_wrapé   ) r�   ÚOPÚBrl   rÆ   ÚOPbÚA_matvecÚ_SEUPD_WHICHÚjoinrt   ÚrandomÚdefault_rngrœ   rX   r;   r™   rr   r•   rš   ÚworkdÚworklÚ
_type_convr   Ú__dict__Ú_arpack_solverÚ_arpack_extractÚ_SAUPD_ERRORSÚiterate_infodictÚ_SEUPD_ERRORSÚextract_infodictÚint32Úipntr©r<   rp   rU   rš   r½   ro   rÃ   r¼   r“   rr   r�   rn   rk   rd   rœ   Últrs   `   ` ```       rA   r;   Ú_SymmetricArpackParams.__init__¬  s}  ü€ ðl �1‹9Ø‰~Ü Ð!FÓGÐGØÑ#Ü Ð!JÓKÐKØÑ&Ü Ð!MÓNÐNàˆDŒGÙ ˆDŒFØˆDŽIØ�Q‹YØ‰~Ü Ð!FÓGÐGØÑÜ Ð!HÓIÐIØÑ"Ü Ð!KÓLÐLå6ˆDŒGØ"ˆDŒHØˆDŒHØˆDŒFØˆDŽIØ�Q‹YØÑ!Ü Ð!JÓKÐKØÑ"Ü Ð!KÓLÐLàÑØ%�”Ø&�”Ù$�”Ø�•	å<�”Ø&�”Ø!�”Ø�•	Ø�Q‹YØ‰~Ü Ð!FÓGÐGØÑ#Ü Ð!LÓMÐMØÑ"Ü Ð!KÓLÐLØ"ˆDŒHÝ3ˆDŒGØˆDŒFØˆD�IØ�Q‹YØ‰~Ü Ð!FÓGÐGØÑ"Ü Ð!KÓLÐLà"ˆDŒHØ"ˆDŒMàÑÞF�”Ù$�”Ø�•	÷G�”à!�”Ø�•	ä˜u T FÐ*:Ð;Ó<Ð<àœÓ$ÜÐ4°S·X±X¼lÓ5KÐ4LÐMÓNÐNØ‹6ÜÐ>¸q¸cÐBÓCÐCä—9‘9×(Ñ(¨Ó-ˆŒÜ×Ñ˜t Q¨2¨t¯x©x¸¸uÀcØ&¨sô	4ð )-¯	©	°SÓ(8¡1¸aˆ×Ñ˜Ñ à�8‰8�a‹<˜4Ÿ8™8 q›=ÜÐ9¸$¿(¹(¸ÐDÓEÐEä—X’X˜a !™e¨4¯7©7Ñ3ˆŒ
Ü—X’X˜dŸh™h¨$¯(©(°Q©,Ñ7¸t¿w¹wÑGˆŒ
ä˜Ÿ™Ñ!ˆØ�jÓ ÜÐ?Ó@Ð@ä(×1Ñ1°#¸Ñ2DÑEˆÔÜ)×2Ñ2°3¸Ñ3EÑFˆÔä -¨cÑ 2ˆÔÜ -¨cÑ 2ˆÔä—X’X˜b¬¯©Ñ1ˆ�
rC   c                 óŽ  • U R                  U R                  U R                  U R                  U R                  U R
                  U R                  5        [        U R                  S   U R                  S   U R                  -   5      n[        U R                  S   U R                  S   U R                  -   5      nU R                  S   S:X  Gaž  U R                  S:X  a,  U R                  U R
                  U   5      U R
                  U'   g U R                  S:X  aW  U R                  U R
                  U   5      U R
                  U'   U R                  U R
                  U   5      U R
                  U'   g U R                  S:X  aŒ  [        U R                  S   U R                  S   U R                  -   5      nU R                  U R
                  U   5      nU R                  X@R                  U R
                  U   -  -   5      U R
                  U'   g [        U R                  S   U R                  S   U R                  -   5      nU R                  U R
                  U   5      U R
                  U'   g U R                  S   S:X  a,  U R                  U R
                  U   5      U R
                  U'   g U R                  S   S:X  a  [!        S5      eU R                  S   S:X  aM  U R"                  R%                  S	S
U R                  /S9R'                  U R(                  5      U R                  S S & g U R                  S   S:X  a,  U R                  U R
                  U   5      U R
                  U'   g SU l        U R                  S   S:X  a  g U R                  S   S:X  a  U R-                  5         g [/        U R                  S   U R0                  S9e)Nr   r   rj   r   r   r    ú.ARPACK requested user shifts. Assure ISHIFT==0r/   r^   r_   r`   Tr=   ©r>   )rÝ   r™   r�   r–   rä   rÙ   rÚ   Úslicerp   ro   rÑ   rÓ   rÆ   rÔ   r“   rÒ   r�   rœ   r‘   r’   rš   r›   r¨   r   rà   )r<   ÚxsliceÚysliceÚBxsliceÚAxs        rA   ÚiterateÚ_SymmetricArpackParams.iterateG  s  € Ø×Ñ˜D×,Ñ,¨d¯j©j¸$¿&¹&À$Ç*Á*Ø ŸJ™J¨¯
©
ô	4ô �t—z‘z !‘} d§j¡j°¡m°d·f±fÑ&<Ó=ˆÜ�t—z‘z !‘} d§j¡j°¡m°d·f±fÑ&<Ó=ˆØ×Ñ˜EÑ" aÔ'à�y‰y˜A‹~Ø%)§W¡W¨T¯Z©Z¸Ñ-?Ó%@�—
‘
˜6Ò"Ø—‘˜a“Ø%)§X¡X¨d¯j©j¸Ñ.@Ó%A�—
‘
˜6Ñ"Ø%)§X¡X¨d¯j©j¸Ñ.@Ó%A�—
‘
˜6Ò"Ø—‘˜a“Ü §
¡
¨1¡¨t¯z©z¸!©}¸t¿v¹vÑ/EÓF�Ø—]‘] 4§:¡:¨fÑ#5Ó6�Ø%)§X¡X¨b·J±JØ48·J±J¸wÑ4Gñ5Hñ /Ió &J�—
‘
˜6Ò"ô   §
¡
¨1¡¨t¯z©z¸!©}¸t¿v¹vÑ/EÓF�Ø%)§X¡X¨d¯j©j¸Ñ.AÓ%B�—
‘
˜6Ò"à×Ñ˜eÑ$¨Ó)Ø!%§¡¨¯
©
°6Ñ(:Ó!;ˆD�J‰J�vÒà×Ñ˜eÑ$¨Ó)ÜÐMÓNÐNà×Ñ˜eÑ$¨Ó)à ŸH™H×,Ñ,°¸CØ37·6±6°(ð -ð <ß<B¹FÀ4Ç7Á7»Oð �J‰J‘q‰Mð ×Ñ˜eÑ$¨Ó)Ø!%§¡¨¯©°FÑ);Ó!<ˆD�J‰J�vÒð "ˆDŒNà×Ñ Ñ'¨1Ó,ØØ×!Ñ! &Ñ)¨QÓ.Ø×*Ñ*Õ,ä! $×"2Ñ"2°6Ñ":Ø+/×+@Ñ+@ñBð BrC   c                 óÐ  • UnSnSU R                   S'   [        S   n[        R                  " U R                  [        R
                  S9n[        R                  " U R                  U R                  S9n[        R                  " U R                  U R                  4U R                  SS9nU R                  U R                   X$XVXpR                  U R                  U R                  U R                  U R                  U R                  5        U R                   S   nUS:w  a  [!        X0R"                  S9eU R                   S   nUS U nU(       a  US S 2S U24   R%                  S	S
9nXg4$ U$ )Nr   r=   r3   rÍ   r   ©r]   Úorderrê   rq   ÚC)rô   )r™   ÚHOWMNY_DICTrt   r•   rr   rã   rU   rš   rp   rÞ   r“   r�   r–   rä   rÙ   rÚ   r   râ   r\   )	r<   Úreturn_eigenvectorsÚrvecÚierrÚhowmnyÚsselectr   r   r£   s	            rA   r¢   Ú_SymmetricArpackParams.extractv  s-  € Ø"ˆØˆØ#$ˆ×Ñ˜Ñ Ü˜SÑ!ˆÜ—(’(˜4Ÿ8™8¬2¯8©8Ñ4ˆÜ�HŠH�T—V‘V 4§7¡7Ñ+ˆÜ�HŠH�d—f‘f˜dŸh™hÐ'¨t¯w©w¸cÑBˆà×ÑØ×Ñ˜d¨G¸¿:¹:Ø�J‰J˜Ÿ™ §
¡
¨D¯J©JØ�J‰Jô	
ð ×Ñ Ñ'ˆØ�1‹9Ü˜d×-BÑ-BÑCÐCØ×Ñ Ñ(ˆØˆeˆtˆHˆæØ’!�U�d�U�(‘× Ñ  sÐ Ð+ˆAØ�4ˆKàˆHrC   )rÔ   rÒ   rÑ   rÆ   rÓ   rÞ   rÝ   rl   r›   râ   rä   rà   rœ   rÙ   rÚ   ©
r   NNNNNNr&   r   N©rF   rG   rH   rI   r;   rð   r¢   rK   rD   rC   rA   r«   r«   «  s   † ØLPØNOØôY2òv-Bõ^rC   r«   c                   ó0   • \ rS rSr   SS jrS rS rSrg)Ú_UnsymmetricArpackParamsi’  Nc                 óþ  ^ ^^^• US:X  aB  Tc  [        S5      eTb  [        S5      eTb  [        S5      eTT l        S T l        ST l        GOUS:X  aS  Tc  [        S5      eTc  [        S	5      eTc  [        S
5      eUU4S jT l        TT l        TT l        TT l        ST l        O³US;   až  Tc  [        S5      eTc  [        S5      eTT l        US;   a  US:X  a  TT l        O([        S5      eUS:X  a  U4S jT l        OU4S jT l        Tc!  S T l        ST l        T R                  T l        O*TT l        ST l        UU 4S jT l        O[        SU S35      eU[        ;  a!  [        SSR                  [        5       35      eX!S-
  :¼  a  [        SU 35      e[        R                  R                  U5      T l        [        R                  T XX>XXXšUXÍ5        T R                  S:X  a  SOST R                  S'   T R                   U:”  d  T R                   US-   ::  a  [        ST R                    35      e[        R"                  " SU-  T R$                  S9T l        [        R"                  " ST R                   -  T R                   S-   -  T R$                  S9T l        [*        T R$                     n[,        R.                  US -      T l        [,        R.                  US!-      T l        [4        U   T l        [8        U   T l        [        R"                  " S"[        R<                  S9T l        T R$                  S#;   a=  [        R"                  " T R                   T R$                  RA                  5       S9T l!        g S T l!        g )$Nr   r­   r®   r¯   c                 ó   • U $ rE   rD   r±   s    rA   r³   Ú3_UnsymmetricArpackParams.__init__.<locals>.<lambda>Á  rµ   rC   r¶   r   r·   r¸   r¹   c                 ó    >• T" T" U 5      5      $ rE   rD   r»   s    €€rA   r³   r  Ë  r¾   rC   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                 ó<   >• [         R                  " T" U 5      5      $ rE   )rt   Úreal©r²   r¼   s    €rA   r³   r  à  ó   ø€ ¬¯ª±¸Q³Ô)@rC   c                 ó<   >• [         R                  " T" U 5      5      $ rE   )rt   Úimagr	  s    €rA   r³   r  â  r
  rC   c                 ó   • U $ rE   rD   r±   s    rA   r³   r  ä  rÁ   rC   c                 ó2   >• TR                  T" U 5      5      $ rE   rÅ   )r²   rÃ   r<   s    €€rA   r³   r  ê  s   ø€  D§H¡H©X°a«[Ô$9rC   rÊ   rË   zParameter which must be one of rÌ   z!k must be less than ndim(A)-1, k=r   rl   zncv must be k+1<ncv<=n, ncv=rÍ   Ú
naupd_wrapÚ
neupd_wrapé   ÚFD)"r�   rÑ   rÒ   rl   rÆ   rÓ   r½   Ú_NEUPD_WHICHrÖ   rt   r×   rØ   rœ   rX   r;   r™   rr   r•   rš   rÙ   rÚ   rÛ   r   rÜ   rÝ   rÞ   r8   rà   Ú_NEUPD_ERRORSrâ   rã   rä   ÚlowerÚrworkrå   s   `   ` ``        rA   r;   Ú!_UnsymmetricArpackParams.__init__“  s&  û€ ðJ �1‹9Ø‰~Ü Ð!FÓGÐGØÑ#Ü Ð!JÓKÐKØÑ&Ü Ð!MÓNÐNàˆDŒGÙ ˆDŒFØˆDŽIØ�Q‹YØ‰~Ü Ð!FÓGÐGØÑÜ Ð!HÓIÐIØÑ"Ü Ð!KÓLÐLå6ˆDŒGØ"ˆDŒHØˆDŒHØˆDŒFØˆD�IØ�V‹^Ø‰~Ü ð "5ó 6ð 6àÑ"Ü ð "5ó 6ð 6ð !ˆDŒKØ�T‹zØ˜1“9Ø*�D•Hä$Ð%CÓDÐDà˜1“9Ü@�D•Hä@�D”HØÑÙ$�”Ø�”	ØŸ(™(�•à!�”Ø�”	Ý9�•ä˜u T FÐ*:Ð;Ó<Ð<àœÓ$Üð !Ø!$§¡¬,Ó!7Ð 8ð:ó ;ð ;à�A‘‹:ÜÐ@ÀÀÐDÓEÐEä—9‘9×(Ñ(¨Ó-ˆŒÜ×Ñ˜t Q¨2°DÀÈ'Ø$ô	+ð )-¯	©	°SÓ(8¡1¸aˆ×Ñ˜Ñ à�8‰8�a‹<˜4Ÿ8™8 q¨1¡uÓ,ÜÐ;¸D¿H¹H¸:ÐFÓGÐGä—X’X˜a !™e¨4¯7©7Ñ3ˆŒ
Ü—X’X˜a $§(¡(™l¨d¯h©h¸©lÑ;À4Ç7Á7ÑKˆŒ
ä˜Ÿ™Ñ!ˆÜ(×1Ñ1°#¸Ñ2DÑEˆÔÜ)×2Ñ2°3¸Ñ3EÑFˆÔä -¨cÑ 2ˆÔÜ -¨cÑ 2ˆÔä—X’X˜b¬¯©Ñ1ˆŒ
à�7‰7�d‹?ÜŸš $§(¡(°$·'±'·-±-³/ÑBˆD�JàˆD�JrC   c           	      ót  • U R                   S;   aS  U R                  U R                  U R                  U R                  U R
                  U R                  U R                  5        O]U R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  5        [        U R
                  S   U R
                  S   U R                  -   5      n[        U R
                  S   U R
                  S   U R                  -   5      nU R                  S   S:X  a›  U R                  S;   a,  U R                  U R                  U   5      U R                  U'   g [        U R
                  S   U R
                  S   U R                  -   5      nU R                  U R                  U   5      U R                  U'   g U R                  S   S:X  a,  U R                  U R                  U   5      U R                  U'   g U R                  S   S:X  a  [        S5      eU R                  S   S	:X  aÖ  U R                   S;   aM  U R                   R#                  S
SU R                  /S9R%                  U R                   5      U R                  S S & g U R                   R#                  S
SU R                  S/S9R'                  [(        R*                  5      R%                  U R                   5      R-                  5       U R                  S S & g U R                  S   S:X  a,  U R                  U R                  U   5      U R                  U'   g SU l        U R                  S   S:X  a  g U R                  S   S:X  a  U R1                  5         g [3        U R                  S   U R4                  S9e)NÚfdr   r   rj   ©r   r   r   r    ré   r/   r^   r_   r`   r   Tr=   )r=   r>   )rš   rÝ   r™   r�   r–   rä   rÙ   rÚ   r  rë   rp   ro   rÑ   rÆ   rÒ   r�   rœ   r‘   r’   Úviewrt   Ú
complex128Úravelr›   r¨   r   rà   )r<   rì   rí   rî   s       rA   rð   Ú _UnsymmetricArpackParams.iterate  së  € Ø�7‰7�d‹?Ø×ÑØ× Ñ  $§*¡*¨d¯f©f°d·j±jÀ$Ç*Á*Ø—
‘
õð ×ÑØ× Ñ  $§*¡*¨d¯f©f°d·j±jÀ$Ç*Á*Ø—
‘
˜DŸJ™Jôô
 �t—z‘z !‘} d§j¡j°¡m°d·f±fÑ&<Ó=ˆÜ�t—z‘z !‘} d§j¡j°¡m°d·f±fÑ&<Ó=ˆà×Ñ˜EÑ" aÓ'à�y‰y˜FÓ"Ø%)§W¡W¨T¯Z©Z¸Ñ-?Ó%@�—
‘
˜6Ò"ä §
¡
¨1¡¨t¯z©z¸!©}¸t¿v¹vÑ/EÓF�Ø%)§X¡X¨d¯j©j¸Ñ.AÓ%B�—
‘
˜6Ò"à×Ñ˜eÑ$¨Ó)Ø!%§¡¨¯
©
°6Ñ(:Ó!;ˆD�J‰J�vÒà×Ñ˜eÑ$¨Ó)ÜÐMÓNÐNà×Ñ˜eÑ$¨Ó)Ø�w‰w˜$‹à $§¡× 0Ñ 0°TÀØ7;·v±v°hð !1ð !@ß@FÁÀtÇwÁwÃð —
‘
™1‘ð !%§¡× 0Ñ 0°TÀÈ4Ï6É6ÐSTÈ+Ð 0ð !ß‘$”r—}‘}Ó%§f¡f¨T¯W©W£o·e±e³gð —
‘
™1‘ð ×Ñ˜eÑ$¨Ó)Ø!%§¡¨¯©°FÑ);Ó!<ˆD�J‰J�vÒð "ˆDŒNà×Ñ Ñ'¨1Ó,ØØ×!Ñ! &Ñ)¨QÓ.Ø×*Ñ*Õ,ä! t×'7Ñ'7¸Ñ'?Ø+/×+@Ñ+@ñBð BrC   c                 óì  • U R                   U R                  p2SnSU R                  S'   [        S   n[        R
                  " U R                  [        R                  S9n[        [        R                  " U R                  5      5      n[        [        R                  " U R                  5      5      n[        R
                  " SU R                  -  U R                  5      n	U R                  S;   Ga‡  [        R
                  " US-   /U R                  S9n
[        R
                  " US-   /U R                  S9n[        R
                  " X2S-   /U R                  SS	9nU R                  U R                  XXjUXÇX‰U R                  U R                  U R                   U R"                  U R$                  5        U R                  S   nUS:w  a  ['        X@R(                  S
9eU R                  S   nU
SU-  -   nUR+                  U R                  R-                  5       5      nUS:X  a…  SnUU::  a{  [/        UU   R                  5      S:w  aR  UU:  aG  US S 2U4   SUS S 2US-   4   -  -   US S 2U4'   US S 2U4   R1                  5       US S 2US-   4'   US-  nOUS-  nUS-  nUU::  a  M{  GO½SnUU::  Ga´  [/        UU   R                  5      S:X  a9  [        R2                  " US S 2U4   U R5                  US S 2U4   5      5      UU'   GOQUU:  GaE  US S 2U4   SUS S 2US-   4   -  -   US S 2U4'   US S 2U4   R1                  5       US S 2US-   4'   [        R2                  " US S 2U4   U R5                  US S 2U4   5      5      [        R2                  " US S 2US-   4   U R5                  US S 2US-   4   5      5      -   S[        R2                  " US S 2U4   U R5                  US S 2US-   4   5      5      [        R2                  " US S 2US-   4   U R5                  US S 2U4   5      5      -
  -  -   UU'   UU   R7                  5       UUS-   '   US-  nOUS-  nUS-  nUU::  a  GM´  XÒ::  a  US U nUS S 2S U24   nGOòU R8                  S;   a  UnO!U R8                  S;   a  SXàR                  -
  -  nU R:                  S;   a!  [        R<                  " WR                  5      nOYU R:                  S;   a*  [        R<                  " [/        WR                  5      5      nO[        R<                  " [/        W5      5      nU R:                  S;   a  UU* S  S S S2   nOU R:                  S;   a  US U nUU   nUS S 2U4   nOó[        R
                  " U/U R                  S9n[        R
                  " X2/U R                  SS	9nU R                  U R                  XXnUU R                  X�R                  U R                  U R                   U R"                  U R$                  U R>                  5        U R                  S   nUS:w  a  ['        X@R(                  S
9eU R                  S   nUS U nUS S 2S U24   nU(       a  Xï4$ U$ )Nr   r=   r3   rÍ   r    r  r   r   ró   rê   rq   ù              ð?r  r  )r+   r,   )r-   r.   )r+   r&   r-   r!   )r,   r'   r.   ) rU   rp   r™   rö   rt   r•   rr   rã   Úfloatr  r“   r  rš   rÞ   r�   r–   rä   rÙ   rÚ   r   râ   r’   ÚupperÚabsÚ	conjugateÚdotr½   Úconjro   rk   Úargsortr  )r<   r÷   rU   rp   rù   rú   rû   ÚsigmarÚsigmaiÚworkevÚdrÚdiÚzrÚ	nreturnedr   r   ÚiÚrdÚindr£   s                       rA   r¢   Ú _UnsymmetricArpackParams.extractD  sÎ  € Ø�v‰v�t—v‘vˆ1àˆØ#$ˆ×Ñ˜Ñ Ü˜SÑ!ˆÜ—(’(˜4Ÿ8™8¬2¯8©8Ñ4ˆÜ”r—w’w˜tŸz™zÓ*Ó+ˆÜ”r—w’w˜tŸz™zÓ*Ó+ˆÜ—’˜!˜dŸh™h™,¨¯©Ó0ˆà�7‰7�dŒ?Ü—’˜1˜q™5˜'¨¯©Ñ1ˆBÜ—’˜1˜q™5˜'¨¯©Ñ1ˆBä—’˜1 !™e˜*¨D¯G©G¸3Ñ?ˆBð × Ñ Ø× Ñ Ð"5¸wÈBØ˜F¨D¯J©J¸¿¹ÀÇ
Á
Ø—
‘
˜DŸJ™Jôð ×#Ñ# FÑ+ˆDà�q‹yÜ! $×1FÑ1FÑGÐGØ×(Ñ(¨Ñ1ˆIð �T˜B‘Y‘ˆAð —	‘	˜$Ÿ'™'Ÿ-™-›/Ó*ˆAð ˜‹{Ø�Ø˜1“fä˜1˜Q™4Ÿ9™9“~¨Ó*ð ˜q›5Ø&(ª¨A¨¡h°¸º1¸aÀ!¹e¸8¹Ñ1DÑ&D˜Aša ˜d™GØ*+ªA¨q¨D©'×*;Ñ*;Ó*=˜Aša  Q¡˜h™KØ ™F™Að &¨™N˜IØ˜‘F�Að ˜1•fùð* �Ø˜1”fÜ˜1˜Q™4Ÿ9™9“~¨Ó*Ü!Ÿvšv bª¨A¨¡h°·±¸BºqÀ!¸t¹HÓ0EÓF˜˜!›à˜qœ5Ø&(ª¨A¨¡h°¸º1¸aÀ!¹e¸8¹Ñ1DÑ&D˜Aša ˜d™GØ*+ªA¨q¨D©'×*;Ñ*;Ó*=˜Aša  Q¡˜h™KÜ%'§V¢V¨Bªq°!¨t©HØ,0¯K©K¸º1¸a¸4¹Ó,Aó&Cä')§v¢v¨b²°A¸±E°©lØ.2¯k©k¸"ºQÀÀAÁ¸X¹,Ó.Gó(Iñ&Ið ')¬B¯FªF°2²a¸°d±8Ø37·;±;¸rÂ!ÀQÈÁUÀ(¹|Ó3Ló-Nä.0¯fªf°Rº¸1¸q¹5¸±\Ø59·[±[ÀÂAÀqÀDÁÓ5Jó/Lñ-Lñ 'Mñ	%M˜A˜a™Dð ()¨¡t§y¡y£{˜A˜a !™e™HØ ™F™Að &¨™N˜IØ˜‘F�Að/ ˜1–fð8 ‹~à�j�y�M�Ø’a˜˜)˜�mÑ$’ð —9‘9 Ó&Ø‘BØ—Y‘Y &Ó(Ø˜a§*¡*™nÑ-�Bà—:‘: Ó-ÜŸ*š* R§W¡WÓ-‘CØ—Z‘Z <Ó/ô Ÿ*š*¤S¨¯©£\Ó2‘CäŸ*š*¤S¨£WÓ-�Cà—:‘:Ð!3Ó3Ø˜q˜b˜c˜(¡4 R 4™.‘CØ—Z‘ZÐ#5Ó5Ø˜b˜q˜'�Cà�c‘F�Ø’a˜�f‘I‘ä—’˜!˜ D§G¡GÑ,ˆAÜ—’˜!˜ t§w¡w°cÑ:ˆAØ× Ñ Ø× Ñ Ð"5¸wÈ1Ø—
‘
˜F§J¡J°·±¸¿
¹
ÀDÇJÁJØ—
‘
˜DŸJ™Jô(ð
 ×#Ñ# FÑ+ˆDà�q‹yÜ! $×1FÑ1FÑGÐGà×#Ñ# GÑ,ˆDØ�%�4�ˆAØ’!�U�d�U�(‘ˆAæØ�4ˆKàˆHrC   )rÒ   rÑ   rÆ   rÓ   rÞ   rÝ   rl   r›   râ   rä   rà   r½   rœ   r  rÙ   rÚ   rý   rþ   rD   rC   rA   r   r   ’  s   † Ø:>Ø)-ØIMôyòv4BõlNrC   r   c                   ó$   • \ rS rSrSrS rS rSrg)ÚSpLuInviÔ  z\
SpLuInv:
   helper class to repeatedly solve M*x=b
   using a sparse LU-decomposition of M
c                 óÚ   • [        U5      U l        UR                  U l        UR                  U l        [        R
                  " U R                  [        R                  5      (       + U l        g rE   )r   ÚM_luÚshaper]   rt   Ú
issubdtypeÚcomplexfloatingÚisreal©r<   ÚMs     rA   r;   ÚSpLuInv.__init__Û  sB   € Ü˜“GˆŒ	Ø—W‘WˆŒ
Ø—W‘WˆŒ
ÜŸ-š-¨¯
©
´B×4FÑ4FÓGÔGˆ�rC   c                 óH  • [         R                  " U5      nU R                  (       aÈ  [         R                  " UR                  [         R
                  5      (       a”  U R                  R                  [         R                  " U5      R                  U R                  5      5      SU R                  R                  [         R                  " U5      R                  U R                  5      5      -  -   $ U R                  R                  UR                  U R                  5      5      $ )Nr   )rt   Úasarrayr:  r8  r]   r9  r6  Úsolver  r’   r  ©r<   r²   s     rA   Ú_matvecÚSpLuInv._matvecá  s³   € ô �JŠJ�q‹MˆØ�;�;œ2Ÿ=š=¨¯©´"×2DÑ2D×EÑEØ—I‘I—O‘O¤B§G¢G¨A£J×$5Ñ$5°d·j±jÓ$AÓBØ˜4Ÿ9™9Ÿ?™?¬2¯7ª7°1«:×+<Ñ+<¸T¿Z¹ZÓ+HÓIÑIñJð Kð —9‘9—?‘? 1§8¡8¨D¯J©JÓ#7Ó8Ð8rC   )r6  r]   r:  r7  N©rF   rG   rH   rI   rJ   r;   rB  rK   rD   rC   rA   r4  r4  Ô  s   † ñòHõ9rC   r4  c                   ó$   • \ rS rSrSrS rS rSrg)ÚLuInviì  zT
LuInv:
   helper class to repeatedly solve M*x=b
   using an LU-decomposition of M
c                 óh   • [        U5      U l        UR                  U l        UR                  U l        g rE   )r	   r6  r7  r]   r;  s     rA   r;   ÚLuInv.__init__ó  s#   € Ü˜a“LˆŒ	Ø—W‘WˆŒ
Ø—W‘Wˆ�
rC   c                 ó.   • [        U R                  U5      $ rE   )r
   r6  rA  s     rA   rB  ÚLuInv._matvecø  s   € Ü˜Ÿ	™	 1Ó%Ð%rC   )r6  r]   r7  NrD  rD   rC   rA   rF  rF  ì  s   † ñòõ
&rC   rF  c                 óò   • [         R                  " U5      nS[         R                  " UR                  5      -  [         R                  " UR
                  5      R                  -  n[        X[        X#5      SS9$ )z*
gmres with looser termination condition.
iè  r   )ÚrtolÚatol)	rt   r?  Úsqrtrc   Úfinfor]   Úepsr   rT   )r3   Úbrd   Úmin_tols       rA   Úgmres_looserS  ü  sS   € ô 	�
Š
�1‹€AØ”R—W’W˜QŸV™V“_Ñ$¤r§x¢x°·±Ó'8×'<Ñ'<Ñ<€GÜ�œC Ó-°AÑ6Ð6rC   c                   ó,   • \ rS rSrSr\S4S jrS rSrg)ÚIterInvi  zR
IterInv:
   helper class to repeatedly solve M*x=b
   using an iterative method.
r   c                 ób  • Xl         [        US5      (       a  UR                  U l        O6[        R                  " UR
                  S   5      nX-  R                  U l        UR
                  U l        US::  a-  S[        R                  " U R                  5      R                  -  nX l        X0l	        g )Nr]   r   r   r   )
r<  Úhasattrr]   rt   r•   r7  rO  rP  Úifuncrd   )r<   r<  rX  rd   r²   s        rA   r;   ÚIterInv.__init__  s}   € ØŒÜ�1�g×ÑØŸ™ˆD�Jä—’˜Ÿ™ ™Ó$ˆAØ™%Ÿ™ˆDŒJØ—W‘WˆŒ
à�!‹8ð ”b—h’h˜tŸz™zÓ*×.Ñ.Ñ.ˆCØŒ
Ø�rC   c                 óª   • U R                  U R                  XR                  S9u  p#US:w  a&  [        SU R                   R                   SU S35      eU$ )N©rd   r   zError in inverting M: function ú did not converge (info = ú).)rX  r<  rd   r�   rF   ©r<   r²   rQ  r=   s       rA   rB  ÚIterInv._matvec  s]   € Ø—*‘*˜TŸV™V Q¯H©H�*Ð5‰ˆØ�1‹9ÜØ1°$·*±*×2EÑ2EÐ1Fð G,Ø,0¨6°ð5óð ð ˆrC   )r<  r]   rX  r7  rd   N)	rF   rG   rH   rI   rJ   rS  r;   rB  rK   rD   rC   rA   rU  rU    s   † ñð !,°ô õ rC   rU  c                   ó<   • \ rS rSrSr\S4S jrS r\S 5       r	Sr
g)	Ú	IterOpInvi&  z_
IterOpInv:
   helper class to repeatedly solve [A-sigma*M]*x = b
   using an iterative method
r   c                 ó,  ^^^• TU l         TU l        TU l        UUU4S jnUU4S jn[        R                  " TR
                  S   5      nTc7  U" U5      R                  n	[        U R                   R
                  UU	S9U l        O6U" U5      R                  n	[        U R                   R
                  UU	S9U l        TR
                  U l        US::  a7  S[        R                  " U R                  R                  5      R                  -  nX@l        XPl        g )Nc                 óP   >• TR                  U 5      TTR                  U 5      -  -
  $ rE   ©r½   )r²   r3   r<  r“   s    €€€rA   Ú	mult_funcÚ%IterOpInv.__init__.<locals>.mult_func2  s#   ø€ Ø—8‘8˜A“; ¨¯©°!«Ñ!4Ñ4Ð4rC   c                 ó2   >• TR                  U 5      TU -  -
  $ rE   rd  )r²   r3   r“   s    €€rA   Úmult_func_M_NoneÚ,IterOpInv.__init__.<locals>.mult_func_M_None5  s   ø€ Ø—8‘8˜A“; ¨¡Ñ*Ð*rC   r   rÍ   r   r   )r3   r<  r“   rt   r•   r7  r]   r   rÑ   rO  rP  rX  rd   )
r<   r3   r<  r“   rX  rd   re  rh  r²   r]   s
    ```      rA   r;   ÚIterOpInv.__init__-  sÙ   ú€ ØˆŒØˆŒØˆŒ
÷	5ö	+ô �HŠH�Q—W‘W˜Q‘ZÓ ˆØ‰9Ù$ QÓ'×-Ñ-ˆEÜ$ T§V¡V§\¡\Ø%5Ø+0ñ2ˆD�Gñ ˜a“L×&Ñ&ˆEÜ$ T§V¡V§\¡\Ø%.Ø+0ñ2ˆDŒGð —W‘WˆŒ
à�!‹8ð ”b—h’h˜tŸw™wŸ}™}Ó-×1Ñ1Ñ1ˆCØŒ
Ø�rC   c                 óª   • U R                  U R                  XR                  S9u  p#US:w  a&  [        SU R                   R                   SU S35      eU$ )Nr[  r   z)Error in inverting [A-sigma*M]: function r\  r]  )rX  rÑ   rd   r�   rF   r^  s       rA   rB  ÚIterOpInv._matvecL  s]   € Ø—*‘*˜TŸW™W a¯X©X�*Ð6‰ˆØ�1‹9ÜØ;¸D¿J¹J×<OÑ<OÐ;Pð Q,Ø,0¨6°ð5óð ð ˆrC   c                 ó.   • U R                   R                  $ rE   )rÑ   r]   )r<   s    rA   r]   ÚIterOpInv.dtypeU  s   € à�w‰w�}‰}ÐrC   )r3   r<  rÑ   rX  r7  r“   rd   N)rF   rG   rH   rI   rJ   rS  r;   rB  Úpropertyr]   rK   rD   rC   rA   ra  ra  &  s,   † ñð +6¸1ô ò>ð ñó órC   ra  c                 óô   • U R                   S:X  aG  U(       a@  [        R                  " U R                  [        R                  5      (       d  U R
                  $ [        U 5      (       a  U $ U R                  5       $ )z:Convert sparse matrix to CSC (by transposing, if possible)Úcsr)Úformatrt   r8  r]   r9  ÚTr   Útocsc)r3   Ú	hermitians     rA   Ú_fast_spmatrix_to_cscrv  Z  sP   € à	�‰�EÓžiÜ—M’M !§'¡'¬2×+=Ñ+=×>Ñ>Ø�s‰sˆ
Ü	˜A×	Ñ	àˆà�w‰w‹yÐrC   c                 óî   • [        U 5      (       a  [        U 5      R                  $ [        U 5      (       d  [	        U 5      (       a  [        XS9n [        U 5      R                  $ [        XS9R                  $ )N©ru  r[  )r   rF  r½   r   r   rv  r4  rU  )r<  ru  rd   s      rA   Úget_inv_matvecry  f  sX   € Üˆq‡z�zÜ�Q‹x�‰ÐÜ	�!�‰Ô*¨1×-Ñ-Ü! !Ñ9ˆÜ�q‹z× Ñ Ð ä�qÑ"×)Ñ)Ð)rC   c                 óZ  • US:X  a
  [        XUS9$ UGc2  [        U 5      (       a©  [        R                  " U R                  [        R
                  5      (       d  [        R                  " U5      S:X  a  [        R                  " U 5      n OU S-   n U R                  S S U R                  S   S-   2==   U-  ss'   [        U 5      R                  $ [        U 5      (       d  [        U 5      (       a;  X[        U R                  S   5      -  -
  n [        XS9n [!        U 5      R                  $ [#        [%        U 5      XUS9R                  $ [        U 5      (       d   [        U 5      (       d  [        U 5      (       a0  [        U5      (       dG  [        U5      (       d7  [        U 5      (       d'  [#        [%        U 5      [%        U5      X$S9R                  $ [        U 5      (       d  [        U5      (       a  [        XU-  -
  5      R                  $ XU-  -
  n[        XSS9n[!        U5      R                  $ )Nr   ©ru  rd   y                r   rx  r[  )ry  r   rt   r8  r]   r9  r  r\   Úflatr7  rF  r½   r   r   r   rv  r4  ra  r   )r3   r<  r“   ru  rd   rÑ   s         rA   Úget_OPinv_matvecr}  p  s­  € Ø�ƒzÜ˜a¸#Ñ>Ð>à‚yä�1�:‰:Ü—’˜aŸg™g¤r×'9Ñ'9×:Ñ:Ü—w’w˜u“~¨Ó*Ü—G’G˜A“J‘à˜‘F�Ø�F‰FÑ#�Q—W‘W˜Q‘Z !‘^Ð#Ó$¨Ñ-Ó$Ü˜“8—?‘?Ð"Ü�a�[‰[Ô.¨q×1Ñ1ØœC §¡¨¡
›OÑ+Ñ+ˆAÜ% aÑ=ˆAÜ˜1“:×$Ñ$Ð$äÔ-¨aÓ0Ø¨3ñ0ß06±ð7ô ˜—‘¤H¨Q§K¡KÔ8JÈ1×8MÑ8MÜ˜Q—Z‘Z¬°¯©Ô<NÈq×<QÑ<QÜÔ-¨aÓ0Ü-¨aÓ0Ø"ñ-ç-3©Vð4ô �Q�Z‰Zœ7 1Ÿ:™:Ü˜ Q™Y™Ó'×.Ñ.Ð.à˜Q‘Y‘ˆBÜ& rÑ?ˆBÜ˜2“;×%Ñ%Ð%rC   c                 óÎ  • [        U 5      n [        U5      nU R                  S   U R                  S   :w  a  [        SU R                   S35      eUbÆ  UR                  U R                  :w  a%  [        SUR                   SU R                   35      e[        R                  " UR                  5      R
                  R                  5       [        R                  " U R                  5      R
                  R                  5       :w  a  [        R                  " SS	S
9  U R                  S   nUS::  a  [        SU S35      eXS-
  :¼  a  [        R                  " S[        S	S
9  [        U 5      (       a  [        S5      e[        U [        5      (       a  [        S5      e[        U[        5      (       a  [        S5      e[        XU	S9$ Uc‰  [        U 5      R                   nUb  [        S5      eUb  [        S5      eUc  SnSnSnU
b  [        S5      eGOJS	nU
c  [#        USUS9nO[        U
5      n
U
R                   n[        U5      R                   nGO[        R$                  " U R                  [        R&                  5      (       a  Ub  [        S5      eSnOaUb  UR                  5       S:X  a  SnOGUR                  5       S:X  a(  [        R(                  " U5      S:X  a  [        S5      eSnO[        S5      e[        U 5      R                   nU
b  [        S5      eUc  [+        XUSUS9nO[        U5      nUR                   nUc  SnO[        U5      R                   n[        R,                  R/                  U5      n[1        XáU R                  R
                  UUUUUXeXtX�5      nUR2                  (       d#  UR5                  5         UR2                  (       d  M#  UR7                  U	5      $ ) 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.)rQ  Ú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.Tr{  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   r7  r�   rt   r]   Úcharr  ÚwarningsÚwarnÚRuntimeWarningr   Ú	TypeErrorÚ
isinstancer   r   r   r½   ry  r8  r9  r  r}  r×   rØ   r   r›   rð   r¢   )r3   rU   r<  r“   rk   r�   rr   rn   rd   r÷   ÚMinvÚOPinvÚOPpartrœ   rp   r½   ro   rÃ   r¼   Úparamss                       rA   r   r   “  s³  € ô~ 	' qÓ)€AÜ& qÓ)€AØ‡w�wˆq�z�Q—W‘W˜Q‘ZÓÜÐ9¸!¿'¹'¸À!ÐDÓEÐEØ�}Ø�7‰7�a—g‘gÓÜÐ2°1·7±7°)¸<ÈÏÉÀyÐQÓRÐRÜ�8Š8�A—G‘GÓ×!Ñ!×'Ñ'Ó)¬R¯XªX°a·g±gÓ->×-CÑ-C×-IÑ-IÓ-KÓKÜ�MŠMð Ià%&ò(ð 	
�‰�‰
€AàˆAƒvÜ˜2˜a˜SÐ 8Ð9Ó:Ð:à�‰EƒzÜ�Šð Dä$°ò	4ô �A�;‰;Üð )ó *ð *ô �aœ×(Ñ(Üð 1ó 2ð 2ä�aœ×(Ñ(Üð 1ó 2ð 2ô �1Ð!4Ñ5Ð5à�}Ü! !Ó$×+Ñ+ˆàÑÜð 2ó 3ð 3àÑÜð 9ó :ð :ð ‰9àˆDØˆHØˆKØÑÜ ð "<ó =ð =ñ  ð
 ˆDØ‰|Ü,¨Q¸$ÀCÑH‘ä'¨Ó-�Ø"Ÿk™k�Ü'¨Ó*×1Ñ1ŠHô �=Š=˜Ÿ™¤"×"4Ñ"4×5Ñ5ØÑ!Ü ð "@ó Að Aà‰DØ‰^˜vŸ|™|›~°Ó4Ø‰DØ�\‰\‹^˜sÓ"Ü�wŠw�u‹~ Ó"Ü Ð!HÓIÐIØ‰DäÐ>Ó?Ð?ä! !Ó$×+Ñ+ˆØÑÜð *ó +ð +à‰=Ü*¨1°Ø5:ÀñE‰Kô % UÓ+ˆEØŸ,™,ˆKØ‰9Ø‰Hä'¨Ó*×1Ñ1ˆHä
�)‰)×
Ñ
 Ó
$€CÜ% a¨A¯G©G¯L©L¸&À$Ø&.°¸UØ&)¨w¸sóI€Fð ××Ø�‰Ôð ××Ñð �>‰>Ð-Ó.Ð.rC   c                 óÐ  • [         R                  " U R                  [         R                  5      (       am  US:w  a  [	        SU S35      eUS:X  a  [	        S5      eUS:X  a  SnOUS:X  a  S	n[        XX#XEXgUXšUS
9nU	(       a  US   R                  US   4$ UR                  $ U R                  S   U R                  S   :w  a  [	        SU R                   S35      eUbÆ  UR                  U R                  :w  a%  [	        SUR                   SU R                   35      e[         R                  " UR                  5      R                  R                  5       [         R                  " U R                  5      R                  R                  5       :w  a  [        R                  " SSS9  U R                  S   nUS::  a  [	        S5      eX:¼  a„  [        R                  " S[        SS9  [        U 5      (       a  [        S5      e[        U [         5      (       a  [        S5      e[        U[         5      (       a  [        S5      e[#        XU	(       + S9$ Uc}  [%        U 5      n U R&                  nUb  [	        S5      eUc  SnSnSnU
b  [	        S5      eGONSnU
c  [)        USUS9nO[%        U
5      n
U
R&                  n[%        U5      R&                  nGOU
b  [	        S5      eUS:X  aI  S nSnUc  [+        XUSUS9nO[%        U5      nUR&                  nUc  SnOÊ[%        U5      nUR&                  nO²US!:X  a?  S"nUc  [+        XUSUS9nO[%        U5      R&                  n[%        U 5      R&                  nSnOmUS#:X  aX  S$n[%        U 5      R&                  nUc  [+        XUSUS9nO[%        U5      R&                  nUc  SnO%[%        U5      R&                  nO[	        S%U S&35      e[         R,                  R/                  U5      n[1        XñU R                  R                  UUUUUXeXtX�5      nUR2                  (       d#  UR5                  5         UR2                  (       d  M#  UR7                  U	5      $ )'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)

ÚnormalrÊ   z% cannot be used with complex matrix Ar*   z/which='BE' cannot be used with complex matrix Ar(   r+   r)   r,   )
r<  r“   rk   r�   rr   rn   rd   r÷   r�  r‘  r   r   r  r€  Nr�  r‚  rƒ  r   r„  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.)rQ  Úeigvals_onlyr‡  rˆ  Tr{  z5Minv should not be specified when sigma is specified.r    Úbucklingr/   Úcayleyr   zunrecognized mode 'Ú')rt   r8  r]   r9  r�   r   r  r7  rŠ  r  r‹  rŒ  r�  r   rŽ  r�  r   r   r   r½   ry  r}  r×   rØ   r«   r›   rð   r¢   )r3   rU   r<  r“   rk   r�   rr   rn   rd   r÷   r�  r‘  ro   rœ   Úretrp   r½   rÃ   r¼   r“  s                       rA   r   r   š  sY  € ôn 
‡}‚}�Q—W‘Wœb×0Ñ0×1Ñ1Ø�8ÓÜ˜u T FÐ*OÐPÓQÐQØ�D‹=ÜÐNÓOÐOØ�d‹]Ø‰EØ�d‹]ØˆEÜ�1˜1°Ø°Ø':Øñ ˆö
 Ø�q‘6—;‘;  A¡Ð&Ð&à—8‘8ˆOà‡w�wˆq�z�Q—W‘W˜Q‘ZÓÜÐ9¸!¿'¹'¸À!ÐDÓEÐEØ�}Ø�7‰7�a—g‘gÓÜÐ2°1·7±7°)¸<ÈÏÉÀyÐQÓRÐRÜ�8Š8�A—G‘GÓ×!Ñ!×'Ñ'Ó)¬R¯XªX°a·g±gÓ->×-CÑ-C×-IÑ-IÓ-KÓKÜ�MŠMð Ià%&ò(ð 	
�‰�‰
€AàˆAƒvÜÐ4Ó5Ð5àƒvÜ�Šð Eä$°ò	4ô �A�;‰;Üð )ó *ð *ô �aœ×(Ñ(Üð -ó .ð .ä�aœ×(Ñ(Üð -ó .ð .ô �AÐ-@Ô)@ÑAÐAà�}Ü˜QÓˆØ—‘ˆàÑÜÐOÓPÐPØ‰9àˆDØˆHØˆKØÑÜ Ð!NÓOÐOñ  ð ˆDØ‰|Ü,¨Q¸$ÀCÑH‘ä'¨Ó-�Ø"Ÿk™k�Ü'¨Ó*×1Ñ1ŠHð ÑÜð *ó +ð +ð �8ÓØˆDØˆFØ‰}Ü.¨q°UØ9=À3ñH‘ô )¨Ó/�Ø#Ÿl™l�Ø‰yØ‘ä$ QÓ'�ØŸ8™8‘ð �ZÓØˆDØ‰}Ü.¨q°UØ9=À3ñH‘ô /¨uÓ5×<Ñ<�Ü% aÓ(×/Ñ/ˆFØ‰Hð �XÓØˆDÜ% aÓ(×/Ñ/ˆFØ‰}Ü.¨q°UØ9=À3ñH‘ô /¨uÓ5×<Ñ<�Ø‰yØ‘ä+¨AÓ.×5Ñ5‘ô Ð2°4°&¸Ð:Ó;Ð;Ü
�)‰)×
Ñ
 Ó
$€CÜ# A¨!¯'©'¯,©,¸ÀØ$,¨k¸5Ø$'¨W¸SóG€Fð ××Ø�‰Ôð ××Ñð �>‰>Ð-Ó.Ð.rC   )F)Fr   )r0   NNr&   NNNr   TNNNN)r0   NNr&   NNNr   TNNr•  N)BrJ   Únumpyrt   r‹  Ú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_ERRORSr\   Ú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   rV   rX   r«   r   r4  rF  rS  rU  ra  rv  ry  r}  r   r   rD   rC   rA   Ú<module>r²     s·  ðñóJ Û ß Kß &ß 7Ó 7÷ñ ÷ ,å à%€â
A€ð ˜S s°Ñ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€ð �1˜A Q¨a°qÀÈÐRSñ€
ð
 ˜A AÑ&€ô
8�,ô 
8ô)˜+ô )ò&÷h+ñ h+ôVd˜]ô dôN@˜}ô @ôD
9ˆnô 9ô0&ˆNô &ò 7ôˆnô ôB1�ô 1ôh	ô*ô &ðF 59Ø<@Ø15ôD/ðN 6:Ø=AØ48õ[/rC   