§
    ¹³Ùgøy  ã                  ó€  — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZmZmZmZmZ ddlZddlmZ dd	lmZ dd
lmZmZ ddlmZmZ ddlmZmZmZ  ej          ej!        dej"        ¬¦  «         #                    dd¦  «        d¬¦  «         $                    d¬¦  «        Z%dd„Z&dd„Z'd d„Z( G d„ de¦  «        Z)dS )!z

BitArray
é    )Úannotations)Údefaultdict)Úpartial)ÚchainÚrepeat)ÚCallableÚIterableÚLiteralÚMappingÚSequenceN)ÚNDArray)ÚQiskitError)ÚCountsÚsampled_expectation_valueé   )ÚObservablesArrayÚObservablesArrayLike)ÚShapedMixinÚ
ShapeInputÚshape_tupleé   ©Údtypeéÿÿÿÿ©ÚaxisÚnum_bitsÚintÚreturnc                ó    — | dz  | dz  dk    z   S )z@Return the minimum number of bytes needed to store ``num_bits``.é   r   © ©r   s    ú\/granary/edev/quantum/lib/python3.11/site-packages/qiskit/primitives/containers/bit_array.pyÚ_min_num_bytesr%   %   s   € à�q‰=˜H q™L¨1Ò,Ñ-Ð-ó    Ú	bit_arrayÚBitArrayúNDArray[np.uint8]c                ój   — t          j        | j        dd¬¦  «        }|dd| j         dz
  d…f         }|S )Nr   Úbig©r   Úbitorder.r   )ÚnpÚ
unpackbitsÚarrayr   )r'   Úarrs     r$   Ú_unpackr2   *   s@   € Ý
Œ-˜	œ¨b¸5Ð
AÑ
AÔ
A€CØ
ˆc�2˜Ô+Ð+¨aÑ/°"Ð4Ð4Ô
5€CØ€Jr&   r1   útuple[NDArray[np.uint8], int]c                óÚ   — | dd d d…f         } | j         d         }| dz  }|dk    r+dg| j        dz
  z  |dfgz   }t          j        | |d¬¦  «        } t          j        | dd¬	¦  «        } | |fS )
N.r   r!   r   )r   r   r   )Úconstant_valuesr+   r,   )ÚshapeÚndimr.   ÚpadÚpackbits)r1   r   Úpad_sizeÚ	pad_widths       r$   Ú_packr<   0   s‡   € Ø
ˆc�4�4�R�4ˆiŒ.€CØŒy˜Œ}€HØˆy˜1‰}€HØ�!‚|€|Ø�H ¤¨1¡Ñ-°(¸A°°Ñ?ˆ	ÝŒf�S˜)°QÐ7Ñ7Ô7ˆÝ
Œ+�c ¨UÐ
3Ñ
3Ô
3€CØ�ˆ=Ðr&   c                  óÔ  ‡ — e Zd ZdZdOˆ fd„ZdPd„ZdQd„ZdRd„ZdSd„ZdQd„Z	dQd„Z
d„ Zd„ ZedTd„¦   «         ZedUd„¦   «         ZedUd„¦   «         ZedVd„¦   «         ZedWd„¦   «         ZdXd"„ZdYd$„Ze	 dZd[d)„¦   «         Ze	 d\d]d.„¦   «         Ze	 d\d^d1„¦   «         Zd\d_d3„Zd\d`d5„Zd\dad7„Zdbd:„ZdSd;„Zdcd>„Zdcd?„ZdddC„Z dedG„Z!edfdgdL„¦   «         Z"edhdM„¦   «         Z#edhdN„¦   «         Z$ˆ xZ%S )ir(   a9  Stores an array of bit values.

    This object contains a single, contiguous block of data that represents an array of bitstrings.
    The last axis is over packed bits, the second last axis is over shots, and the preceding axes
    correspond to the shape of the pub that was executed to sample these bits.
    r0   r)   r   r   c                óü  •— t          ¦   «                              ¦   «          t          |t          j        ¦  «        st          dt          |¦  «        › �¦  «        ‚|j        t          j        k    rt          d|j        › d�¦  «        ‚|j	        dk     rt          d¦  «        ‚|j        d         t          |¦  «        x}k    rt          d|› d�¦  «        ‚|| _        || _        | j        j        d	d
…         | _        d	S )a•  
        Args:
            array: The ``uint8`` data array.
            num_bits: How many bit are in each outcome.

        Raises:
            TypeError: If the input is not a NumPy array with type ``numpy.uint8``.
            ValueError: If the input array has fewer than two axes, or the size of the last axis
                is not the smallest number of bytes that can contain ``num_bits``.
        z"Input must be a numpy.ndarray not z'Input array must have dtype uint8, not ú.é   z,The input array must have at least two axes.r   z$The input array is expected to have z bytes per shot.Néþÿÿÿ)ÚsuperÚ__init__Ú
