
    {	i                      ^    S r SSKrSSKJr   " S S\5      r " S S\5      r " S S	\5      rg)
z@
Simulator instruction to save custom internal data to results.
    N)Instructionc                   R   ^  \ rS rSrSrSr\" / SQ5      rSU 4S jjrS	S jr	Sr
U =r$ )
SaveData   z*Pragma Instruction to save simulator data.T)singlec_singlelistc_listaverage	c_averageaccumc_accumc                    > X@R                   ;  a  [        S5      e[        U[        5      (       d  [        SU S35      eUc  0 n[        TU ]  XSU5        X0l        X@l        g)aY  Create new save data instruction.

Args:
    name (str): the name of the save instruction.
    num_qubits (int): the number of qubits for the snapshot type.
    label (str): the key for retrieving saved data from results.
    subtype (str): the data subtype for the instruction [Default: 'single'].
    params (list or None): Optional, the parameters for instruction
                           [Default: None].

Raises:
    TypeError: if the subtype string is invalid.

Additional Information:
    The supported subtypes are 'single', 'list', 'c_list', 'average',
    'c_average', 'accum', 'c_accum'.
z.Invalid data subtype for SaveData instruction.z)Invalid label for save data instruction, z must be a string.Nr   )_allowed_subtypes	TypeError
isinstancestrsuper__init___label_subtype)selfname
num_qubitslabelsubtypeparams	__class__s         h/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/library/save_instructions/save_data.pyr   SaveData.__init__   se    $ 000LMM%%%GwN`abb>F1f5    c                 .    [         R                   " U 5      $ )zSpecial case. Return self.)copy)r   	annotateds     r   inverseSaveData.inverse=   s    yyr!   )r   r   )r   N)F)__name__
__module____qualname____firstlineno____doc__
_directivesetr   r   r%   __static_attributes____classcell__r   s   @r   r   r      s)    4J\ @ r!   r   c                   8   ^  \ rS rSrSr    SU 4S jjrSrU =r$ )SaveAverageDataB   zSave averageble datac                 h   > U(       a  SnOU(       a  SnOSnU(       a  SU-   n[         T	U ]  XX8US9  g)au  Create new save data instruction.

Args:
    name (str): the name of the save instruction.
    num_qubits (int): the number of qubits for the snapshot type.
    label (str): the key for retrieving saved data from results.
    unnormalized (bool): If True return save the unnormalized accumulated
                         or conditional accumulated data over all shot.
                         [Default: False].
    pershot (bool): if True save a list of data for each shot of the
                    simulation rather than the average over  all shots
                    [Default: False].
    conditional (bool): if True save the average or pershot data
                        conditional on the current classical register
                        values [Default: False].
    params (list or None): Optional, the parameters for instruction
                           [Default: None].
r	   r   r   c_r   r   Nr   r   )
r   r   r   r   unnormalizedpershotconditionalr   r   r   s
            r   r   SaveAverageData.__init__E   s:    8 GGGWnG5&Qr!    )FFFNr'   r(   r)   r*   r+   r   r.   r/   r0   s   @r   r2   r2   B   s      $R $Rr!   r2   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )SaveSingleDatal   z%Save non-averagable single data type.c                 R   > U(       a  SOSnU(       a  SU-   n[         TU ]  XX7US9  g)ae  Create new save data instruction.

Args:
    name (str): the name of the save instruction.
    num_qubits (int): the number of qubits for the snapshot type.
    label (str): the key for retrieving saved data from results.
    pershot (bool): if True save a list of data for each shot of the
                    simulation [Default: False].
    conditional (bool): if True save data conditional on the
                        current classical register values
                        [Default: False].
    params (list or None): Optional, the parameters for instruction
                           [Default: None].
r	   r   r5   r6   Nr7   )	r   r   r   r   r9   r:   r   r   r   s	           r   r   SaveSingleData.__init__o   s.     $&WnG5&Qr!   r<   )FFNr=   r0   s   @r   r?   r?   l   s    /R Rr!   r?   )r+   r#   qiskit.circuitr   r   r2   r?   r<   r!   r   <module>rD      s<     &*{ *Z'Rh 'RTRX Rr!   