QuantumRingsProvider module
- class QuantumRingsProvider
Implements the QuantumRingsProvider Class. Use this class to search for available backends and obtain the backend to work with.
- QuantumRingsProvider(token=None, url=None, name=None, instance=None, proxies=None, verify=None)
The constructor for the QuantumRingsProvider class.
- Args:
- token (Optional[str]):
The API Key for the Quantum Rings Provider. If the key is not provided, then a previously saved key, or a default key is used.
- url (Optional[str]):
The URL for the user account’s API. If the URL is not provided, then a default URL is used.
- name (Optional[str]):
The Name of the user account. If no account information is provided, then a previously saved account, or a default account is used.
- instance (Optional[str]):
Instance provider in the hub/group/project format.
- proxies (Optional[dict]):
Proxy configuration to be used.
- verify (Optional[bool]):
Whether to verify the server’s TLS certificate.
- Returns:
QuantumRingsProvider
- Raises:
RunTimeError – If any of the inputs are invalid.
- QuantumRingsProvider.version = 1
- get_backend(self, name=None, **kwargs)
Returns the backend matching the specified name and filtering criteria.
- Args:
- name (Optional[str]):
Name of the backend to be obtained. If none is provided, a best matching backend depending upon the filtering criteria is obtained. If there is no filtering criteria, then a default backend is obtained.
- kwargs (Optional[dict]):
The filtering dictionary that is used for filtering the available backends.
- Returns:
- Backend:
The backend that matches the searching and filtering criteria.
- Raises:
- RunTimeError:
If no backend could be found or if more than one backend matches the filtering criteria.
- backends(self, name=None, **kwargs)
Returns the list of available backends matching the specified filtering.
- Args:
- name (Optional[str]):
List of the backend with a matching name to be obtained. If none is provided, best matching backends depending upon the filtering criteria is obtained.
- kwargs (Optional[dict]):
The filtering dictionary that is used for filtering the available backends.
- Raises:
None.
- Returns:
- list[str]:
A list of Backends that match the searching and filtering criteria.
- active_account(self)
Returns the details of the current active Quantum Rings account.
- Args:
None.
- Raises:
None.
- Returns:
- [dict]:
A dictionary of the current active account.
- delete_account(self, name=None)
Returns the details of the current active Quantum Rings account.
- Args:
- name (Optional[str]):
Name of the user account to be deleted from the local configuration file. If none is provided, no action is taken.
- Raises:
None.
- Returns:
- [bool]:
True - if the account was deleted. False - if there was an error, of if the account was not found.
- save_account(self, token=None, url=None, name=None, proxies=None, verify=False, overwrite=True)
Saves the user account in the local configuration file.
- Args:
- token (Optional[str]):
The API Key for the Quantum Rings Provider. If the key is not provided, then a default key is used.
- url (Optional[str]):
The URL for the user account’s API. If the URL is not provided, then a default URL is used.
- name (Optional[str]):
The Name of the user account. If no account information is provided, then a default account is used.
- proxies (Optional[dict]):
Proxy configuration to be used.
- verify (Optional[bool]):
Whether to verify the server’s TLS certificate.
- overwrite (Optional[bool]):
Whether to overwrite a previously saved record of the user account. The default action is to overwrite.
- Returns:
None
- Raises:
RunTimeError – If any of the inputs are invalid.
- saved_accounts(self, defaults=False, name='')
Returns a dictionary of matching user accounts stored in the local file is provided.
- Args:
- defaults (Optional[bool ]):
True - Returns default accounts only for the user accounts. False - All accounts matching the user name are provided.
- name (Optional[str]):
The name of the user account to be used for the search.
- Returns:
- [dict]:
A dictionary of user accounts found.
- Raises:
RunTimeError – If any of the inputs are invalid.