
    {	im                         S r SSKJr  SSKJr  SSKJr   " S S\5      r " S	 S
\5      r SS jr SS jr	\\l        \	\l	        g)zB
Simulator instruction to save measurement outcome probabilities.
    )QuantumCircuit   )SaveAverageData   )default_qubitsc                   8   ^  \ rS rSrSr    SU 4S jjrSrU =r$ )SaveProbabilities   z.Save measurement outcome probabilities vector.c           	      *   > [         TU ]  SUUUUUS9  g)a  Instruction to save measurement probabilities vector.

Args:
    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
                         probabilities over all shots [Default: False].
    pershot (bool): if True save a list of probabilities for each shot
                    of the simulation rather than the average over
                    all shots [Default: False].
    conditional (bool): if True save the probabilities data conditional
                        on the current classical register values
                        [Default: False].
save_probabilities)conditionalpershotunnormalizedNsuper__init__self
num_qubitslabelr   r   r   	__class__s         q/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/library/save_instructions/save_probabilities.pyr   SaveProbabilities.__init__   s)    , 	 #% 	 	
     )probabilitiesFFF__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classcell__r   s   @r   r	   r	      s    8
 
 
r   r	   c                   8   ^  \ rS rSrSr    SU 4S jjrSrU =r$ )SaveProbabilitiesDict8   z,Save measurement outcome probabilities dict.c           	      *   > [         TU ]  SUUUUUS9  g)a  Instruction to save measurement probabilities dict.

Args:
    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
                         probabilities over all shots [Default: False].
    pershot (bool): if True save a list of probabilities for each shot
                    of the simulation rather than the average over
                    all shots [Default: False].
    conditional (bool): if True save the probabilities data conditional
                        on the current classical register values
                        [Default: False].
save_probabilities_dict)r   r   r   Nr   r   s         r   r   SaveProbabilitiesDict.__init__;   s)    , 	%%# 	 	
r   r   )probabilities_dictFFFr   r%   s   @r   r'   r'   8   s    6
 #
 
r   r'   Nc                 b    [        XS9n[        [        U5      UUUUS9nU R                  Xa5      $ a;  Save measurement outcome probabilities vector.

Args:
    qubits (list or None): the qubits to apply snapshot to. If None all
                           qubits will be snapshot [Default: None].
    label (str): the key for retrieving saved data from results.
    unnormalized (bool): If True return save the unnormalized accumulated
                         probabilities over all shots [Default: False].
    pershot (bool): if True save a list of probabilities for each shot
                    of the simulation rather than the average over
                    all shots [Default: False].
    conditional (bool): if True save the probabilities data conditional
                        on the current classical register values
                        [Default: False].

Returns:
    QuantumCircuit: with attached instruction.
)qubits)r   r   r   r   )r   r	   lenappendr   r/   r   r   r   r   instrs          r   r   r   [   s<    * D0FF!E ;;u%%r   c                 b    [        XS9n[        [        U5      UUUUS9nU R                  Xa5      $ r.   )r   r'   r0   r1   r2   s          r   r*   r*   {   s<    * D0F!F!E ;;u%%r   )Nr   FFF)
r"   qiskit.circuitr   	save_datar   r   r	   r'   r   r*   r   r   r   <module>r7      s[    * & + 
  
F 
O  
H ^c&B ^c&@ %7 !)@ &r   