
    {	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
)z/
Simulator instruction to save Clifford state.
    )QuantumCircuit   )SaveSingleData   )default_qubitsc                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )SaveStabilizer   zSave Stabilizer instructionc                 $   > [         TU ]  SXX4S9  g)a  Create new instruction to save the stabilizer simulator state as a StabilizerState.

Args:
    num_qubits (int): the number of qubits of the
    label (str): the key for retrieving saved data from results.
    pershot (bool): if True save a list of StabilizerStates for each
                    shot of the simulation rather than a single
                    statevector [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.
save_stabilizer)pershotconditionalN)super__init__)self
num_qubitslabelr   r   	__class__s        n/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/library/save_instructions/save_stabilizer.pyr   SaveStabilizer.__init__   s    $ 	z' 	 	
     
stabilizerFF)__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classcell__)r   s   @r   r	   r	      s    %
 
r   r	   c                 b    [        U 5      n[        [        U5      XUS9nU R                  XT5      $ )aI  Save the current stabilizer simulator quantum state as a StabilizerState.

Args:
    label (str): the key for retrieving saved data from results.
    pershot (bool): if True save a list of StabilizerStates 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   /   s0    $ D!F3v;eR]^E;;u%%r   Nr   )r   qiskit.circuitr   	save_datar   r   r	   r   r   r   r   <module>r)      s0    * % +
^ 
4&. "1 r   