§
    ¹³Ùg÷A  ã                   ó
  — d Z ddlmZ ddlZddlZddlmZ ddl	m
Z
mZ ddlmZ ddlmZ d	„ Zg d
¢ZdeiZdefd„Z	 	 	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 dd„Zej        j        	 	 	 	 	 	 	 	 	 	 	 dd„¦   «         Zd„ Zd„ Zdd„ZdS )z1
Visualization functions for measurement counts.
é    )ÚOrderedDictN)Ú	optionals)ÚQuasiDistributionÚProbDistributioné   )ÚVisualizationError)Úmatplotlib_close_if_inlinec                 ó®   — t          | ¦  «        t          |¦  «        k    rt          d¦  «        ‚t          d„ t          | |¦  «        D ¦   «         ¦  «        S )zÿCalculate the Hamming distance between two bit strings

    Args:
        str1 (str): First string.
        str2 (str): Second string.
    Returns:
        int: Distance between strings.
    Raises:
        VisualizationError: Strings not same length
    zStrings not same length.c              3   ó(   K  — | ]\  }}||k    V — Œd S ©N© )Ú.0Ús1Ús2s      ú_/granary/edev/quantum/lib/python3.11/site-packages/qiskit/visualization/counts_visualization.pyú	<genexpr>z#hamming_distance.<locals>.<genexpr>)   s*   è è € Ð6Ð6™F˜B ˆr�RŠxÐ6Ð6Ð6Ð6Ð6Ð6ó    )Úlenr   ÚsumÚzip)Ústr1Ústr2s     r   Úhamming_distancer      sO   € õ ˆ4�y„y•C˜‘I”IÒÐÝ Ð!;Ñ<Ô<Ð<ÝÐ6Ð6¥c¨$°¡o¤oÐ6Ñ6Ô6Ñ6Ô6Ð6r   )ÚascÚdescÚhammingÚvalueÚ
value_descr   Úreturnc           	      ó   — t          | t          ¦  «        s| g} | D ]b}t          |t          t          f¦  «        sAt          t	          t          |                     ¦   «         ¦  «        ¦  «        t          ¦  «        r dS ŒcdS )NTF)Ú
isinstanceÚlistr   r   ÚnextÚiterÚvaluesÚfloat)ÚdataÚdats     r   Ú_is_deprecated_data_formatr)   0   sˆ   € Ý�d�DÑ!Ô!ð ØˆvˆØð ð ˆÝ�cÕ-Õ/?Ð@ÑAÔAð 	ÅZÝ•�c—j’j‘l”lÑ#Ô#Ñ$Ô$¥eñF
ô F
ð 	ð �4�4ð	ð ˆ5r   r   Tc                 ó4  — t          | t          ¦  «        s| g} d}| D ]a}t          |t          t          f¦  «        sAt          t	          t          |                     ¦   «         ¦  «        ¦  «        t          ¦  «        rd}Œbt          | |||||||||	|
|¬¦  «        S )a�  Plot a histogram of input counts data.

    Args:
        data (list or dict): This is either a list of dictionaries or a single
            dict containing the values to represent (ex ``{'001': 130}``)

        figsize (tuple): Figure size in inches.
        color (list or str): String or list of strings for histogram bar colors.
        number_to_keep (int): The number of terms to plot per dataset.  The rest is made into a
            single bar called 'rest'.  If multiple datasets are given, the ``number_to_keep``
            applies to each dataset individually, which may result in more bars than
            ``number_to_keep + 1``.  The ``number_to_keep`` applies to the total values, rather than
            the x-axis sort.
        sort (string): Could be `'asc'`, `'desc'`, `'hamming'`, `'value'`, or
            `'value_desc'`. If set to `'value'` or `'value_desc'` the x axis
            will be sorted by the number of counts for each bitstring.
            Defaults to `'asc'`.
        target_string (str): Target string if 'sort' is a distance measure.
        legend(list): A list of strings to use for labels of the data.
            The number of entries must match the length of data (if data is a
            list or 1 if it's a dict)
        bar_labels (bool): Label each bar in histogram with counts value.
        title (str): A string to use for the plot title
        ax (matplotlib.axes.Axes): An optional Axes object to be used for
            the visualization output. If none is specified a new matplotlib
            Figure will be created and used. Additionally, if specified there
            will be no returned Figure since it is redundant.
        filename (str): file path to save image to.

    Returns:
        matplotlib.Figure:
            A figure for the rendered histogram, if the ``ax``
            kwarg is not set.

    Raises:
        MissingOptionalLibraryError: Matplotlib not available.
        VisualizationError: When legend is provided and the length doesn't
            match the input data.
        VisualizationError: Input must be Counts or a dict

    Examples:
        .. plot::
           :alt: Output from the previous code.
           :include-source:

            # Plot two counts in the same figure with legends and colors specified.

            from qiskit.visualization import plot_histogram

            counts1 = {'00': 525, '11': 499}
            counts2 = {'00': 511, '11': 514}

            legend = ['First execution', 'Second execution']

            plot_histogram([counts1, counts2], legend=legend, color=['crimson','midnightblue'],
                            title="New Histogram")

            # You can sort the bitstrings using different methods.

            counts = {'001': 596, '011': 211, '010': 50, '000': 117, '101': 33, '111': 8,
                    '100': 6, '110': 3}

            # Sort by the counts in descending order
            hist1 = plot_histogram(counts, sort='value_desc')

            # Sort by the hamming distance (the number of bit flips to change from
            # one bitstring to the other) from a target string.
            hist2 = plot_histogram(counts, sort='hamming', target_string='001')
    ÚcountsÚdistribution©Úkind)	r!   r"   r   r   r#   r$   r%   r&   Ú_plotting_core)r'   ÚfigsizeÚcolorÚnumber_to_keepÚsortÚtarget_stringÚlegendÚ
