
    z	i
                    V    S r SSKJr  SSKJr  SSKrSSKJr  SSK	J
r
   " S S	\
5      rg)
z
Sampler Pub result class
    )annotations)IterableN   )BitArray)	PubResultc                  &    \ rS rSrSrSSS jjrSrg)SamplerPubResult   zResult of Sampler Pub.Nc                   Uc(  [        U R                  5      nU(       d  [        S5      eOD[        U5      nU(       d  [        S5      eU H!  nX R                  ;  d  M  [        SU S35      e   U Vs/ s H  o R                  U   PM     nn[        US   [        5      (       a:  [        S U 5       5      (       d  [        S5      e[        R                  " U5      nU$ [        US   [        R                  5      (       a9  [        S U 5       5      (       d  [        S5      e[        R                  " US	S
9nU$ [        S5      es  snf )a  Join data from many registers into one data container.

Data is joined along the bits axis. For example, for :class:`~.BitArray` data, this corresponds
to bitstring concatenation.

Args:
    names: Which registers to join. Their order is maintained, for example, given
        ``["alpha", "beta"]``, the data from register ``alpha`` is placed to the left of the
        data from register ``beta``. When ``None`` is given, this value is set to the
        ordered list of register names, which will have been preserved from the input circuit
        order.

Returns:
    Joint data.

Raises:
    ValueError: If specified names are empty.
    ValueError: If specified name does not exist.
    TypeError: If specified data comes from incompatible types.
z No entry exists in the data bin.zAn empty name list is given.zName 'z' does not exist.r   c              3  B   #    U  H  n[        U[        5      v   M     g 7fN)
isinstancer   .0datums     i/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/primitives/containers/sampler_pub_result.py	<genexpr>-SamplerPubResult.join_data.<locals>.<genexpr>A   s     Euz%22s   z#Data comes from incompatible types.c              3  V   #    U  H  n[        U[        R                  5      v   M!     g 7fr   )r   npndarrayr   s     r   r   r   E   s     G$z%44$s   '))axis)listdata
ValueErrorr   r   all	TypeErrorconcatenate_bitsr   r   concatenate)selfnamesnamer   
joint_datas        r   	join_dataSamplerPubResult.join_data   s.   * =OE !CDD  KE !?@@yy($vdV3D%EFF  -22ED		$E2d1gx((EEEE EFF!2248J  Q,,G$GGG EFF26J  ABB 3s   4E r   )r"   zIterable[str] | NonereturnzBitArray | np.ndarray)__name__
__module____qualname____firstlineno____doc__r%   __static_attributes__r'       r   r	   r	      s     , ,r/   r	   )r-   
__future__r   typingr   numpyr   	bit_arrayr   
pub_resultr   r	   r'   r/   r   <module>r5      s'    #    !/y /r/   