qdk_chemistry.remote.backends package
Remote execution backends for QDK/Chemistry.
This package provides pluggable backends for executing algorithms on remote systems. Each backend implements the upload/execute/download pattern for transferring data and running generated Python scripts.
- Built-in backend:
local: Local subprocess execution and reference implementation
Plugin packages should register custom backends through QdkChemistryPlugin
and the qdk_chemistry.plugins entry-point group. The @register_backend
decorator remains available for direct registration.
- qdk_chemistry.remote.backends.available_backends()
Return list of registered backend names.
- qdk_chemistry.remote.backends.create_remote(name, **config)
Create a configured remote backend instance.
- Parameters:
name (
str) – Backend name (e.g., “custom” or “local”)**config – Backend-specific configuration options.
- Return type:
- Returns:
Configured RemoteBackend instance ready for use
Examples
>>> from qdk_chemistry.remote import create_remote >>> from qdk_chemistry.algorithms import create >>> >>> remote = create_remote("local", timeout=7200, poll_interval=10.0) >>> scf = create("scf_solver") >>> energy, wfn = scf.run(structure, 0, 1, "cc-pvdz", ... cache="./cache", remote=remote)
- qdk_chemistry.remote.backends.get_backend(name, **config)
Create a backend instance by name.
- Parameters:
name (
str) – Backend name (e.g., “custom” or “local”)**config – Backend-specific configuration.
- Return type:
- Returns:
Configured RemoteBackend instance
- Raises:
ValueError – If no backend is registered with that name
- qdk_chemistry.remote.backends.get_mcp_safe_config_options(name)
Return MCP-safe constructor options for a registered backend.
Unknown backends and those without a direct declaration expose no configurable options to MCP clients.
- qdk_chemistry.remote.backends.register_backend(name)
Decorator to register a backend class with a name.
Example
>>> @register_backend("custom") ... class CustomBackend(RemoteBackend): ... ...
- Parameters:
name (
str) – The backend name (e.g., “custom” or “local”).- Return type:
- Returns:
Decorator function that registers the backend class.
- Raises:
DuplicateRegistrationError – If the remote backend name or class is already registered.