bar_labelsÚtitleÚaxÚfilenamer.   r(   s                r   Úplot_histogramr:   ;   s¾   € õd �d�DÑ!Ô!ð Øˆvˆà€DØð "ð "ˆÝ�cÕ-Õ/?Ð@ÑAÔAð 	"ÅZÝ•�c—j’j‘l”lÑ#Ô#Ñ$Ô$¥eñF
ô F
ð 	"ð "ˆDøÝØØØØØØØØØØ
ØØðñ ô ð r   ©é   é   c                 ó8   — t          | |||||||||	|
d¬¦  «        S )aq  Plot a distribution from input sampled data.

    Args:
        data (list or dict): This is either a list of dictionaries or a single
            dict containing the values to represent (ex {'001': 130})
        figsize (tuple): Figure size in inches.
        color (list or str): String or list of strings for distribution bar colors.
        number_to_keep (int): The number of terms to plot per dataset.  The rest is made into a
            single bar called 'rest'.  If multiple datasets are given, the ``number_to_keep``
            applies to each dataset individually, which may result in more bars than
            ``number_to_keep + 1``.  The ``number_to_keep`` applies to the total values, rather than
            the x-axis sort.
        sort (string): Could be `'asc'`, `'desc'`, `'hamming'`, `'value'`, or
            `'value_desc'`. If set to `'value'` or `'value_desc'` the x axis
            will be sorted by the maximum probability for each bitstring.
            Defaults to `'asc'`.
        target_string (str): Target string if 'sort' is a distance measure.
        legend(list): A list of strings to use for labels of the data.
            The number of entries must match the length of data (if data is a
            list or 1 if it's a dict)
        bar_labels (bool): Label each bar in histogram with probability value.
        title (str): A string to use for the plot title
        ax (matplotlib.axes.Axes): An optional Axes object to be used for
            the visualization output. If none is specified a new matplotlib
            Figure will be created and used. Additionally, if specified there
            will be no returned Figure since it is redundant.
        filename (str): file path to save image to.

    Returns:
        matplotlib.Figure:
            A figure for the rendered distribution, if the ``ax``
            kwarg is not set.

    Raises:
        MissingOptionalLibraryError: Matplotlib not available.
        VisualizationError: When legend is provided and the length doesn't
            match the input data.

    Examples:
        .. plot::
           :alt: Output from the previous code.
           :include-source:

            # Plot two counts in the same figure with legends and colors specified.

            from qiskit.visualization import plot_distribution

            counts1 = {'00': 525, '11': 499}
            counts2 = {'00': 511, '11': 514}

            legend = ['First execution', 'Second execution']

            plot_distribution([counts1, counts2], legend=legend, color=['crimson','midnightblue'],
                            title="New Distribution")

            # You can sort the bitstrings using different methods.

            counts = {'001': 596, '011': 211, '010': 50, '000': 117, '101': 33, '111': 8,
                    '100': 6, '110': 3}

            # Sort by the counts in descending order
            dist1 = plot_distribution(counts, sort='value_desc')

            # Sort by the hamming distance (the number of bit flips to change from
            # one bitstring to the other) from a target string.
            dist2 = plot_distribution(counts, sort='hamming', target_string='001')

    r,   r-   )r/   )r'   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   s              r   Úplot_distributionr?   ¦   s@   € õb ØØØØØØØØØØ
