Dual Ascent#

Dual-Ascent Lagrangian Wrapper#

Treats Consistency and Coherence as inequality constraints and performs dual ascent on their Lagrange multipliers. Useful when you want guarantees on constraint violations instead of fixed weights.

Primal update comes from a base optimizer (e.g., FD/SPSA/Adam).

Interface:
  • initialize(params) -> state

  • step_params(model, params, context) -> (new_params, state)

Context:
  • context[“evaluate”](model, params, context) -> dict with keys:

    {“task”: float, “cons”: float, “coh”: float, “total”: float, “info”: dict}

  • bounds: pass at construction time (cons_bound, coh_bound)

class qmlhc.optim.numpy_optim.dual_ascent.HCDualAscent(base_opt, dual_lr=0.01, cons_bound=0.5, coh_bound=0.01, clip_lambda=10.0)[source]#

Bases: object

Dual-ascent wrapper for (cons, coh) inequality constraints.

initialize(params)[source]#
Return type:

Dict[str, Any]

step_params(model, params, context)[source]#
Return type:

Tuple[Dict[str, Any], Dict[str, Any]]