isinstancer.   ÚndarrayÚ	TypeErrorÚtyper   Úuint8r7   Ú
ValueErrorr6   r%   Ú_arrayÚ	_num_bitsÚ_shape)Úselfr0   r   ÚexpectedÚ	__class__s       €r$   rC   zBitArray.__init__C   sñ   ø€ õ 	‰Œ×ÒÑÔÐå˜%¥¤Ñ,Ô,ð 	PÝÐNÅÀeÁÄÐNÐNÑOÔOÐOØŒ;�"œ(Ò"Ð"ÝÐTÀeÄkÐTÐTÐTÑUÔUÐUØŒ:˜Š>ˆ>ÝÐKÑLÔLÐLØŒ;�rŒ?­>¸(Ñ+CÔ+CÐC˜xÒDÐDÝÐ^ÀHÐ^Ð^Ð^Ñ_Ô_Ð_àˆŒØ!ˆŒà”kÔ'¨¨¨Ô,ˆŒˆˆr&   Úotherú
'BitArray'r   útuple[NDArray[np.uint8], ...]c                óœ  — | j         |j         k    rt          d| › d|› d�¦  «        ‚| j        | j        fz   }|j        |j        fz   }	 t	          j        ||¦  «        | j        j        d         fz   }n(# t          $ r}t          | › d|› d�¦  «        |‚d}~ww xY wt	          j        | j        |¦  «        t	          j        |j        |¦  «        fS )zSValidation and broadcasting of two bit arrays before element-wise binary operation.z'num_bits' must match in z and r?   r   z' are not compatible for this operation.N)	r   rI   r6   Ú	num_shotsr.   Úbroadcast_shapesrJ   Úbroadcast_tor0   )rM   rP   Ú
self_shapeÚother_shaper6   Úexs         r$   Ú_prepare_broadcastablezBitArray._prepare_broadcastable^   sï   € àŒ=˜EœNÒ*Ð*ÝÐL¸ÐLÐLÀEÐLÐLÐLÑMÔMÐMØ”Z 4¤>Ð"3Ñ3ˆ
Ø”k U¤_Ð$6Ñ6ˆð	cÝÔ'¨
°KÑ@Ô@ÀDÄKÔDUÐVXÔDYÐC[Ñ[ˆEˆEøÝð 	cð 	cð 	cÝ ÐYÐY¨5ÐYÐYÐYÑZÔZÐ`bÐbøøøøð	cøøøåŒ˜tœz¨5Ñ1Ô1µ2´?À5Ä;ÐPUÑ3VÔ3VÐVÐVs   Á)A2 Á2
BÁ<BÂBc                ój   — t          t          j        |                      |¦  «        Ž | j        ¦  «        S ©N)r(   r.   Úbitwise_andrZ   r   ©rM   rP   s     r$   Ú__and__zBitArray.__and__j   ó)   € Ý�œ¨×(CÒ(CÀEÑ(JÔ(JÐKÈTÌ]Ñ[Ô[Ð[r&   Úboolc                óü   ‡— | j         x}|j         k    rdS | j        |j        g}|dz  dk    r@t          j        d| dz  z	  gdg|dz  z  z   t          j        ¬¦  «        Šˆfd„|D ¦   «         }t          j        |ddiŽS )NFr!   r   éÿ   r   c                ó:   •— g | ]}t          j        |‰¦  «        ‘ŒS r"   )r.   r]   )Ú.0r1   Úmasks     €r$   ú
<listcomp>z#BitArray.__eq__.<locals>.<listcomp>t   s%   ø€ Ð>Ð>Ð>°#•B”N 3¨Ñ-Ô-Ð>Ð>Ð>r&   Ú	equal_nan)r   rJ   r.   r0   rH   Úarray_equal)rM   rP   ÚnÚarrsrf   s       @r$   Ú__eq__zBitArray.__eq__m   s™   ø€ Ø”ÐˆA 5¤>Ò1Ð1Ø�5Ø”˜Uœ\Ð*ˆØˆq‰5�1Š9ˆ9å”8˜S q b¨A¡XÑ.Ð/°3°%¸1À¹6Ñ2BÑBÍ"Ì(ÐSÑSÔSˆDØ>Ð>Ð>Ð>¸Ð>Ñ>Ô>ˆDÝŒ~˜tÐ5¨uÐ5Ð5Ð5r&   c                óZ   — t          t          j        | j        ¦  «        | j        ¦  «        S r\   )r(   r.   Úbitwise_notrJ   r   ©rM   s    r$   Ú
__invert__zBitArray.__invert__w   s    € Ý�œ t¤{Ñ3Ô3°T´]ÑCÔCÐCr&   c                ój   — t          t          j        |                      |¦  «        Ž | j        ¦  «        S r\   )r(   r.   Ú
bitwise_orrZ   r   r^   s     r$   Ú__or__zBitArray.__or__z   s)   € Ý�œ t×'BÒ'BÀ5Ñ'IÔ'IÐJÈDÌMÑZÔZÐZr&   c                ój   — t          t          j        |                      |¦  «        Ž | j        ¦  «        S r\   )r(   r.   Úbitwise_xorrZ   r   r^   s     r$   Ú__xor__zBitArray.__xor__}   r`   r&   c                óD   — d| j         › d| j        › d| j        › d�}d|› d�S )Nz<shape=z, num_shots=z, num_bits=ú>z	BitArray(ú))r6   rT   r   )rM   Údescs     r$   Ú__repr__zBitArray.__repr__€   s9   € Ø\˜œÐ\Ð\°´Ð\Ð\ÈDÌMÐ\Ð\Ð\ˆØ"˜4Ð"Ð"Ð"Ð"r&   c                ó  — t          |t          ¦  «        rTt          |¦  «        | j        dz   k    rt	          d¦  «        ‚t          |¦  «        | j        dz   k    rt	          d¦  «        ‚t          | j        |         | j        ¦  «        S )Nr   zJBitArray cannot be sliced along the shots axis, use slice_shots() instead.r@   zHBitArray cannot be sliced along the bits axis, use slice_bits() instead.)rD   ÚtupleÚlenr7   Ú
IndexErrorr(   rJ   r   )rM   Úindicess     r$   Ú__getitem__zBitArray.__getitem__„   s‰   € Ý�g�uÑ%Ô%ð 	Ý�7‰|Œ|˜tœy¨1™}Ò,Ð,Ý Ø`ñô ð õ �7‰|Œ|˜tœy¨1™}Ò,Ð,Ý Ø^ñô ð õ ˜œ GÔ,¨d¬mÑ<Ô<Ð<r&   c                ó   — | j         S )zThe raw NumPy array of data.)rJ   ro   s    r$   r0   zBitArray.array�   s   € ð Œ{Ðr&   c                ó   — | j         S )z¥The number of bits in the register that this array stores data for.

        For example, a ``ClassicalRegister(5, "meas")`` would result in ``num_bits=5``.
        )rK   ro   s    r$   r   zBitArray.num_bits•   s   € ð Œ~Ðr&   c                ó&   — | j         j        d         S )z�The number of shots sampled from the register in each configuration.

        More precisely, the length of the second last axis of :attr:`~.array`.
        rA   )rJ   r6   ro   s    r$   rT   zBitArray.num_shots�   s   € ð Œ{Ô  Ô$Ð$r&   ÚdataÚbytesrf   Ústrc                ó’   — t                                | d¦  «        |z  }t          |¦  «        dd …                              |¦  «        S )Nr+   r@   )r   Ú
from_bytesÚbinÚzfill)r…   r   rf   Úvals       r$   Ú_bytes_to_bitstringzBitArray._bytes_to_bitstring¥   s<   € å�nŠn˜T 5Ñ)Ô)¨DÑ0ˆÝ�3‰xŒx˜˜˜Œ|×!Ò! (Ñ+Ô+Ð+r&   c                ó>   — t                                | d¦  «        |z  S )Nr+   )r   r‰   )r…   rf   s     r$   Ú_bytes_to_intzBitArray._bytes_to_intª   s   € å�~Š~˜d EÑ*Ô*¨TÑ1Ð1r&   Úlocúint | tuple[int, ...] | NoneÚ	converterúCallable[[bytes], str | int]údict[str, int] | dict[int, int]c               ó  — |€+| j                              d| j         j        d         ¦  «        n| j         |         }t          t          ¦  «        }|D ]-}| ||                     ¦   «         ¦  «        xx         dz  cc<   Œ.t          |¦  «        S )Nr   r   )rJ   Úreshaper6   r   r   ÚtobytesÚdict)rM   r�   r’   r1   ÚcountsÚshot_rows         r$   Ú_get_countszBitArray._get_counts®   s—   € ð ADÀˆdŒk×!Ò! " d¤kÔ&7¸Ô&;Ñ<Ô<Ð<ÐQUÔQ\Ð]`ÔQaˆå�SÑ!Ô!ˆØð 	7ð 	7ˆHØ�9�9˜X×-Ò-Ñ/Ô/Ñ0Ô0Ð1Ð1Ô1°QÑ6Ð1Ð1Ñ1Ð1Ý�F‰|Œ|Ðr&   úNDArray[np.uint64]c                óN   — t           | j                                      d¬¦  «        S )z³Compute the number of ones appearing in the binary representation of each shot.

        Returns:
            A ``numpy.uint64``-array with shape ``(*shape, num_shots)``.
        r   r   )Ú_WEIGHT_LOOKUPrJ   Úsumro   s    r$   ÚbitcountzBitArray.bitcount¸   s"   € õ ˜dœkÔ*×.Ò.°BÐ.Ñ7Ô7Ð7r&   r+   úNDArray[np.bool_]ÚorderúLiteral['big', 'little']c                óÖ  — t          j        | t          ¬¦  «        } | j        dk     rt	          d¦  «        ‚|dk    r| dddd…f         } n|dk    rt	          d	|› d
