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.
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
Examples using pyriemann_qiskit.optimization.anderson_optimizer.AndersonAccelerationOptimizer¶
Optimizer ablation study for ContinuousQIOCEClassifier