
    i                     L   S r SSKJr  SSKJrJrJrJr  SSKJ	r	J
r
JrJr  SSKrSSKJr  SSKJr  SS	KJrJrJrJrJrJrJr  SS
KJr  SSKJr  SSKJr  S\ S\!S\S\"S\\!   4
S jr# SS\S\ S\\$S4   S\\\ \!\\"4      4S jjr%\	 " S S5      5       r&\ " S S\&5      5       r'g)zPrimitive options.    )abstractmethod)IterableTupleUnionAny)	dataclassfieldsasdictis_dataclassN)CouplingMap)Field   )Dict	UnsetTypeUnsetremove_dict_unset_valuesmerge_options_v2primitive_dataclassremove_empty_dict)EnvironmentOptions)SimulatorOptions   )RuntimeOptionsindentnamevalue
is_sectionreturnc           
   #   $  #    U(       a  SOSnU(       a  SOSnSU S3nU(       a  SOSnSnS	S
SU -   -   SU SU S3n	Sv   SU SU SU	 U SU S3
v   SU SU SU(       a  [        U5      R                  O
[        U5       SU S3	v   Sv   g7f)z1Yield HTML table rows to format an options entry.thtdz font-weight: bold; z-style='text-align: left; vertical-align: top;'u   ▸z=display: inline-block; text-align: right; margin-right: 10px;z<div style='width:    r   zpx; z'>z</div>z  <tr>z    < >z</z  </tr>N)type__name__repr)
r   r   r   r   tagweightstylemarkerspacer_stylespacers
             \/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_ibm_runtime/options/options.py_make_data_rowr1   %   s     $$C&0"bF;F81EE UbFRL"2q6z?"34~RxvVF
N#awaxvRuA
66#awa
U 4 4UTTVWZV[[\
]]
Os   BBdata_cls	dict_formc              #   @  #    U=(       d    [        U 5      n/ nUR                  5        HC  u  pE[        [        X5      =n5      (       a  UR	                  XF45        M4  US:w  d  M<  XUS4v   ME     U H%  u  pFXUS4v   [        XaS-   X$   5       Sh  vN   M'     g N	7f)zZRecursively iterate over a dataclass, yielding (indent, name, value, is_dataclass) fields._VERSIONFTr   N)r
   itemsr   getattrappend_iter_all_fields)r2   r   r3   
suboptionsr   valsubopts          r0   r9   r9   6   s     
 -VH-IJ__&	'("99::tn-Ze,,	 ' #VT**#FQJ	HHH #Hs   AB%-BB