�¦  «        ‚| j        d         }| dz  x}rNt          j        t          | j        dd…         |¦  «        t          ¬¦  «        }t          j        || gd¬¦  «        } t          t          j
        | d¬¦  «        |¬¦  «        S )a©  Construct a new bit array from an array of bools.

        Args:
            array: The array to convert, with "bitstrings" along the last axis.
            order: One of ``"big"`` or ``"little"``, indicating whether ``array[..., 0]``
                correspond to the most significant bits or the least significant bits of each
                bitstring, respectively.

        Returns:
            A new bit array.
        r   r@   z"Expecting at least two dimensions.Úlittle.Nr   r+   zunknown value for order: 'z''. Valid values are 'big' and 'little'.r!   r   r#   )r.   Úasarrayra   r7   rI   r6   Úzerosr   Úconcatenater(   r9   )r0   r¢   r   Ú	remainderr8   s        r$   Úfrom_bool_arrayzBitArray.from_bool_arrayÀ   s  € õ ”
˜5­Ð-Ñ-Ô-ˆàŒ:˜Š>ˆ>ÝÐAÑBÔBÐBà�HÒÐà˜#˜t˜t ˜t˜)Ô$ˆEˆEØ�eŠ^ˆ^ÝØ[¨UÐ[Ð[Ð[ñô ð ð ”;˜r”?ˆØ"˜ a™Ð'ˆ9ð 	:õ ”(�; u¤{°3°B°3Ô'7¸ÑCÔCÍ4ÐPÑPÔPˆCÝ”N C¨ <°bÐ9Ñ9Ô9ˆEå�œ E°Ð3Ñ3Ô3¸hÐGÑGÔGÐGr&   Nr™   ú;Mapping[str | int, int] | Iterable[Mapping[str | int, int]]ú
int | Nonec                óª  — t          | t          ¦  «        x}r| g} n t          | ¦  «        } | st          d¦  «        ‚d„ | D ¦   «         } d„ | D ¦   «         }t                               ||¦  «        }|sb|j        t          | ¦  «        z  dk    rt          d¦  «        ‚|                     t          | ¦  «        |j        t          | ¦  «        z  ¦  «        }|S )a#  Construct a new bit array from one or more ``Counts``-like objects.

        The ``counts`` can have keys that are (uniformly) integers, hexstrings, or bitstrings.
        Their values represent numbers of occurrences of that value.

        Args:
            counts: One or more counts-like mappings with the same number of shots.
            num_bits: The desired number of bits per shot. If unset, the biggest value found sets
                this value, with a minimum of one bit.

        Returns:
            A new bit array with shape ``()`` for single input counts, or ``(N,)`` for an iterable
            of :math:`N` counts.

        Raises:
            ValueError: If different mappings have different numbers of shots.
            ValueError: If no counts dictionaries are supplied.
        z%At least one counts mapping expected.c                ód   — g | ]-}t          |t          ¦  «        r|                     ¦   «         n|‘Œ.S r"   )rD   r   Úint_outcomes)re   Úmappings     r$   rg   z(BitArray.from_counts.<locals>.<listcomp>  sE   € ð 