ØØðñ ô ð r   r+   c                 ó˜  ‡&— dd l m} ddlm} |t          vrt          d¦  «        ‚|t          v r|€d}t          |¦  «        ‚t          | t          ¦  «        r| g} |rPt          |¦  «        t          | ¦  «        k    r0t          dt          |¦  «        › dt          | ¦  «        › d�¦  «        ‚|€&|j
        d                              ¦   «         d	         }nt          |t          ¦  «        r|g}|	€|                     |¬
¦  «        \  }}	nd }t          t          j        d„ | t#          ¦   «         ¦  «        ¦  «        }|�|                     d¦  «         |t          v rpg }|D ]3}|                     |dk    rt          |         ||¦  «        nd¦  «         Œ4d„ t'          t          t'          ||¦  «        d„ ¬¦  «        Ž D ¦   «         d         }n}d|v ryi Š&t          | t          ¦  «        r| Š&n9| D ]6}|D ]1}‰&                     |d¦  «        }t+          |||         ¦  «        ‰&|<   Œ2Œ7t          ‰&                     ¦   «         ˆ&fd„¬¦  «        }t          | ¦  «        }dt          | ¦  «        dz   z  }t/          | |||¬¦  «        \  }}}g }t1          | ¦  «        D �]¯\  }}d }t1          ||         ¦  «        D ]c\  }}|s
|r||         }|dk    rL|                     |	                     |||z  z   |||||t          |¦  «        z           d¬¦  «        ¦  «         d }Œd|dz  |dz
  z  } |	                     ||         | z   ¦  «         |	                     |                     ¦   «         ddd¬¦  «         |rØ|D ]Õ}!|!D ]Ð}"|"                     ¦   «         }#|dk    rt;          |#d¦  «        }#|#dk    rV|	                     |"                     ¦   «         |"                      ¦   «         dz  z   d|#z  t          |#¦  «        dd d¬!¦  «         Œˆ|	                     |"                     ¦   «         |"                      ¦   «         dz  z   d|#z  d"dd d¬!¦  «         ŒÑŒÖ�Œ±|d#k    r|	 !                    d$d%¬&¦  «         n|	 !                    d'd%¬&¦  «         tE          j#        |¦  «         $                    ¦   «         }$d(}%|dk    r'tK          d(tK          d)„ |$D ¦   «         ¦  «        ¦  «        }%|	 &                    |%tK          d*tO          |$¦  «        z  t+          d+„ |$D ¦   «         ¦  «        g¦  «        g¦  «         d,|v r|	 (                    ¦   «          |	j)         *                     |d-¦  «        ¦  «         | +                    d.d/dd0¬1¦  «         |r| ,                    |¦  «         |r|	 -                    d2d3ddd4¬5¦  «         |rt]          |¦  «         |