Bc                   h    \ rS rSrSr\\S\S\4S j5       5       r\S\S\4S j5       r	S\
4S jrSrg	)
BaseOptionsJ   zBase options class.optionsr   c                     [        5       e)z7Convert the input options to program compatible inputs.)NotImplementedError)r@   s    r0   _get_program_inputsBaseOptions._get_program_inputsN   s     "##    c                    [         R                  " U 5      n[        U5        UR                  S5      =(       d    0 nSUR                  SS5      0n[	        [
        5       H/  nUR                  U;   d  M  X$R                     X4R                  '   M1     SU;   a
  US   US'   U$ SUR                  S0 5      ;   a  US   S   US'   U$ )z8Extract runtime options.

Returns:
    Runtime options.
environmentmax_execution_timeNimageexperimental)copydeepcopyr   getr	   r   r   )r@   options_copyrG   outflds        r0   _get_runtime_options BaseOptions._get_runtime_optionsT   s     }}W- ."&&}5;#\%5%56JD%QR.)Cxx;& +HH 5HH * l"'0CL 
 ((<<'7@CL
rE   c                     S[        U 5      R                   S[        [        U 5      5       S3S/n[	        U 5       H  nUR                  [        U6 5        M     UR                  S5        SR                  U5      $ )z<Return a string that formats this instance as an HTML table.z<pre><z></pre>z<table>z</table>
)	r'   r(   hexidr9   extendr1   r8   join)self
table_htmlrows      r0   _repr_html_BaseOptions._repr_html_k   sm    d4j112!C4M?'JIV
#D)Cnc23 **%yy$$rE    N)r(   
__module____qualname____firstlineno____doc__staticmethodr   dictrC   rQ   strr]   __static_attributes__r_   rE   r0   r>   r>   J   s[    $T $d $  $ d t  ,%S %rE   r>   c                       \ rS rSr% Sr\" SSS9r\\S'   \	r
\\\4   \S'   \" \S9r\\\4   \S	'   \" \S9r\\\4   \S
'   S\SS4S jr\S\S\4S j5       rSrg)	OptionsV2t   a,  Base primitive options, used by v2 primitives.

Args:
    max_execution_time: Maximum execution time in seconds, which is based
        on system execution time (not wall clock time). System execution time is
        the amount of time that the system is dedicated to processing your job.
        If a job exceeds this time limit, it is forcibly cancelled.
        Simulator jobs continue to use wall clock time.

        Refer to the
        `Max execution time documentation
        <https://quantum.cloud.ibm.com/docs/guides/max-execution-time>`_.
        for more information.

    environment: Options related to the execution environment. See
        :class:`EnvironmentOptions` for all available options.

    simulator: Simulator options. See
        :class:`SimulatorOptions` for all available options.
r   T)frozenr5   rH   )default_factoryrG   	simulatorkwargsr   Nc                 N   ^  S[         SS4U 4S jjn[        T U5      nU" U5        g)zUpdate the options._mergedr   Nc                    > U R                  5        H)  u  pUR                  S5      (       a  M  [        TX5        M+     g )N_)r6   
startswithsetattr)rp   keyr;   rZ   s      r0   	_set_attr#OptionsV2.update.<locals>._set_attr   s.    #MMO~~c**D#+ ,rE   )re   r   )rZ   rn   rv   mergeds   `   r0   updateOptionsV2.update   s,    	,t 	, 	,
 "$/&rE   r@   c                 0   S[         S[        S[        SS4S jn[        R                  " U 5      n0 nUR	                  S0 5      nUR	                  S[
        5      n[        U[        5      (       a*  [        [        [        UR                  5       5      5      US'   S	 H  nU" XcU5        M     UR	                  S
S5      n[        U[        5      (       aR  0 n[        UR                  5       5       H  n	X;  d  M
  UR                  U	5      X'   M     [        X75      nU(       a  XS
'   UR	                  S
0 5      R                  SS5        [        U5        [        U5        U[         R"                  SS.n
UR	                  S[
        5      [
        :w  a  US   U
S'   U
$ )zgConvert the input options to program compatible inputs.

Returns:
    Inputs acceptable by primitives.
r   _inputs_optionsr   Nc                     X;   a  X    X'   g g )Nr_   )r   r|   r}   s      r0   _set_if_exists5OptionsV2._get_program_inputs.<locals>._set_if_exists   s     (  rE   rm   coupling_map)default_precisiondefault_shotsseed_estimatordynamical_decoupling
resiliencetwirlingrm   	executionrJ   rI   T)r@   versionsupport_qiskitresilience_level)rf   re   rK   rL   rM   r   
isinstancer   listmap	get_edgeskeyspopr   r   r   ri   r5   )r@   r   rN   output_optionssim_optionsr   rP   rJ   new_keysru   inputss              r0   rC   OptionsV2._get_program_inputs   sy   	/ 	/t 	/t 	/ 	/ }}W-)+"&&{B7"~u=lK00*.s49O9O9Q/R*SK'	
C 3=	
 $''=lD))HL--/0,$0$4$4S$9HM 1 .nKN19~. 	>2.227DA 0.)+	8J8J^bc.6%?)56H)IF%&rE   r_   )r(   r`   ra   rb   rc   r   r5   int__annotations__r   rH   r   r   r   rG   r   r   rm   r   ry   rd   re   rC   rg   r_   rE   r0   ri   ri   t   s    * !D)Hc) 16in-538I[3\K)4/0\/4EU/VIu%t+,V	s 	t 	 4T 4d 4 4rE   ri   )r   N)(rc   abcr   typingr   r   r   r   dataclassesr   r	   r
   r   rK   qiskit.transpilerr   pydanticr   utilsr   r   r   r   r   r   r   environment_optionsr   simulator_optionsr   runtime_optionsr   r   rf   boolr1   re   r9   r>   ri   r_   rE   r0   <module>r      s      . . ? ?  )    4 / ,3 c # 4 HUXM $ DHIII/4T4Z/@IeCc4'()I( &% &% &%R ] ] ]rE   