ð 
ð 
ØSZ¥j°½&Ñ&AÔ&AÐNˆG× Ò Ñ"Ô"Ð"Àwð
ð 
ð 
r&   c              3  ót   K  — | ]3}|                      ¦   «         D ]\  }}t          ||¦  «        D ]}|V — ŒŒŒ4d S r\   )Úitemsr   )re   r°   ÚvsÚcountÚvs        r$   ú	<genexpr>z'BitArray.from_counts.<locals>.<genexpr>  sU   è è € ÐdÐd�g¸¿º¹¼ÐdÐd©I¨B°ÕRXÐY[Ð]bÑRcÔRcÐdÐdÈQ�ÐdÐdÐdÐdÐdÐdÐdÐdr&   r   z;All of your mappings need to have the same number of shots.)	rD   r   ÚlistrI   r(   Úfrom_samplesrT   r~   r–   )r™   r   Ú	singletonr…   r'   s        r$   Úfrom_countszBitArray.from_countsä   sò   € õ. # 6­7Ñ3Ô3Ð3ˆ9ð 	JØ�XˆFˆFå˜&‘\”\ˆFØð JÝ Ð!HÑIÔIÐIð
ð 
Ø^dð
ñ 
ô 
ˆð eÐd ÐdÑdÔdˆå×)Ò)¨$°Ñ9Ô9ˆ	Øð 	[ØÔ"¥S¨¡[¤[Ñ0°1Ò4Ð4Ý Ð!^Ñ_Ô_Ð_Ø!×)Ò)­#¨f©+¬+°yÔ7JÍcÐRXÉkÌkÑ7YÑZÔZˆIØÐr&   ÚsamplesúIterable[str] | Iterable[int]c                ó¨  ‡‡— t          | ¦  «        } 	 t          | ¦  «        }n"# t          $ r}t          d¦  «        |‚d}~ww xY wt	          |g| ¦  «        }t          |t          ¦  «        r'|                     d¦  «        rdndŠˆfd„|D ¦   «         }|€>t          |¦  «        }t          t          t          j        |¦  «        ¦  «        }|dk    rd}t          |¦  «        Šd	                     ˆfd
„|D ¦   «         ¦  «        }t          j        |t          j        t%          |¦  «        ¬¦  «        }t'          |                     d‰¦  «        |¦  «        S )aò  Construct a new bit array from an iterable of bitstrings, hexstrings, or integers.

        All samples are assumed to be integers if the first one is. Strings are all assumed to be
        bitstrings whenever the first string doesn't start with ``"0x"``.

        Consider pairing this method with :meth:`~reshape` if your samples represent nested data.

        Args:
            samples: A list of bitstrings, a list of integers, or a list of hexstrings.
            num_bits: The desired number of bits per sample. If unset, the biggest sample provided
                is used to determine this value, with a minimum of one bit.

        Returns:
            A new bit array.

        Raises:
            ValueError: If no strings are given.
        z At least one sample is required.NÚ0xé   r@   c              3  ó:   •K  — | ]}t          |‰¬ ¦  «        V — ŒdS ))ÚbaseN)r   )re   rŒ   rÁ   s     €r$   r¶   z(BitArray.from_samples.<locals>.<genexpr>.  s0   øè è € Ð8Ð8¨C•C˜ $Ð'Ñ'Ô'Ð8Ð8Ð8Ð8Ð8Ð8r&   r   r   r&   c              3  óD   •K  — | ]}|                      ‰d ¦  «        V — ŒdS )r+   N)Úto_bytes)re   rŒ   Ú	num_bytess     €r$   r¶   z(BitArray.from_samples.<locals>.<genexpr>9  s1   øè è € ÐGÐG¸3˜Ÿš Y°Ñ6Ô6ÐGÐGÐGÐGÐGÐGr&   )r   r´   r   )ÚiterÚnextÚStopIterationrI   r   rD   r‡   Ú
startswithr·   ÚmaxÚmapr   Ú
bit_lengthr%   Újoinr.   Ú
frombufferrH   r~   r(   r–   )	r»   r   Úfirst_samplerY   Úintsr…   r0   rÁ   rÄ   s	          @@r$   r¸   zBitArray.from_samples  sY  øø€ õ, �w‘-”-ˆð	IÝ ™=œ=ˆLˆLøÝð 	Ið 	Ið 	IÝÐ?Ñ@Ô@ÀbÐHøøøøð	Iøøøõ �l�^ WÑ-Ô-ˆÝ�l¥CÑ(Ô(ð 	9Ø%×0Ò0°Ñ6Ô6Ð=�2�2¸AˆDØ8Ð8Ð8Ð8°4Ð8Ñ8Ô8ˆDàÐå˜‘:”:ˆDÝ�3�sœ~¨tÑ4Ô4Ñ5Ô5ˆHà˜1Š}ˆ}Ø�å" 8Ñ,Ô,ˆ	Ø�xŠxÐGÐGÐGÐGÀ$ÐGÑGÔGÑGÔGˆÝ”˜d­"¬(½#¸d¹)¼)ÐDÑDÔDˆÝ˜Ÿš b¨)Ñ4Ô4°hÑ?Ô?Ð?s   “# £
A­=½Aúdict[str, int]c                ó‚   — d| j         z  dz
  }t          | j        | j         |¬¦  «        }|                      ||¬¦  «        S )aW  Return a counts dictionary with bitstring keys.

        Args:
            loc: Which entry of this array to return a dictionary for. If ``None``, counts from
                all positions in this array are unioned together.

        Returns:
            A dictionary mapping bitstrings to the number of occurrences of that bitstring.
        r@   r   ©r   rf   ©r�   r’   )r   r   r�   r›   )rM   r�   rf   r’   s       r$   Ú
