§
    º³Ùg4
  ã                   óV   — d Z ddlZddlZddlZddlmZ ddlmZ  G d„ de¦  «        ZdS )ú.Error pass to be called when an error happens.é    N)ÚAnalysisPass)ÚTranspilerErrorc                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚErrorr   NÚraisec                 ó�   •— t          ¦   «                              ¦   «          || _        |dv r	|| _        dS t	          d|› �¦  «        ‚)a¤  Error pass.

        Args:
            msg (str | Callable[[PropertySet], str]): Error message, if not provided a generic error
                will be used.  This can be either a raw string, or a callback function that accepts
                the current ``property_set`` and returns the desired message.
            action (str): the action to perform. Default: 'raise'. The options are:
              * ``'raise'``: Raises a ``TranspilerError`` exception with msg
              * ``'warn'``: Raises a non-fatal warning with msg
              * ``'log'``: logs in ``logging.getLogger(__name__)``

        Raises:
            TranspilerError: if action is not valid.
        )r   ÚwarnÚlogúUnknown action: N)ÚsuperÚ__init__ÚmsgÚactionr   )Úselfr   r   Ú	__class__s      €úZ/granary/edev/quantum/lib/python3.11/site-packages/qiskit/transpiler/passes/utils/error.pyr   zError.__init__   sP   ø€ õ 	‰Œ×ÒÑÔÐØˆŒØÐ-Ð-Ð-Ø ˆDŒKˆKˆKå!Ð"=°VÐ"=Ð"=Ñ>Ô>Ð>ó    c                 óR  ‡ — ‰ j         €d}nŠt          ‰ j         t          ¦  «        rVd„ t          j        ¦   «                              ‰ j         ¦  «        D ¦   «         }ˆ fd„|D ¦   «         } ‰ j         j        d	i |¤Ž}n‰                       ‰ j        ¦  «        }‰ j        dk    rt          |¦  «        ‚‰ j        dk    rt          j        |t          ¦  «         dS ‰ j        dk    r0t          j        t          ¦  «        }|                     |¦  «         dS t          d‰ j        › �¦  «        ‚)
zRun the Error pass on `dag`.Nz5An error occurred while the pass manager was running.c                 ó.   — g | ]}|d          ®
|d          ‘ŒS )é   © )Ú.0Útups     r   ú
<listcomp>zError.run.<locals>.<listcomp>5   s,   € ð ð ð ØÈÈAÌÐHZ��A”ÐHZÐHZÐHZr   c                 ó,   •— i | ]}|‰j         |         “ŒS r   )Úproperty_set)r   Ú	prop_namer   s     €r   ú
<dictcomp>zError.run.<locals>.<dictcomp>8   s#   ø€ Ð^Ð^Ð^Ài˜) TÔ%6°yÔ%AÐ^Ð^Ð^r   r   r
   r   r   r   )r   Ú
isinstanceÚstrÚstringÚ	FormatterÚparseÚformatr   r   r   Úwarningsr
   ÚWarningÚloggingÚ	getLoggerÚ__name__Úinfo)r   Ú_r   Ú
prop_namesÚ
propertiesÚloggers   `     r   Úrunz	Error.run0   s7  ø€ àŒ8ÐØIˆCˆCÝ˜œ¥#Ñ&Ô&ð 	.ðð Ý"(Ô"2Ñ"4Ô"4×":Ò":¸4¼8Ñ"DÔ"Dðñ ô ˆJð _Ð^Ð^Ð^ÐS]Ð^Ñ^Ô^ˆJØ!�$”(”/Ð/Ð/ JÐ/Ð/ˆCˆCà—(’(˜4Ô,Ñ-Ô-ˆCàŒ;˜'Ò!Ð!Ý! #Ñ&Ô&Ð&ØŒ;˜&Ò Ð ÝŒM˜#�wÑ'Ô'Ð'Ð'Ð'ØŒ[˜EÒ!Ð!ÝÔ&¥xÑ0Ô0ˆFØ�KŠK˜ÑÔÐÐÐå!Ð"B°T´[Ð"BÐ"BÑCÔCÐCr   )Nr   )r*   Ú
__module__Ú__qualname__Ú__doc__r   r0   Ú__classcell__)r   s   @r   r   r      sY   ø€ € € € € Ø8Ð8ð?ð ?ð ?ð ?ð ?ð ?ð,Dð Dð Dð Dð Dð Dð Dr   r   )	r3   r(   r"   r&   Úqiskit.transpiler.basepassesr   Úqiskit.transpiler.exceptionsr   r   r   r   r   ú<module>r7      sŠ   ðð 5Ð 4à €€€Ø €€€Ø €€€à 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8ð.Dð .Dð .Dð .Dð .DˆLñ .Dô .Dð .Dð .Dð .Dr   