qat.plugins.PSOMinimizePlugin

class qat.plugins.PSOMinimizePlugin(x0=None, collective=False, binding_args=None, **kwargs)

A variational minimizer based on the Particle Swarm Optimization (PSO) algorithm.

It is a particularization of the Optimizer class.

Parameters
  • x0 (optional, numpy.ndarray) – Initial position of one Particle. By default defined as an integer equal to the number of parameters to optimize.

  • binding_args (optional, dict) – arguments passed to the variable binding method

  • choose_inertia_function (str, optional) – method for picking the inertia weights. It may be ‘constant’, ‘random’, ‘linearly_decreasing’ (default), ‘chaotic_random’.

  • name_method_used (str, optional) – Kind of PSO to be used. It may be ‘PSO’ (default), ‘CLPSO’, ‘FDR_PSO’, ‘LIPS’, ‘HPSO_TVAC’.

  • max_iter (int, optional) – maximum number of iterations. Defaults to 10.

  • swarm_number (int, optional) – size of the swarm. Defaults to 10.

  • size_initial_vector_space (float, optional) – size of the hypercube. Defaults to 1.

  • inertia_kwargs (float, optional) – depending on the inertia_function used. See class Inertia_weight for more details.

compile(batch: Batch) Batch

Loops a batch through all the plugins present inside the QPU.

Parameters

batch (Batch) – a batch of jobs. If a single job is provided, the job is embedded into a Batch, compiled, and the first result is returned.

Returns

a batch of jobs

Return type

(Batch)