get_countszBitArray.get_counts=  sH   € ð �$”-Ñ !Ñ#ˆÝ˜DÔ4¸t¼}ÐSWÐXÑXÔXˆ	Ø×Ò C°9ÐÑ=Ô=Ð=r&   údict[int, int]c                ór   — t          | j        d| j        z  dz
  ¬¦  «        }|                      ||¬¦  «        S )aj  Return a counts dictionary, where bitstrings are stored as ``int``\s.

        Args:
            loc: Which entry of this array to return a dictionary for. If ``None``, counts from
                all positions in this array are unioned together.

        Returns:
            A dictionary mapping ``ints`` to the number of occurrences of that ``int``.

        r@   r   )rf   rÓ   )r   r�   r   r›   )rM   r�   r’   s      r$   Úget_int_countszBitArray.get_int_countsK  s>   € õ ˜DÔ.°Q¸¼Ñ5EÈÑ5IÐJÑJÔJˆ	Ø×Ò C°9ÐÑ=Ô=Ð=r&   ú	list[str]c                óæ   ‡— d| j         z  dz
  }t          | j        | j         |¬¦  «        Š|€+| j                             d| j        j        d         ¦  «        n| j        |         }ˆfd„|D ¦   «         S )a
  Return a list of bitstrings.

        Args:
            loc: Which entry of this array to return a dictionary for. If ``None``, counts from
                all positions in this array are unioned together.

        Returns:
            A list of bitstrings.
        r@   r   rÒ   Nr   c                óJ   •— g | ]} ‰|                      ¦   «         ¦  «        ‘Œ S r"   )r—   )re   rš   r’   s     €r$   rg   z+BitArray.get_bitstrings.<locals>.<listcomp>f  s/   ø€ ÐBÐBÐB°(�	�	˜(×*Ò*Ñ,Ô,Ñ-Ô-ÐBÐBÐBr&   )r   r   r�   rJ   r–   r6   )rM   r�   rf   r1   r’   s       @r$   Úget_bitstringszBitArray.get_bitstringsY  s~   ø€ ð �$”-Ñ !Ñ#ˆÝ˜DÔ4¸t¼}ÐSWÐXÑXÔXˆ	Ø@CÀˆdŒk×!Ò! " d¤kÔ&7¸Ô&;Ñ<Ô<Ð<ÐQUÔQ\Ð]`ÔQaˆØBÐBÐBÐB¸cÐBÑBÔBÐBr&   r6   r   c                ó–  — t          |¦  «        }t          j        |t          ¬¦  «        x}| j        k    r#t          || j        j        dd…         ¦  «        }nE|| j        | j        z  k    r#t          || j        j        dd…         ¦  «        }nt          d¦  «        ‚t          | j         
                    |¦  «        | j        ¦  «        S )aè  Return a new reshaped bit array.

        The :attr:`~num_shots` axis is either included or excluded from the reshaping procedure
        depending on which picture the new shape is compatible with. For example, for a bit array
        with shape ``(20, 5)`` and ``64`` shots, a reshape to ``(100,)`` would leave the
        number of shots intact, whereas a reshape to ``(200, 32)`` would change the number of
        shots to ``32``.

        Args:
            *shape: The new desired shape.

        Returns:
            A new bit array.

        Raises:
            ValueError: If the size corresponding to your new shape is not equal to either
                :attr:`~size`, or the product of :attr:`~size` and :attr:`~num_shots`.
        r   rA   Nr   z$Cannot change the size of the array.)r   r.   Úprodr   ÚsizerJ   r6   rT   rI   r(   r–   r   )rM   r6   rÞ   s      r$   r–   zBitArray.reshapeh  sµ   € õ& ˜EÑ"Ô"ˆÝ”G˜E­Ð-Ñ-Ô-Ð-ˆD°$´)Ò;Ð;Ý  t¤{Ô'8¸¸¸Ô'=Ñ>Ô>ˆEˆEØ�T”Y ¤Ñ/Ò/Ð/Ý  t¤{Ô'8¸¸¸Ô'=Ñ>Ô>ˆEˆEåÐCÑDÔDÐDÝ˜œ×+Ò+¨EÑ2Ô2°D´MÑBÔBÐBr&   c                óH  ‡ — t          |¦  «        dk    r.t          t          t          ‰ j        ¦  «        ¦  «        ¦  «        }t          |¦  «        dk    r#t          |d         t          ¦  «        r|d         }t          |¦  «        ‰ j        k    rt          d¦  «        ‚|D ]6}|‰ j        k    s‰ j        |z   dk     rt          d|› d‰ j        › d�¦  «        ‚Œ7t          ˆ fd„|D ¦   «         ¦  «        dz   }t          ‰ j	         
                    |¦  «        ‰ j        ¦  «        S )	a  Return a bit array with axes transposed.

        Args:
            axes: None, tuple of ints or n ints. See `ndarray.transpose
                <https://numpy.org/doc/stable/reference/generated/
                numpy.ndarray.transpose.html#numpy.ndarray.transpose>`_
                for the details.

        Returns:
            BitArray: A bit array with axes permuted.

        Raises:
            ValueError: If ``axes`` don't match this bit array.
            ValueError: If ``axes`` includes any indices that are out of bounds.
        r   r   zaxes don't match bit arrayúaxis ú- is out of bounds for bit array of dimension r?   c              3  ó<   •K  — | ]}|d k    r|n	‰j         |z   V — ŒdS )r   N)r7   )re   ÚirM   s     €r$   r¶   z%BitArray.transpose.<locals>.<genexpr>Ÿ  s5   øè è € ÐBÐB¸˜!˜qš&˜&�Q�Q d¤i°!¡mÐBÐBÐBÐBÐBÐBr&   )rA   r   )r~   r}   ÚreversedÚranger7   rD   r   rI   r(   rJ   Ú	transposer   )rM   Úaxesrã   s   `  r$   ræ   zBitArray.transpose„  s#  ø€ õ  ˆt‰9Œ9˜Š>ˆ>Ý�¥%¨¬	Ñ"2Ô"2Ñ3Ô3Ñ4Ô4ˆDÝˆt‰9Œ9˜Š>ˆ>�j¨¨a¬µ(Ñ;Ô;ˆ>Ø˜”7ˆDÝˆt‰9Œ9˜œ	Ò!Ð!ÝÐ9Ñ:Ô:Ð:Øð 	ð 	ˆAØ�D”IŠ~ˆ~ ¤¨Q¡°Ò!2Ð!2Ý ØX˜AÐXÐXÈDÌIÐXÐXÐXñô ð ð "3õ ÐBÐBÐBÐB¸TÐBÑBÔBÑBÔBÀXÑMˆÝ˜œ×-Ò-¨dÑ3Ô3°T´]ÑCÔCÐCr&   r€   úint | Sequence[int]c                ó
  — t          |t          ¦  «        r|f}|D ].}|dk     s|| j        k    rt          d|› d| j        › d�¦  «        ‚Œ/t	          | ¦  «        }|d|f         }t          |¦  «        \  }}t          ||¦  «        S )a  Return a bit array sliced along the bit axis of some indices of interest.

        .. note::

            The convention used by this method is that the index ``0`` corresponds to
            the least-significant bit in the :attr:`~array`, or equivalently
            the right-most bitstring entry as returned by
            :meth:`~get_counts` or :meth:`~get_bitstrings`, etc.

            If this bit array was produced by a sampler, then an index ``i`` corresponds to the
            :class:`~.ClassicalRegister` location ``creg[i]``.

        Args:
            indices: The bit positions of interest to slice along.

        Returns:
            A bit array sliced along the bit axis.

        Raises:
            IndexError: If there are any invalid indices of the bit axis.
        r   úindex z) is out of bounds for the number of bits r?   .)rD   r   r   r   r2   r<   r(   )rM   r€   Úindexr1   r   s        r$   Ú
slice_bitszBitArray.slice_bits¢  sª   € õ, �g�sÑ#Ô#ð 	!Ø�jˆGØð 	ð 	ˆEØ�qŠyˆy˜E T¤]Ò2Ð2Ý Ø]˜UÐ]Ð]ÈTÌ]Ð]Ð]Ð]ñô ð ð 3õ �d‰mŒmˆØ�#�w�,ÔˆÝ˜c™
œ
‰ˆˆXÝ˜˜XÑ&Ô&Ð&r&   c                óæ   — t          |t          ¦  «        r|f}|D ].}|dk     s|| j        k    rt          d|› d| j        › d�¦  «        ‚Œ/| j        }|d|dd…f         }t          || j        ¦  «        S )aL  Return a bit array sliced along the shots axis of some indices of interest.

        Args:
            indices: The shots positions of interest to slice along.

        Returns:
            A bit array sliced along the shots axis.

        Raises:
            IndexError: If there are any invalid indices of the shots axis.
        r   rê   z* is out of bounds for the number of shots r?   .N)rD   r   rT   r   rJ   r(   r   )rM   r€   rë   r1   s       r$   Úslice_shotszBitArray.slice_shotsÇ  sŸ   € õ �g�sÑ#Ô#ð 	!Ø�jˆGØð 	ð 	ˆEØ�qŠyˆy˜E T¤^Ò3Ð3Ý Ø_˜UÐ_Ð_ÈdÌnÐ_Ð_Ð_ñô ð ð 4ð ŒkˆØ�#�w   �/Ô"ˆÝ˜˜Tœ]Ñ+Ô+Ð+r&   úSequence[int] | intÚ	selectionú!Sequence[bool | int] | bool | intc                ó|  — t          |t          ¦  «        r|f}t          |t          t          f¦  «        r|f}t          j        |t          ¬¦  «        }t          |¦  «        }t          |¦  «        |k    rt          d¦  «        ‚| j        j        d         }t          j        |¦  «        }|dk    r¯| 	                    ¦   «         | j
        k    r:t          dt          | 	                    ¦   «         ¦  «        › d| j
        › d�¦  «        ‚|                     ¦   «         | j
         k     r:t          dt          |                     ¦   «         ¦  «        › d| j
        › d�¦  «        ‚|                      d| j        | j        z  ¦  «        }|dk    r|S || j
        z  }t          j        ||         |t          j        |¦  «                 ¦  «        j        dk    r6t%          t          j        d|ft          j        ¬¦  «        | j
        ¬	¦  «        S t          j        |d
