Ë
    Gìj¬  ã                   óx   — d Z ddlmZmZmZmZ ddlmZ dgZ	 ddee	   de	ded	eeee
      df   d
ee	ef   f
d„Zy)z0Determines if a contraction can use BLAS or not.é    )ÚListÚSequenceÚTupleÚUnion)ÚArrayIndexTypeÚcan_blasNÚinputsÚresultÚidx_removedÚshapesÚreturnc                 óÂ  — t        | «      dk7  ry| \  }}t        ||z   «      D ]P  }|j                  |«      |j                  |«      }}|dkD  s|dkD  s||z   dkD  r y||z   dz
  t        ||v «      k(  sŒP y |�8|D ]3  }|d   |j	                  |«         |d   |j	                  |«         k7  sŒ3 y t        |«      dk(  ry| D �	cg c]  }	t        |	«      ‘Œ }
}	|
d   |z
  }|
d   |z
  }t        |«      }| d   | d   k(  ry|
d   |
d   k(  ry|| d |d| k(  ry	|d| || d k(  ry	|| d || d k(  ry	|d| |d| k(  ry	t        |«      dk(  st        |«      dk(  ry
yc c}	w )aˆ  Checks if we can use a BLAS call.

    Parameters
    ----------
    inputs : list of str
        Specifies the subscripts for summation.
    result : str
        Resulting summation.
    idx_removed : set
        Indices that are removed in the summation
    shapes : sequence of tuple[int], optional
        If given, check also that none of the indices are broadcast dimensions.

    Returns:
    -------
    type : str or bool
        The type of BLAS call to be used or False if none.

    Notes:
    -----
    We assume several operations are not efficient such as a transposed
    DDOT, therefore 'ijk,jki->' should prefer einsum. These return the blas
    type appended with "/EINSUM" to differentiate when they can still be done
    with tensordot if required, e.g. when a backend has no einsum.

    Examples:
    --------
    >>> can_blas(['ij', 'jk'], 'ik', set('j'))
    'GEMM'

    >>> can_blas(['ijj', 'jk'], 'ik', set('j'))
    False

    >>> can_blas(['ab', 'cd'], 'abcd', set())
    'OUTER/EINSUM'

    >>> # looks like GEMM but actually 'j' is broadcast:
    >>> can_blas(['ij', 'jk'], 'ik', set('j'), shapes=[(4, 1), (5, 6)])
    False
    é   Fé   Nr   zOUTER/EINSUMÚDOTz
DOT/EINSUMÚGEMMzGEMV/EINSUMÚTDOT)ÚlenÚsetÚcountÚintÚfind)r	   r
   r   r   Ú
input_leftÚinput_rightÚcÚnlÚnrÚxÚsetsÚ	keep_leftÚ
keep_rightÚrss                 úSC:\Users\Stabi\Downloads\virtual-tryon(1)\venv\Lib\site-packages\opt_einsum/blas.pyr   r   
   sá  € ô^ ˆ6ƒ{�aÒØà$Ñ€J�ä�˜kÑ)Ö*ˆà×!Ñ! !Ó$ k×&7Ñ&7¸Ó&:ˆBˆØ�ŠF˜˜Qš B¨¡G¨a¢KÙð
 �‰7�Q‰;œ#˜a 6˜kÓ*Ó*Ùð +ð ÐÛˆAØ�a‰y˜Ÿ™¨Ó+Ñ,°°q±	¸+×:JÑ:JÈ1Ó:MÑ0NÓNÙð ô ˆ;Ó˜1ÒØñ #Ó#™F�qŒC��F˜F€DÐ#Ø�Q‘˜+Ñ%€IØ�a‘˜;Ñ&€JÜ	ˆ[Ó	€Bð ˆa�y�F˜1‘IÒØð 
ˆa‰�D˜‘GÒ	Øð �2�#�$Ð˜; s¨Ð+Ò+Øð 
�C�Rˆ˜K¨¨¨Ð-Ò	-Øð 
�R�C�DÐ	˜[¨"¨¨Ð.Ò	.Øð 
�C�Rˆ˜K¨¨Ð,Ò	,Øô ˆi‹.˜AÒ
¤3 z£?°aÒ#7Øð ùòG $s   ÃE)N)Ú__doc__Útypingr   r   r   r   Úopt_einsum.typingr   Ú__all__Ústrr   Úboolr   © ó    r#   Ú<module>r,      sv   ðÙ 6ç /Ó /å ,àˆ,€ð 15ñ	pØ�‰Iðpàðpð  ðpð �(˜5 ™:Ñ&¨Ð,Ñ-ð	pð
 ˆ3�ˆ9Ñôpr+   