pyriemann_qiskit.optimization.anderson_optimizer.AndersonAccelerationOptimizer

class pyriemann_qiskit.optimization.anderson_optimizer.AndersonAccelerationOptimizer(maxiter=100, m=5, alpha=1.0, lambda_reg=1e-08, tol=1e-06, fd_epsilon=1e-05, learning_rate=0.1)[source]

Anderson acceleration optimizer for variational quantum circuits.

Anderson acceleration is a derivative-free fixed-point iteration method that achieves superlinear convergence for compact operators. Gradients are approximated via central finite differences, so no analytical gradient is required. It is particularly well-suited for quantum circuit optimization where:

  • Analytical gradients are expensive or unavailable

  • The objective function is bounded (compact operator)

  • The parameter space may have Riemannian structure

The algorithm maintains a history of parameter vectors and residuals, then solves a small least-squares problem to extrapolate the next iterate. This typically converges in 15-25 iterations compared to 100+ for gradient-based methods.

Parameters:
  • maxiter (int, default=100) – Maximum number of iterations.

  • m (int, default=5) – History depth (number of previous iterates to use). Typical values: 5-10. Larger values may improve convergence but increase memory and computation.

  • alpha (float, default=1.0) – Damping parameter. alpha=1.0 is undamped (recommended for quantum circuits). Values < 1.0 add damping for stability.

  • lambda_reg (float, default=1e-8) – Regularization parameter for the least-squares problem. Prevents ill-conditioning when residual vectors become nearly collinear.

  • tol (float, default=1e-6) – Convergence tolerance on the residual norm.

  • fd_epsilon (float, default=1e-5) – Finite-difference step size for gradient approximation. Should be small (~1e-5 to 1e-7) for accurate numerical gradients.

  • learning_rate (float, default=0.1) – Step size for the fixed-point map g(x) = x - lr·∇f(x). Controls how far the iterates move each step. Values in 0.05–0.5 are typical; too small causes slow convergence, too large causes oscillation or bounds overshoot.

trajectory_

Optimization trajectory (parameter history).

Type:

list of ndarray

loss_history_

Loss function values at each iteration.

Type:

list of float

Examples

>>> from pyriemann_qiskit.optimization.anderson_optimizer import (
...     AndersonAccelerationOptimizer
... )
>>> optimizer = AndersonAccelerationOptimizer(maxiter=25, m=5)
>>> # Use with QuanticNCH or other quantum classifiers
>>> # qaoa_optimizer=optimizer
__init__(maxiter=100, m=5, alpha=1.0, lambda_reg=1e-08, tol=1e-06, fd_epsilon=1e-05, learning_rate=0.1)[source]

Initialize the optimization algorithm, setting the support level for _gradient_support_level, _bound_support_level, _initial_point_support_level, and empty options.

Examples using pyriemann_qiskit.optimization.anderson_optimizer.AndersonAccelerationOptimizer

Optimizer ablation study for ContinuousQIOCEClassifier

Optimizer ablation study for ContinuousQIOCEClassifier