¦  «        \  }}|dz
  |z
  }|                     t          j        ¦  «        }	t          j        |t          j        ¬¦  «        }
t          j                             |
|t          j        d¦  «        |	z  ¦  «         t          j        |t          j        ¬¦  «        }t          j                             ||t          j        |t          j        ¬¦  «        |	z  ¦  «         t%          |j        |j        |
z  |k                         d¬¦  «                 | j
        ¬	¦  «        S )av  Post-select this bit array based on sliced equality with a given bitstring.

        .. note::
            If this bit array contains any shape axes, it is first flattened into a long list of shots
            before applying post-selection. This is done because :class:`~BitArray` cannot handle
            ragged numbers of shots across axes.

        Args:
            indices: A list of the indices of the cbits on which to postselect.
                If this bit array was produced by a sampler, then an index ``i`` corresponds to the
                :class:`~.ClassicalRegister` location ``creg[i]`` (as in :meth:`~slice_bits`).
                Negative indices are allowed.

            selection: A list of binary values (will be cast to ``bool``) of length matching
                ``indices``, with ``indices[i]`` corresponding to ``selection[i]``. Shots will be
                discarded unless all cbits specified by ``indices`` have the values given by
                ``selection``.

        Returns:
            A new bit array with ``shape=(), num_bits=data.num_bits, num_shots<=data.num_shots``.

        Raises:
            IndexError: If ``max(indices)`` is greater than or equal to :attr:`num_bits`.
            IndexError: If ``min(indices)`` is less than negative :attr:`num_bits`.
            ValueError: If the lengths of ``selection`` and ``indices`` do not match.
        r   z.Lengths of indices and selection do not match.r   r   rê   z& out of bounds for the number of bits r?   r"   r#   r!   r   r   )rD   r   ra   r.   r¦   r~   rI   rJ   r6   rÉ   r   r   Úminr–   rÞ   rT   Úintersect1dÚlogical_notr(   ÚemptyrH   ÚdivmodÚastyper§   rr   ÚatÚall)rM   r€   rð   Únum_indicesrÄ   Ú	flattenedÚbyte_significanceÚbit_significanceÚbyte_idxÚ
bit_offsetÚbitmaskÚselection_bytess               r$   Ú
postselectzBitArray.postselectÞ  sõ  € õ> �g�sÑ#Ô#ð 	!Ø�jˆGÝ�i¥$­ Ñ-Ô-ð 	%Ø"˜ˆIÝ”J˜yµÐ5Ñ5Ô5ˆ	å˜'‘l”lˆåˆy‰>Œ>˜[Ò(Ð(ÝÐMÑNÔNÐNà”KÔ% bÔ)ˆ	Ý”*˜WÑ%Ô%ˆà˜Š?ˆ?Ø�{Š{‰}Œ} ¤Ò-Ð-Ý Øg�S §¢¡¤Ñ/Ô/ÐgÐgÐW[ÔWdÐgÐgÐgñô ð ð �{Š{‰}Œ} ¤˜~Ò-Ð-Ý Øg�S §¢¡¤Ñ/Ô/ÐgÐgÐW[ÔWdÐgÐgÐgñô ð ð —L’L  T¤Y°´Ñ%?Ñ@Ô@ˆ	ð ˜!ÒÐØÐð 	�4”=Ñ ˆõ Œ>˜' )Ô,¨gµb´nÀYÑ6OÔ6OÔ.PÑQÔQÔVÐYZÒZÐZÝ�BœH a¨ ^½2¼8ÐDÑDÔDÈtÌ}Ð]Ñ]Ô]Ð]õ /1¬i¸ÀÑ.CÔ.CÑ+ÐÐ+à ‘MÐ%6Ñ6ˆà%×,Ò,­R¬XÑ6Ô6ˆ
õ ”(˜9­B¬HÐ5Ñ5Ô5ˆÝ
Œ×Ò˜ (­B¬H°Q©K¬K¸:Ñ,EÑFÔFÐFõ œ( 9µB´HÐ=Ñ=Ô=ˆå
Œ×ÒØ˜X¥r¤z°)Å2Ä8Ð'LÑ'LÔ'LÐPZÑ'Zñ	
ô 	
ð 	
õ ØÔ˜yÔ/°'Ñ9¸oÒM×RÒRÐXZÐRÑ[Ô[Ô\Ø”]ð
ñ 
ô 
ð 	
r&   Úobservablesr   úNDArray[np.float64]c                ó�  — t          j        |¦  «        }t          j        t          j        | j        ¦  «        t          ¬¦  «                             | j        ¦  «        }t          j        ||¦  «        \  }}i }t          j	        |t          ¬¦  «        }t          j        |j        ¦  «        D ]˜}||         }||                              ¦   «         D ]s\  }	}
||vr|                      |¦  «        ||<   	 t          ||         |	¦  «        }n'# t          $ r}t          |j        ¦  «        |‚d}~ww xY w||xx         ||
z  z  cc<   ŒtŒ™|S )aƒ  Compute the expectation values of the provided observables, broadcasted against
        this bit array.

        .. note::

            This method returns the real part of the expectation value even if
            the operator has complex coefficients due to the specification of
            :func:`~.sampled_expectation_value`.

        Args:
            observables: The observable(s) to take the expectation value of.
            Must have a shape broadcastable with with this bit array and
            the same number of qubits as the number of bits of this bit array.
            The observables must be diagonal (I, Z, 0 or 1) too.

        Returns:
            An array of expectation values whose shape is the broadcast shape of ``observables``
            and this bit array.

        Raises:
            ValueError: If the provided observables does not have a shape broadcastable with
                this bit array.
            ValueError: If the provided observables does not have the same number of qubits as
                the number of bits of this bit array.
            ValueError: If the provided observables are not diagonal.
        r   N)r   Úcoercer.   ÚfromiterÚndindexr6   Úobjectr–   Úbroadcast_arraysÚ