€|S | /                    |
¦  «        S )6Nr   )ÚMaxNLocatorzgValue of sort option, %s, isn't a valid choice. Must be 'asc', 'desc', 'hamming', 'value', 'value_desc'z6Must define target_string when using distance measure.zLength of legend (z,) doesn't match number of input executions (z).zaxes.prop_cycler1   )r0   c                 óP   — |                       |                     ¦   «         ¦  «        S r   )ÚunionÚkeys)ÚxÚys     r   ú<lambda>z _plotting_core.<locals>.<lambda>6  s   € °!·'²'¸!¿&º&¹(¼(Ñ2CÔ2C€ r   Úrestc                 ó,   — g | ]}t          |¦  «        ‘ŒS r   )r"   )r   rE   s     r   ú
<listcomp>z"_plotting_core.<locals>.<listcomp>?  s   € Ð]Ð]Ð]˜a•$�q‘'”'Ð]Ð]Ð]r   c                 ó   — | d         S )Nr   r   )Úpairs    r   rG   z _plotting_core.<locals>.<lambda>?  s   € ÐSWÐXYÔSZ€ r   ©Úkeyr   r   c                 ó   •— ‰|          S r   r   )rN   Úcombined_countss    €r   rG   z _plotting_core.<locals>.<lambda>I  s   ø€ ÀÐPSÔ@T€ r   r-   é   )Úlabelr1   ÚzorderéF   ÚrightÚanchor)ÚrotationÚhaÚrotation_moder,   é   gü©ñÒMbP?g       @gÍÌÌÌÌÌð?ÚcenterÚbottom)rX   ÚvarS   Ú0r+   ÚCounté   )ÚfontsizezQuasi-probabilityg        c              3   ó    K  — | ]	}d |z  V — Œ
dS ©çš™™™™™ñ?Nr   ©r   Úvals     r   r   z!_plotting_core.<locals>.<genexpr>†  s&   è è € Ð>Ð>¨c  c¡	Ð>Ð>Ð>Ð>Ð>Ð>r   rd   c              3   ó    K  — | ]	}d |z  V — Œ
dS rc   r   re   s     r   r   z!_plotting_core.<locals>.<genexpr>‡  s&   è è € Ð8WÐ8WÀs¸¸s¹Ð8WÐ8WÐ8WÐ8WÐ8WÐ8Wr   r   r=   ÚmajorrF   z--)ÚwhichÚaxisrS   Ú	linestylez
upper left)g)\�Âõ(ð?g      ð?T)ÚlocÚbbox_to_anchorÚncolÚborderaxespadÚframeon)0Úmatplotlib.pyplotÚpyplotÚmatplotlib.tickerrA   ÚVALID_SORTSr   Ú	DIST_MEASr!   Údictr   ÚrcParamsÚby_keyÚstrÚsubplotsÚsortedÚ	functoolsÚreduceÚsetÚappendr   ÚgetÚmaxrD   Ú
_plot_dataÚ	enumerateÚbarÚ
set_xticksÚset_xticklabelsÚ
get_heightÚroundÚtextÚget_xÚ	get_widthÚ
set_ylabelÚnpÚconcatenateÚravelÚminÚset_ylimr   Úinvert_xaxisÚyaxisÚset_major_locatorÚgridr7   r5   r	   Úsavefig)'r'   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r.   ÚpltrA   Úerr_msgÚfigÚlabelsÚdistÚitemr+   ÚcountÚ
prev_countÚlengthÚwidthÚlabels_dictÚall_pvaluesÚall_indsÚrectsÚ_rR   Úidxrf   Ú
bar_centerÚrectÚrecÚheightÚall_valsÚmin_ylimrP   s'                                         @r   r/   r/     s¸  ø€ ð $Ð#Ð#Ð#Ð#Ð#Ø-Ð-Ð-Ð-Ð-Ð-à•;ÐÐÝ ð7ñ
ô 
ð 	
ð
 �yÐÐ˜]Ð2ØJˆÝ  Ñ)Ô)Ð)å�$�ÑÔð Øˆvˆàð 
