§
    ²Ûg¢  ã                   ó   — d Z ddlZdd„ZdS )z‹
Noise model inserter module
The goal of this module is to add QuantumError gates (Kraus gates) to a circuit
based on a given noise model.
é    NFc                 ó`  ‡— t          | t          t          f¦  «        }|r| n| g} g }|j        }|j        }| D �]k}|r't
          j                             ||j        ¬¦  «        }n|}d„ t          |j
        ¦  «        D ¦   «         Š|                     |j        dz   ¬¦  «        }	g |	_        |j        D ]Ý}
|	j                             |
¦  «         t          ˆfd„|
j
        D ¦   «         ¦  «        }|
j        j        }||v rF|||         v r<||         |         }|	                     |                     ¦   «         |
j
        ¦  «         Œ’||                     ¦   «         v r5||         }|	                     |                     ¦   «         |
j
        ¦  «         ŒÞ|                     |	¦  «         �Œm|r|n|d         S )a  Return a noisy version of a QuantumCircuit.

    Args:
        circuits (QuantumCircuit or list[QuantumCircuit]): Input noise-free circuits.
        noise_model (NoiseModel):  The noise model containing the errors to add
        transpile (Boolean): Should the circuit be transpiled into the noise model basis gates

    Returns:
        QuantumCircuit: The new circuit with the Kraus noise instructions inserted.

    Additional Information:
        The noisy circuit return by this function will consist of the
        original circuit with ``Kraus`` instructions inserted after all
        instructions referenced in the ``noise_model``. The resulting circuit
        cannot be ran on a quantum computer but can be executed on the
        :class:`~qiskit_aer.QasmSimulator`.
    )Úbasis_gatesc                 ó   — i | ]\  }}||“Œ	S © r   )Ú.0ÚindexÚbits      ú[/granary/edev/quantum/lib/python3.11/site-packages/qiskit_aer/utils/noise_model_inserter.pyú
<dictcomp>z insert_noise.<locals>.<dictcomp>2   s   € Ð[Ð[Ð[©
¨¨s˜˜eÐ[Ð[Ð[ó    Ú_with_noise)Únamec              3   ó(   •K  — | ]}‰|         V — Œd S )Nr   )r   ÚqÚqubit_indicess     €r
   ú	<genexpr>zinsert_noise.<locals>.<genexpr>7   s(   øè è € ÐAÐA°˜=¨Ô+ÐAÐAÐAÐAÐAÐAr   r   )Ú
isinstanceÚlistÚtupleÚ_local_quantum_errorsÚ_default_quantum_errorsÚqiskitÚcompilerÚ	transpiler   Ú	enumerateÚqubitsÚcopyr   ÚdataÚappendÚ	operationÚto_instructionÚkeys)ÚcircuitsÚnoise_modelr   Úis_circuits_listÚresult_circuitsÚlocal_errorsÚdefault_errorsÚcircuitÚtranspiled_circuitÚresult_circuitÚinstr   r   Úerrorr   s                 @r
   Úinsert_noiser.      sè  ø€ õ$ " (­Tµ5¨MÑ:Ô:ÐØ+Ð;ˆxˆx°(°€HØ€OØÔ4€LØ Ô8€NØð /ñ /ˆØð 	)Ý!'¤×!:Ò!:Ø [Ô%<ð ";ñ "ô "ÐÐð ")ÐØ[Ð[µiÐ@RÔ@YÑ6ZÔ6ZÐ[Ñ[Ô[ˆØ+×0Ò0Ð6HÔ6MÐP]Ñ6]Ð0Ñ^Ô^ˆØ ˆÔØ&Ô+ð 	Kð 	KˆDØÔ×&Ò& tÑ,Ô,Ð,ÝÐAÐAÐAÐA°T´[ÐAÑAÔAÑAÔAˆFð ”>Ô&ˆDØ�|Ð#Ð#¨°,¸tÔ2DÐ(DÐ(DØ$ TÔ*¨6Ô2�Ø×%Ò% e×&:Ò&:Ñ&<Ô&<¸d¼kÑJÔJÐJÐJØ˜×,Ò,Ñ.Ô.Ð.Ð.Ø& tÔ,�Ø×%Ò% e×&:Ò&:Ñ&<Ô&<¸d¼kÑJÔJÐJøØ×Ò˜~Ñ.Ô.Ð.Ñ.Ø.ÐFˆ?ˆ?°OÀAÔ4FÐFr   )F)Ú__doc__Úqiskit.compilerr   r.   r   r   r
   ú<module>r1      sA   ððð ð
 Ð Ð Ð ð.Gð .Gð .Gð .Gð .Gð .Gr   