
    {	i9                     8    S r SSKr " S S5      r " S S5      rg)z
Aer backend configuration
    Nc                   L    \ rS rSrSr    S
S jr\S 5       rS rS r	S r
S	rg)
GateConfig   a  Class representing a Gate Configuration

Attributes:
    name: the gate name as it will be referred to in OpenQASM.
    parameters: variable names for the gate parameters (if any).
    qasm_def: definition of this gate in terms of OpenQASM 2 primitives U
              and CX.
Nc                     Xl         X l        X0l        U(       a  X@l        U(       a  XPl        Ub  X`l        Ub  Xpl        gg)a?  Initialize a GateConfig object

Args:
    name (str): the gate name as it will be referred to in OpenQASM.
    parameters (list): variable names for the gate parameters (if any)
                       as a list of strings.
    qasm_def (str): definition of this gate in terms of OpenQASM 2 primitives U and CX.
    coupling_map (list): An optional coupling map for the gate. In
        the form of a list of lists of integers representing the qubit
        groupings which are coupled by this gate.
    latency_map (list): An optional map of latency for the gate. In the
        the form of a list of lists of integers of either 0 or 1
        representing an array of dimension
        len(coupling_map) X n_registers that specifies the register
        latency (1: fast, 0: slow) conditional operations on the gate
    conditional (bool): Optionally specify whether this gate supports
        conditional operations (true/false). If this is not specified,
        then the gate inherits the conditional property of the backend.
    description (str): Description of the gate operation
N)name
parametersqasm_defcoupling_maplatency_mapconditionaldescription)selfr   r   r	   r
   r   r   r   s           b/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/backends/backendconfiguration.py__init__GateConfig.__init__   sB    > 	$  ,*"*"* #    c                     U " S0 UD6$ )a   Create a new GateConfig object from a dictionary.

Args:
    data (dict): A dictionary representing the GateConfig to create.
                 It will be in the same format as output by
                 :func:`to_dict`.

Returns:
    GateConfig: The GateConfig from the input dictionary.
 r   )clsdatas     r   	from_dictGateConfig.from_dictI   s     {T{r   c                 N   U R                   U R                  U R                  S.n[        U S5      (       a  U R                  US'   [        U S5      (       a  U R
                  US'   [        U S5      (       a  U R                  US'   [        U S5      (       a  U R                  US'   U$ )xReturn a dictionary format representation of the GateConfig.

Returns:
    dict: The dictionary form of the GateConfig.
)r   r   r	   r
   r   r   r   )r   r   r	   hasattrr
   r   r   r   )r   out_dicts     r   to_dictGateConfig.to_dictW   s     II//

 4(('+'8'8H^$4''&*&6&6H]#4''&*&6&6H]#4''&*&6&6H]#r   c                 t    [        U[        5      (       a#  U R                  5       UR                  5       :X  a  ggNTF)
isinstancer   r   r   others     r   __eq__GateConfig.__eq__l   s)    eZ((||~0r   c           	          SU R                    SU R                   SU R                   3nS H/  n[        X5      (       d  M  US[	        [        X5      5      -   -  nM1     US-  nU$ )NzGateConfig(z, )r
   r   r   r   ))r   r   r	   r   reprgetattr)r   out_stris      r   __repr__GateConfig.__repr__r   sf    		{"T__,=RONAt4$wt'7"888 O 	3r   )r   r
   r   r   r   r   r	   )NNNN)__name__
__module____qualname____firstlineno____doc__r   classmethodr   r   r$   r,   __static_attributes__r   r   r   r   r      s>     ++Z  *r   r   c                       \ rS rSrSr0 r                 SS jrS r\S 5       r	S r
\S 5       rS	 rS
 rSrg)AerBackendConfiguration{   aR  Class representing an Aer Backend Configuration.

Attributes:
    backend_name: backend name.
    backend_version: backend version in the form X.Y.Z.
    n_qubits: number of qubits.
    basis_gates: list of basis gates names on the backend.
    gates: list of basis gates on the backend.
    max_shots: maximum number of shots supported.
Nc                    0 U l         Xl        X l        X0l        X@l        XPl        SU l        SU l        SU l        SU l	        SU l
        X`l        Xpl        U(       a  Xl        Xl        U
(       a  U
 Vs/ s H  nUS-  PM
     snU l        Ub
  US-  U l        U(       a  Xl        Ub  Xl        U(       a  SU l        U(       a  Xl        Ub  UU l        Ub  UU l        Ub  UU l        Ub  UU l        Ub  UU l        Ub  UU l        Ub
  US-  U l        Ub
  US-  U l        Ub  UU l        SU;   a&  US    VVs/ s H  u  nnUS-  US-  /PM     snnUS'   S	U;   a&  US	    VVs/ s H  u  nnUS-  US-  /PM     snnUS	'   S
U;   a  US
    Vs/ s H  nUS-  PM
     snUS
'   U R                   R=                  U5        gs  snf s  snnf s  snnf s  snf )u	  Initialize a AerBackendConfiguration Object

Args:
    backend_name (str): The backend name
    backend_version (str): The backend version in the form X.Y.Z
    n_qubits (int): the number of qubits for the backend
    basis_gates (list): The list of strings for the basis gates of the
        backends
    gates (list): The list of GateConfig objects for the basis gates of
        the backend
    max_shots (int): The maximum number of shots allowed on the backend
    coupling_map (list): The coupling map for the device
    supported_instructions (List[str]): Instructions supported by the backend.
    dynamic_reprate_enabled (bool): whether delay between programs can be set dynamically
        (ie via ``rep_delay``). Defaults to False.
    rep_delay_range (List[float]): 2d list defining supported range of repetition
        delays for backend in μs. First entry is lower end of the range, second entry is
        higher end of the range. Optional, but will be specified when
        ``dynamic_reprate_enabled=True``.
    default_rep_delay (float): Value of ``rep_delay`` if not specified by user and
        ``dynamic_reprate_enabled=True``.
    max_experiments (int): The maximum number of experiments per job
    sample_name (str): Sample name for the backend
    n_registers (int): Number of register slots available for feedback
        (if conditional is True)
    register_map (list): An array of dimension n_qubits X
        n_registers that specifies whether a qubit can store a
        measurement in a certain register slot.
    configurable (bool): True if the backend is configurable, if the
        backend is a simulator
    credits_required (bool): True if backend requires credits to run a
        job.
    online_date (datetime.datetime): The date that the device went online
    display_name (str): Alternate name field for the backend
    description (str): A description for the backend
    tags (list): A list of string tags to describe the backend
    dt (float): Qubit drive channel timestep in nanoseconds.
    dtm (float): Measurement drive channel timestep in nanoseconds.
    processor_type (dict): Processor type for this backend. A dictionary of the
        form ``{"family": <str>, "revision": <str>, segment: <str>}`` such as
        ``{"family": "Canary", "revision": "1.0", segment: "A"}``.

        - family: Processor family of this backend.
        - revision: Revision version of this processor.
        - segment: Segment this processor belongs to within a larger chip.

    **kwargs: optional fields
TFgư>N   &.>qubit_lo_range    eAmeas_lo_range	rep_times)_databackend_namebackend_versionn_qubitsbasis_gatesgateslocal	simulatorr   
open_pulsememory	max_shotsr
   supported_instructionsdynamic_reprate_enabledrep_delay_rangedefault_rep_delaymax_experimentssample_namen_registersregister_mapconfigurablecredits_requiredonline_datedisplay_namer   tagsdtdtmprocessor_typeupdate)r   r@   rA   rB   rC   rD   rI   r
   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   r   rV   rW   rX   rY   kwargs_rd	min_range	max_range_rts                                 r   r    AerBackendConfiguration.__init__   s)   X 
(. &

"(!*@''>$:I#J/3C$J/#JD (%6%=D" #2 "* D ,# ,D'$4D!"*D# ,D"*DDI >4iDG?TzDH%"0D v% /55E.F(.F*Y	 S)c/2.F(F#$
 f$ /5_.E'.E*Y	 S)c/2.E'F?# & 9?9L"M9L#3:9L"MF;

&!k $KL(' #Ns   3F>6G"G	Gc                 f     U R                   U   $ ! [         a  n[        SU S35      UeS nAff = f)Nz
Attribute z is not defined)r?   KeyErrorAttributeError)r   r   exs      r   __getattr__#AerBackendConfiguration.__getattr__  s?    	M::d## 	M :dV?!CD"L	Ms    
0+0c                     [         R                   " U5      nUR                  S5       Vs/ s H  n[        R                  U5      PM     nnXBS'   U " S0 UD6$ s  snf )a  Create a new GateConfig object from a dictionary.

Args:
    data (dict): A dictionary representing the GateConfig to create.
                 It will be in the same format as output by
                 :func:`to_dict`.
Returns:
    GateConfig: The GateConfig from the input dictionary.
rD   r   )copypopr   r   )r   r   in_dataxrD   s        r   r   !AerBackendConfiguration.from_dict%  sU     ))D/29++g2FG2FQ%%a(2FG ~W~ Hs   Ac                    U R                   U R                  U R                  U R                  U R                   Vs/ s H  oR                  5       PM     snU R                  U R                  U R                  U R                  U R                  U R                  U R                  S.n[        U S5      (       a  U R                  US'   [        U S5      (       a"  U R                   Vs/ s H  o3S-  PM	     snUS'   [        U S5      (       a  U R                   S-  US'   S H"  n[        X5      (       d  M  [#        X5      X$'   M$     UR%                  U R&                  5        SU;   a  US==   S-  ss'   S	U;   a  US	==   S-  ss'   S
U;   a%  US
    VVs/ s H  u  pVUS-  US-  /PM     snnUS
'   SU;   a%  US    VVs/ s H  u  pVUS-  US-  /PM     snnUS'   U$ s  snf s  snf s  snnf s  snnf )r   )r@   rA   rB   rC   rD   rE   rF   r   rH   rI   r
   rK   rJ   rL   g    .ArM   )rN   rO   rP   rQ   rR   rS   rT   rU   r   rV   rW   rX   rY   rW   r<   rX   r;   r:   r=   )r@   rA   rB   rC   rD   r   rE   rF   r   rH   rI   r
   rK   r   rJ   rL   rM   r)   rZ   r?   )r   rk   r   r\   kwargr]   r^   s          r   r   AerBackendConfiguration.to_dict5  s    !--#33+++/::6:aiik:6ZZ++kk --'+'C'C
 4122151L1LH-.4*++@D@T@T*U@T9@T*UH&'4,--,0,B,BS,HH()
