
    {	im                     Z    S r SSKJr  SSKJr  SSKJr   " S S\5      rSS	 jr\\l        g
)z1
Simulator instruction to save a SuperOp matrix.
    )QuantumCircuit   )SaveSingleData   )default_qubitsc                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )SaveSuperOp   zSave a SuperOp matrix.c                 $   > [         TU ]  SXUS9  g)a  Create new instruction to save the superop simulator state.

Args:
    num_qubits (int): the number of qubits for the save instruction.
    label (str): the key for retrieving saved data from results.
    pershot (bool): if True save a list of SuperOp matrices for each shot
                    of the simulation [Default: False].

.. note::

    This save instruction must always be performed on the full width of
    qubits in a circuit, otherwise an exception will be raised during
    simulation.
save_superop)pershotN)super__init__)self
num_qubitslabelr   	__class__s       k/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/library/save_instructions/save_superop.pyr   SaveSuperOp.__init__   s     	GL     superopF)__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classcell__)r   s   @r   r	   r	      s     M Mr   r	   c                 `    [        U 5      n[        [        U5      XS9nU R                  XC5      $ )a  Save the current state of the superop simulator.

Args:
    label (str): the key for retrieving saved data from results.
    pershot (bool): if True save a list of SuperOp matrices for each shot
                    of the  simulation [Default: False].

Returns:
    QuantumCircuit: with attached instruction.

.. note::

    This instruction is always defined across all qubits in a circuit.
)r   r   )r   r	   lenappend)r   r   r   qubitsinstrs        r   r   r   *   s-     D!FF5BE;;u%%r   Nr   )r   qiskit.circuitr   	save_datar   r   r	   r   r   r   r   <module>r(      s2    * % +M. M*&( + r   