zeros_likeÚfloatr²   rÔ   r   r   rI   Úmessage)rM   r  Úarr_indicesÚ
bc_indicesÚbc_obsr™   r1   rë   r�   ÚpauliÚcoeffÚexpvalrY   s                r$   Úexpectation_valueszBitArray.expectation_values9  sR  € õ6 'Ô-¨kÑ:Ô:ˆÝ”k¥"¤*¨T¬ZÑ"8Ô"8ÅÐGÑGÔG×OÒOÐPTÔPZÑ[Ô[ˆÝÔ0°¸kÑJÔJÑˆ
�FØˆÝŒm˜J­eÐ4Ñ4Ô4ˆÝ”Z 
Ô 0Ñ1Ô1ð 		-ð 		-ˆEØ˜UÔ#ˆCØ & u¤× 3Ò 3Ñ 5Ô 5ð -ð -‘��uØ˜fÐ$Ð$Ø"&§/¢/°#Ñ"6Ô"6�F˜3‘Kð9Ý6°v¸c´{ÀEÑJÔJ�F�FøÝ"ð 9ð 9ð 9Ý$ R¤ZÑ0Ô0°bÐ8øøøøð9øøøà�E�
�
”
˜f u™nÑ,�
�
‘
�
ð-ð ˆ
s   Ã3D
Ä

D.ÄD)Ä)D.r   Ú
bit_arraysúSequence[BitArray]r   c           
     ó‚  — t          | ¦  «        dk    rt          d¦  «        ‚| d         j        }| d         j        }| d         j        }|dk    rt          d¦  «        ‚t          | ¦  «        D ]€\  }}|j        |k    rt          d|› d|› d|j        › d�¦  «        ‚|j        |k    rt          d|› d	|› d|j        › d
�¦  «        ‚|j        |k    rt          d|› d|› d|j        › d�¦  «        ‚Œ�|dk     s||k    rt          d|› d|› d�¦  «        ‚t          j        d„ | D ¦   «         |¬¦  «        }t          ||¦  «        S )a  Join a sequence of bit arrays along an existing axis.

        Args:
            bit_arrays: The bit arrays must have (1) the same number of bits,
                (2) the same number of shots, and
                (3) the same shape, except in the dimension corresponding to axis
                (the first, by default).
            axis: The axis along which the arrays will be joined. Default is 0.

        Returns:
            The concatenated bit array.

        Raises:
            ValueError: If the sequence of bit arrays is empty.
            ValueError: If any bit arrays has a different number of bits.
            ValueError: If any bit arrays has a different number of shots.
            ValueError: If any bit arrays has a different number of dimensions.
        r   z*Need at least one bit array to concatenatez2Zero-dimensional bit arrays cannot be concatenatedúOAll bit arrays must have same number of bits, but the bit array at index 0 has ú! bits and the bit array at index ú has ú bits.úPAll bit arrays must have same number of shots, but the bit array at index 0 has ú" shots and the bit array at index ú shots.zUAll bit arrays must have same number of dimensions, but the bit array at index 0 has z) dimension(s) and the bit array at index z dimension(s).rà   rá   r?   c                ó   — g | ]	}|j         ‘Œ
S r"   ©r0   ©re   Úbas     r$   rg   z(BitArray.concatenate.<locals>.<listcomp>•  ó   € Ð=Ð=Ð=¨B˜rœxÐ=Ð=Ð=r&   r   )	r~   rI   r   rT   r7   Ú	enumerater.   r¨   r(   )r  r   r   rT   r7   rã   r#  r…   s           r$   r¨   zBitArray.concatenatee  sù  € õ( ˆz‰?Œ?˜aÒÐÝÐIÑJÔJÐJØ˜a”=Ô)ˆØ˜q”MÔ+ˆ	Ø˜!Œ}Ô!ˆØ�1Š9ˆ9ÝÐQÑRÔRÐRÝ˜zÑ*Ô*ð 	ð 	‰EˆAˆrØŒ{˜hÒ&Ð&Ý ðNØ8@ðNð Nà23ðNð Nà:<¼+ðNð Nð Nñô ð ð
 Œ|˜yÒ(Ð(Ý ðPØ8AðPð Pà23ðPð Pà:<¼,ðPð Pð Pñô ð ð
 Œw˜$ŠˆÝ ðRØ8<ðRð Rà23ðRð Rà:<¼'ðRð Rð Rñô ð ð ð �!Š8ˆ8�t˜t’|�|ÝÐ_ TÐ_Ð_ÐX\Ð_Ð_Ð_Ñ`Ô`Ð`ÝŒ~Ð=Ð=°*Ð=Ñ=Ô=ÀDÐIÑIÔIˆÝ˜˜hÑ'Ô'Ð'r&   c           
     ó¨  — t          | ¦  «        dk    rt          d¦  «        ‚| d         j        }| d         j        }t	          | ¦  «        D ]W\  }}|j        |k    rt          d|› d|› d|j        › d�¦  «        ‚|j        |k    rt          d|› d|› d	|j        › d
�¦  «        ‚ŒXt          j        d„ | D ¦   «         d¬¦  «        }t          ||¦  «        S )aÒ  Join a sequence of bit arrays along the shots axis.

        Args:
            bit_arrays: The bit arrays must have (1) the same number of bits,
                and (2) the same shape.

        Returns:
            The stacked bit array.

        Raises:
            ValueError: If the sequence of bit arrays is empty.
            ValueError: If any bit arrays has a different number of bits.
            ValueError: If any bit arrays has a different shape.
        r   ú$Need at least one bit array to stackr  r  r  r  úLAll bit arrays must have same shape, but the bit array at index 0 has shape ú and the bit array at index ú has shape r?   c                ó   — g | ]	}|j         ‘Œ
