Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove backend cache from QiskitRuntimeService #1732

Merged
merged 10 commits into from
Jun 11, 2024
Prev Previous commit
Next Next commit
cache configuration
  • Loading branch information
nkanazawa1989 committed Jun 10, 2024
commit deb6cb653e812651a46409bcdb1a2d99cc419c1f
7 changes: 6 additions & 1 deletion qiskit_ibm_runtime/api/clients/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def __init__(
**params.connection_parameters(),
)
self._api = Runtime(self._session)
self._configuration_registry = {}

def program_run(
self,
Expand Down Expand Up @@ -301,7 +302,11 @@ def backend_configuration(self, backend_name: str) -> Dict[str, Any]:
Returns:
Backend configuration.
"""
return self._api.backend(backend_name).configuration()
if backend_name not in self._configuration_registry:
self._configuration_registry[backend_name] = self._api.backend(
backend_name
).configuration()
return self._configuration_registry[backend_name].copy()

def backend_status(self, backend_name: str) -> Dict[str, Any]:
"""Return the status of the IBM backend.
Expand Down