qdk_chemistry.plugins.base module

Unified plugin registration API for QDK/Chemistry extensions.

qdk_chemistry.plugins.base.ChemistryPlugin

alias of QdkChemistryPlugin

class qdk_chemistry.plugins.base.PluginRegistrar[source]

Bases: object

Register plugin capabilities through the existing public registries.

register_algorithm_factory(factory)[source]

Register a factory that introduces an algorithm type.

Parameters:

factory (AlgorithmFactory) – Factory that defines and creates the algorithm type.

Raises:

DuplicateRegistrationError – If the algorithm type is already registered.

Return type:

None

register_algorithm(factory, *, data_classes=())[source]

Register an algorithm factory and its DataClass input or output types.

Parameters:
  • factory (Callable[[], Any]) – Factory that creates the algorithm implementation.

  • data_classes (Iterable[Type[Any]]) – DataClass loaders used by the algorithm’s inputs or outputs.

Raises:
Return type:

None

register_dataclass(dataclass_type)[source]

Register a DataClass loader used in algorithm inputs or outputs.

Parameters:

dataclass_type (Type[Any]) – Canonical DataClass loader to register.

Raises:

DuplicateRegistrationError – If the DataClass wire type is already registered.

Return type:

None

register_remote_backend(name, backend_type)[source]

Register a remote execution backend.

Backends may expose selected constructor parameters to untrusted MCP clients by declaring mcp_safe_config_options as a frozenset on the concrete class. The declaration is validated during registration; an omitted declaration exposes no parameters.

Parameters:
  • name (str) – Registry name for the backend.

  • backend_type (Type[Any]) – Backend class to register.

Raises:

DuplicateRegistrationError – If the backend name or class is already registered.

Return type:

None

register_cache_backend(name, backend_type)[source]

Register a cache backend.

Parameters:
  • name (str) – Registry name for the cache backend.

  • backend_type (Type[Any]) – Cache backend class to register.

Raises:

DuplicateRegistrationError – If the cache name or class is already registered.

Return type:

None

class qdk_chemistry.plugins.base.QdkChemistryPlugin[source]

Bases: ABC

Base class for plugins discovered through qdk_chemistry.plugins.

api_version = 1
abstractmethod register(registrar)[source]

Register the capabilities provided by this plugin.

Return type:

None

Parameters:

registrar (PluginRegistrar)