
    {	i                     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	)z0
Simulator instruction to save simulator state.
    )QuantumCircuit   )SaveSingleData   )default_qubitsc                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )	SaveState   z[Save simulator state

The format of the saved state depends on the simulation method used.
c                 .   > Uc  Sn[         TU ]  SXX4S9  g)aK  Create new instruction to save the simulator state.

The format of the saved state depends on the simulation method used.

Args:
    num_qubits (int): the number of qubits of the
    label (str or None): Optional, the key for retrieving saved data
                         from results. If None the key will be the
                         state type of the simulator.
    pershot (bool): if True save a list of states for each
                    shot of the simulation rather than a single
                    state [Default: False].
    conditional (bool): if True save data conditional on the current
                        classical register values [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.
N_method_
save_state)pershotconditional)super__init__)self
num_qubitslabelr   r   	__class__s        i/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/library/save_instructions/save_state.pyr   SaveState.__init__   s#    , =Ez'c     NFF)__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classcell__)r   s   @r   r	   r	      s    
d dr   r	   Nc                 b    [        U 5      n[        [        U5      XUS9nU R                  XT5      $ )a  Save the current simulator quantum state.

Args:
    label (str or None): Optional, the key for retrieving saved data
                         from results. If None the key will be the
                         state type of the simulator.
    pershot (bool): if True save a list of statevectors for each
                    shot of the simulation [Default: False].
    conditional (bool): if True save pershot data conditional on the
                        current classical register values
                        [Default: False].

Returns:
    QuantumCircuit: with attached instruction.

.. note:

    This instruction is always defined across all qubits in a circuit.
)r   r   r   )r   r	   lenappend)r   r   r   r   qubitsinstrs         r   r   r   6   s/    ( D!Fc&k[YE;;u%%r   r   )r   qiskit.circuitr   	save_datar   r   r	   r   r   r   r   <module>r)      s3    * % +d dB&2 ' r   