•#�f‘+”+¥ T¡¤Ò*Ð*Ý Øg¥ V¡¤ÐgÐgÕZ]Ð^bÑZcÔZcÐgÐgÐgñ
ô 
ð 	
ð
 €}Ø”Ð.Ô/×6Ò6Ñ8Ô8¸ÔAˆˆÝ	�E�3Ñ	Ô	ð Ø�ˆà	€zØ—,’, w�,Ñ/Ô/‰ˆˆRˆRàˆå•IÔ$Ð%CÐ%CÀTÍ3É5Ì5ÑQÔQÑRÔR€FØÐ!Ø�Š�fÑÔÐà�yÐÐØˆØð 	Wð 	WˆDØ�KŠKÀÈÂÀ�	 $œ¨¨mÑ<Ô<Ð<ÐTUÑVÔVÐVÐVà]Ð]¥3­­s°4¸Ñ/@Ô/@ÐFZÐFZÐ([Ñ([Ô([Ð#\Ð]Ñ]Ô]Ð^_Ô`ˆˆØ	�DˆˆØˆÝ�d�DÑ!Ô!ð 	LØ"ˆOˆOàð Lð L�Ø#ð Lð L�EØ!0×!4Ò!4°U¸AÑ!>Ô!>�JÝ-0°¸VÀE¼]Ñ-KÔ-K�O EÑ*Ð*ðLõ ˜×,Ò,Ñ.Ô.Ð4TÐ4TÐ4TÐ4TÐUÑUÔUˆå�‰YŒY€FØ•�T‘”˜Q‘Ñ€Eå)3°D¸&À.ÐW[Ð)\Ñ)\Ô)\Ñ&€K�˜hØ€EÝ˜T‘?”?ð ,ñ ,‰ˆˆaØˆÝ! +¨dÔ"3Ñ4Ô4ð 	ð 	‰HˆC�Øð %˜6ð %Ø˜tœ�Ø�QŠwˆwØ—’Ø—F’FØ˜d U™lÑ*ØØØ#Ø# D­3¨u©:¬:Ñ$5Ô6Ø ð ñ ô ñ	ô 	ð 	ð �øØ˜a‘i F¨Q¡JÑ/ˆ
Ø
�Š�h˜t”n zÑ1Ñ2Ô2Ð2Ø
×Ò˜;×+Ò+Ñ-Ô-¸¸wÐV^ÐÑ_Ô_Ð_àð 	Øð ð �Øð ð �CØ Ÿ^š^Ñ-Ô-�FØ˜~Ò-Ð-Ý!& v¨qÑ!1Ô!1˜Ø ’~�~ØŸšØŸIšI™KœK¨#¯-ª-©/¬/¸CÑ*?Ñ?Ø  6™MÝ ™KœKØ'Ø'Ø#$ð  ñ ô ð ð ð ŸšØŸIšI™KœK¨#¯-ª-©/¬/¸CÑ*?Ñ?Ø  6™MØØ'Ø'Ø#$ð  ñ ô ð ð ðùð0 ˆxÒÐØ
�Š�g¨ˆÑ+Ô+Ð+Ð+à
�ŠÐ)°BˆÑ7Ô7Ð7ÝŒ~˜kÑ*Ô*×0Ò0Ñ2Ô2€HØ€HØˆ~ÒÐÝ�s�CÐ>Ð>°XÐ>Ñ>Ô>Ñ>Ô>Ñ?Ô?ˆØ‡K‚K��3 ¥c¨(¡m¤mÑ 3µSÐ8WÐ8WÈhÐ8WÑ8WÔ8WÑ5WÔ5WÐXÑYÔYÐZÑ[Ô[Ð[Ø�€~€~Ø
�ŠÑÔÐà„H×Ò˜{˜{¨1™~œ~Ñ.Ô.Ð.Ø‡H‚H�7 ¨Q¸$€HÑ?Ô?Ð?Øð Ø�	Š	�%ÑÔÐàð 
Ø
�	Š	ØØ&ØØØð 	ñ 	
ô 	
ð 	
ð ð (Ý" 3Ñ'Ô'Ð'ØÐØˆ
à�{Š{˜8Ñ$Ô$Ð$r   c                 óÂ   — t          |                      ¦   «         d„ ¬¦  «        }t          d„ |d| …         D ¦   «         ¦  «        }t          || d…         |¬¦  «        S )zUKeep only the largest values in a dictionary, and sum the rest into a new key 'rest'.c                 ó   — | d         S )Nr   r   )Úps    r   rG   z%_keep_largest_items.<locals>.<lambda>¢  s
   € ¸A¸a¼D€ r   rM   c              3   ó    K  — | ]	\  }}|V — Œ
d S r   r   )r   rN   r�   s      r   r   z&_keep_largest_items.<locals>.<genexpr>£  s&   è è € ÐGÐG™˜˜eˆuÐGÐGÐGÐGÐGÐGr   N)rH   )r{   Úitemsr   rv   )Ú	executionr2   Úsorted_countsrH   s       r   Ú_keep_largest_itemsr´      si   € å˜9Ÿ?š?Ñ,Ô,°.°.ÐAÑAÔA€MÝÐGÐG }Ð5E°~°oÐ5EÔ'FÐGÑGÔGÑGÔG€DÝ�˜~˜oÐ.Ð.Ô/°dÐ;Ñ;Ô;Ð;r   c                 ó  — t          | ¦  «        }  t          ¦   «         j        d„ | D ¦   «         Ž }d„ |D ¦   «         }g }| D ]@}|                     ¦   «         }|                     |¦  «         |                     |¦  «         ŒA|S )zTMake all dictionaries in data have the same set of keys, using 0 for missing values.c              3   ó>   K  — | ]}|                      ¦   «         V — Œd S r   )rD   )r   r²   s     r   r   z _unify_labels.<locals>.<genexpr>ª  s,   è è € ÐFÐF°I˜yŸ~š~Ñ/Ô/ÐFÐFÐFÐFÐFÐFr   c                 ó   — i | ]}|d “ŒS )r   r   )r   rR   s     r   ú
<dictcomp>z!_unify_labels.<locals>.<dictcomp>«  s   € Ð-Ð-Ð-˜ˆE�1Ð-Ð-Ð-r   )Útupler~   rC   ÚcopyÚupdater   )r'   Ú
all_labelsÚbaseÚoutr²   Únew_executions         r   Ú_unify_labelsrÀ   §  s�   € å�‰;Œ;€DØ•‘””ÐFÐFÀÐFÑFÔFÐG€JØ-Ð- *Ð-Ñ-Ô-€DØ
€CØð "ð "ˆ	ØŸ	š	™œˆØ×Ò˜YÑ'Ô'Ð'Ø�
Š
�=Ñ!Ô!Ð!Ð!Ø€Jr   c                 óx  ‡— t          ¦   «         }g }g }t          | t          ¦  «        r| g} ‰�t          ˆfd„| D ¦   «         ¦  «        } | D ]ë}g }|D ]C}	|	|vr‰€d||	<   |                     d¦  «         Œ#d||	<   |                     ||	         ¦  «         ŒD|dk    rt          j        |t          ¬¦  «        }
n2t          j        |t          ¬¦  «        }
|
t          j	        |
¦  «        z  }
|                     |
¦  «         t          |¦  «        }t          j        |¦  «        }|                     |¦  «         Œì|||fS )aÞ  Generate the data needed for plotting counts.

    Parameters:
        data (list or dict): This is either a list of dictionaries or a single
            dict containing the values to represent (ex {'001': 130})
        labels (list): The list of bitstring labels for the plot.
        number_to_keep (int): The number of terms to plot and rest
            is made into a single bar called 'rest'.
        kind (str): One of 'counts' or 'distribution`

    Returns:
        tuple: tuple containing:
            (dict): The labels actually used in the plotting.
            (list): List of ndarrays for the bars in each experiment.
            (list): Indices for the locations of the bars for each
                    experiment.
    Nc              3   ó8   •K  — | ]}t          |‰¦  «        V — Œd S r   )r´   )r   r²   r2   s     €r   r   z_plot_data.<locals>.<genexpr>Í  s/   øè è € ÐbÐbÐPYÕ0°¸NÑKÔKÐbÐbÐbÐbÐbÐbr   r   r   r+   )Údtype)r   r!   rv   rÀ   r   r�   ÚarrayÚintr&   r   r   Úarange)r'   rš   r2   r.   r¡   r¢   r£   r²   r%   rN   ÚpvaluesÚnumelemÚinds     `          r   r‚   r‚   ´  se  ø€ õ$ ‘-”-€KØ€KØ€Hå�$�ÑÔð ØˆvˆØÐ!ÝÐbÐbÐbÐbÐ]aÐbÑbÔbÑbÔbˆàð ð ˆ	ØˆØð 	.ð 	.ˆCØ˜)Ð#Ð#Ø!Ð)Ø'(�K Ñ$Ø—M’M !Ñ$Ô$Ð$øà#$�˜CÑ Ø—’˜i¨œnÑ-Ô-Ð-Ð-Ø�8ÒÐÝ”h˜v­SÐ1Ñ1Ô1ˆGˆGå”h˜v­UÐ3Ñ3Ô3ˆGØ•r”v˜g‘”Ñ&ˆGØ×Ò˜7Ñ#Ô#Ð#Ý�f‘+”+ˆÝŒi˜Ñ Ô ˆØ�Š˜ÑÔÐÐà˜ XÐ-Ð-r   )
NNNr   NNTNNN)
r;   NNr   NNTNNN)r;   NNr   NNTNNNr+   )r+   )Ú__doc__Úcollectionsr   r|   Únumpyr�   Úqiskit.utilsr   Ú
_optionalsÚqiskit.resultr   r   Ú
exceptionsr   Úutilsr	   r   rt   ru   Úboolr)   r:   r?   ÚHAS_MATPLOTLIBÚrequire_in_callr/   r´   rÀ   r‚   r   r   r   ú<module>rÕ      sÉ  ððð ð $Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð à Ð Ð Ð à 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ø *Ð *Ð *Ð *Ð *Ð *Ø -Ð -Ð -Ð -Ð -Ð -ð7ð 7ð 7ð  @Ð?Ð?€ØÐ(Ð)€	ð¨ð ð ð ð ð Ø
ØØ	ØØØØ
ØØðhð hð hð hðZ Ø
ØØ	ØØØØ
ØØð^ð ^ð ^ð ^ðB ÔÔ*ð Ø
ØØ	ØØØØ
ØØØ	ðU%ð U%ð U%ñ +Ô*ðU%ðp<ð <ð <ð
ð 
ð 
ð/.ð /.ð /.ð /.ð /.ð /.r   