
    z	i                        S r SSKJr  SSKJ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	KJr  SS
KJr  SSKJr  \	R(                  " \5      r\/r " S S5      rg)zDProvider for basic simulator backends, formerly known as `BasicAer`.    )annotations)Callable)OrderedDict)TypeN)QiskitError)Backend)QiskitBackendNotFoundError)filter_backends   )BasicSimulatorc                  f   ^  \ rS rSrSrS
U 4S jjrSS jrSSS jjrSS jrSS jr	SS jr
S	rU =r$ )BasicProvider%   zProvider for test simulators.c                L   > [         TU ]  5         U R                  5       U l        g N)super__init___verify_backends	_backends)self	__class__s    h/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/providers/basic_provider/basic_provider.pyr   BasicProvider.__init__(   s      ..0    c                    U R                   " U40 UD6n[        U5      S:  a  [        S5      eU(       d  [        S5      eUS   $ )aJ  Return a single backend matching the specified filtering.
Args:
    name (str): name of the backend.
    **kwargs: dict used for filtering.
Returns:
    Backend: a backend matching the filtering.
Raises:
    QiskitBackendNotFoundError: if no backend could be found or
        more than one backend matches the filtering criteria.
r   z*More than one backend matches the criteriazNo backend matches the criteriar   )backendslenr	   )r   namekwargsr   s       r   get_backendBasicProvider.get_backend.   sH     ==00x=1,-YZZ,-NOO{r   c                    U R                   R                  5       nU(       aO  U Vs/ s H.  oDR                  S:X  a  UR                  5       OUR                  PM0     nnX;  a  [	        SU S35      e[        X2S9$ s  snf )zReturn a list of backends matching the specified filtering.
Args:
    name: name of the backend.
    filters: callable for filtering.
Returns:
    list[Backend]: a list of Backends that match the filtering
        criteria.
r   zThe 'z*' backend is not installed in your system.)filters)r   valuesversionr   r	   r
   )r   r   r#   r   backend	availables         r   r   BasicProvider.backends@   s     >>((*X`X`W//Q"6GLLHX`   $0D6!KL  x99s   5A:c                v    [        5       n[         H$  nU R                  U5      nUR                  nX1U'   M&     U$ )a?  
Return the test backends in `BACKENDS` that are
effectively available (as some of them might depend on the presence
of an optional dependency or on the existence of a binary).

Returns:
    dict[str:Backend]: a dict of test backend instances for
        the backends that could be instantiated, keyed by backend name.
)r   
SIMULATORS_get_backend_instancer   )r   retbackend_clsbackend_instancebackend_names        r   r   BasicProvider._verify_backendsT   s@     m%K#99+F+00L 0 & 
r   c                \     U" U S9nU$ ! [          a  n[        SU SU 35      UeSnAff = f)z
Return an instance of a backend from its class.

Args:
    backend_cls (class): backend class.
Returns:
    Backend: a backend instance.
Raises:
    QiskitError: if the backend could not be instantiated.
)providerzBackend z could not be instantiated: N)	Exceptionr   )r   r-   r.   errs       r   r+   #BasicProvider._get_backend_instancee   sM    	b*D9    	b5QRUQVWX^aa	bs   
 
+&+c                    g)Nr    )r   s    r   __str__BasicProvider.__str__x   s    r   )r   )returnNoner   )NN)r   z
str | Noner#   zCallable | Noner:   zlist[Backend])r:   zOrderedDict[str, Backend])r-   zType[Backend]r:   r   )r:   str)__name__
__module____qualname____firstlineno____doc__r   r    r   r   r+   r8   __static_attributes____classcell__)r   s   @r   r   r   %   s)    '1$:(" & r   r   )rA   
__future__r   collections.abcr   collectionsr   typingr   loggingqiskit.exceptionsr   qiskit.providers.backendr   qiskit.providers.exceptionsr	   qiskit.providers.providerutilsr
   basic_simulatorr   	getLoggerr=   loggerr*   r   r7   r   r   <module>rP      sO    K " $ #   ) , B : + 
		8	$
T Tr   