S r"   r!  r"  s     r$   rg   z.BitArray.concatenate_shots.<locals>.<listcomp>¹  r$  r&   rA   r   )r~   rI   r   r6   r%  r.   r¨   r(   )r  r   r6   rã   r#  r…   s         r$   Úconcatenate_shotszBitArray.concatenate_shots˜  sG  € õ  ˆz‰?Œ?˜aÒÐÝÐCÑDÔDÐDØ˜a”=Ô)ˆØ˜1”Ô#ˆÝ˜zÑ*Ô*ð 	ð 	‰EˆAˆrØŒ{˜hÒ&Ð&Ý ðNØ8@ðNð Nà23ðNð Nà:<¼+ðNð Nð Nñô ð ð
 Œx˜5Ò Ð Ý ðLØ>CðLð Là23ðLð Là@BÄðLð Lð Lñô ð ð !õ Œ~Ð=Ð=°*Ð=Ñ=Ô=ÀBÐGÑGÔGˆÝ˜˜hÑ'Ô'Ð'r&   c           
     óÌ  — t          | ¦  «        dk    rt          d¦  «        ‚| d         j        }| d         j        }t	          | ¦  «        D ]W\  }}|j        |k    rt          d|› d|› d|j        › d�¦  «        ‚|j        |k    rt          d|› d|› d	|j        › d
�¦  «        ‚ŒXt          j        d„ | D ¦   «         d¬¦  «        }t          |¦  «        \  }}t          ||¦  «        S )a-  Join a sequence of bit arrays along the bits axis.

        .. note::
            This method is equivalent to per-shot bitstring concatenation.

        Args:
            bit_arrays: Bit arrays that have (1) the same number of shots,
                and (2) the same shape.

        Returns:
            The stacked bit array.

        Raises:
            ValueError: If the sequence of bit arrays is empty.
            ValueError: If any bit arrays has a different number of shots.
            ValueError: If any bit arrays has a different shape.
        r   r'  r  r  r  r  r(  r)  r*  r?   c                ó,   — g | ]}t          |¦  «        ‘ŒS r"   )r2   r"  s     r$   rg   z-BitArray.concatenate_bits.<locals>.<listcomp>ã  s   € Ð@Ð@Ð@¨r�w r™{œ{Ð@Ð@Ð@r&   r   r   )	r~   rI   rT   r6   r%  r.   r¨   r<   r(   )r  rT   r6   rã   r#  r…   r   s          r$   Úconcatenate_bitszBitArray.concatenate_bits¼  sV  € õ& ˆz‰?Œ?˜aÒÐÝÐCÑDÔDÐDØ˜q”MÔ+ˆ	Ø˜1”Ô#ˆÝ˜zÑ*Ô*ð 	ð 	‰EˆAˆrØŒ|˜yÒ(Ð(Ý ðPØ8AðPð Pà23ðPð Pà:<¼,ðPð Pð Pñô ð ð
 Œx˜5Ò Ð Ý ðLØ>CðLð Là23ðLð Là@BÄðLð Lð Lñô ð ð !õ Œ~Ð@Ð@°ZÐ@Ñ@Ô@ÀrÐJÑJÔJˆÝ˜t™œ‰ˆˆhÝ˜˜hÑ'Ô'Ð'r&   )r0   r)   r   r   )rP   rQ   r   rR   )rP   rQ   r   rQ   )rP   rQ   r   ra   )r   rQ   )r   r)   )r   r   )r…   r†   r   r   rf   r   r   r‡   )r…   r†   rf   r   r   r   )r�   r‘   r’   r“   r   r”   )r   rœ   )r+   )r0   r¡   r¢   r£   r   rQ   r\   )r™   r«   r   r¬   r   rQ   )r»   r¼   r   r¬   r   rQ   )r�   r‘   r   rÐ   )r�   r‘   r   rÕ   )r�   r‘   r   rØ   )r6   r   r   rQ   )r€   rè   r   rQ   )r€   rï   rð   rñ   r   r(   )r  r   r   r  )r   )r  r  r   r   r   r(   )r  r  r   r(   )&Ú__name__Ú
__module__Ú__qualname__Ú__doc__rC   rZ   r_   rl   rp   rs   rv   r{   r�   Úpropertyr0   r   rT   Ústaticmethodr�   r�   r›   r    rª   rº   r¸   rÔ   r×   rÛ   r–   ræ   rì   rî   r  r  r¨   r,  r/  Ú__classcell__)rO   s   @r$   r(   r(   ;   s~  ø€ € € € € ðð ð-ð -ð -ð -ð -ð -ð6
Wð 
Wð 
Wð 
Wð\ð \ð \ð \ð6ð 6ð 6ð 6ðDð Dð Dð Dð[ð [ð [ð [ð\ð \ð \ð \ð#ð #ð #ð
=ð 
=ð 
=ð ðð ð ñ „Xðð ðð ð ñ „Xðð ð%ð %ð %ñ „Xð%ð ð,ð ,ð ,ñ „\ð,ð ð2ð 2ð 2ñ „\ð2ðð ð ð ð8ð 8ð 8ð 8ð àDIð!Hð !Hð !Hð !Hñ „\ð!HðF ð  $ð(ð (ð (ð (ñ „\ð(ðT àGKð+@ð +@ð +@ð +@ñ „\ð+@ðZ>ð >ð >ð >ð >ð>ð >ð >ð >ð >ðCð Cð Cð Cð CðCð Cð Cð Cð8Dð Dð Dð Dð<#'ð #'ð #'ð #'ðJ,ð ,ð ,ð ,ð.Y
ð Y
ð Y
ð Y
ðv*ð *ð *ð *ðX ð0(ð 0(ð 0(ð 0(ñ „\ð0(ðd ð!(ð !(ð !(ñ „\ð!(ðF ð((ð ((ð ((ñ „\ð((ð ((ð ((ð ((ð ((r&   )r   r   r   r   )r'   r(   r   r)   )r1   r)   r   r3   )*r3  Ú
__future__r   Úcollectionsr   Ú	functoolsr   Ú	itertoolsr   r   Útypingr   r	   r
   r   r   Únumpyr.   Únumpy.typingr   Úqiskit.exceptionsr   Úqiskit.resultr   r   Úobservables_arrayr   r   r6   r   r   r   r/   ÚarangerH   r–   rŸ   rž   r%   r2   r<   r(   r"   r&   r$   ú<module>rB     sÏ  ððð ð #Ð "Ð "Ð "Ð "Ð "à #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ Aà Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  à )Ð )Ð )Ð )Ð )Ð )Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;à EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7ð �”˜y˜rœy¨°B´HÐ=Ñ=Ô=×EÒEÀbÈ!ÑLÔLÐSTÐUÑUÔU×YÒYÐ_`ÐYÑaÔa€ð.ð .ð .ð .ð
ð ð ð ðð ð ð ðj
(ð j
(ð j
(ð j
(ð j
(ˆ{ñ j
(ô j
(ð j
(ð j
(ð j
(r&   