qxmt.models.qkernels.builder module

qxmt.models.qkernels.builder module#

class qxmt.models.qkernels.builder.KernelModelBuilder(config, n_jobs=2, show_progress=True)

Bases: object

Builder class for quantum kernel machine learning models. This class is responsible for building quantum kernel machine learning models. Absorb differences among various platforms, Feature Maps, and Kernels, and build models that can be handled as a common interface within the library.

Examples

>>> from qxmt.configs import ExperimentConfig
>>> from qxmt.models.qkernel.builder import KernelModelBuilder
>>> config = ExperimentConfig(path="configs/my_run.yaml")
>>> model = KernelModelBuilder(config).build()
Parameters:
  • config (ExperimentConfig)

  • n_jobs (int)

  • show_progress (bool)

__init__(config, n_jobs=2, show_progress=True)

Initialize the model builder.

Parameters:
  • config (ExperimentConfig) – Configuration for the experiment.

  • n_jobs (int) – number of jobs for parallel computation

  • show_progress (bool) – flag for showing progress bar

Return type:

None

build()
Build quantum model by following steps:
  1. Set quantum device

  2. Set quantum feature map

  3. Set quantum kernel

  4. Set quantum model

Return type:

BaseMLModel