E t##")$"6!
$ 	

#8TNc!NHUOs"O x' /77G.H*.H*Y T!9t#34.H*H%&
 h& /7.G).G*Y T!9t#34.G)H_%
 q 7 +V>*)s   G%G"G'>G-c                     U R                   $ )zReturns the number of qubits.

In future, `n_qubits` should be replaced in favor of `num_qubits` for consistent use
throughout Qiskit. Until this is properly refactored, this property serves as intermediate
solution.
)rB   )r   s    r   
num_qubits"AerBackendConfiguration.num_qubitsz  s     }}r   c                 t    [        U[        5      (       a#  U R                  5       UR                  5       :X  a  ggr    )r!   r6   r   r"   s     r   r$   AerBackendConfiguration.__eq__  s*    e455||~0r   c                     XR                   ;   $ )N)__dict__)r   items     r   __contains__$AerBackendConfiguration.__contains__  s    }}$$r   )r?   r@   rA   rC   r   rR   r
   rS   rM   r   rU   rW   rX   rK   rD   rE   rN   rI   rH   rB   rP   rT   rG   rY   rQ   rL   rO   rF   rJ   rV   )NFNNNNNNNNNNNNNNN)r.   r/   r0   r1   r2   r?   r   re   r3   r   r   propertyrq   r$   rx   r4   r   r   r   r6   r6   {   s    	 E  $ %3T"lM  CJ  %r   r6   )r2   rh   r   r6   r   r   r   <module>r{      s(    f fRP% P%r   