HUBOQAOA

HUBOQAOA#

Module: iqm.qaoa.hubo_qaoa

class iqm.qaoa.hubo_qaoa.HUBOQAOA(problem, num_layers, *, betas=None, gammas=None, initial_angles=None)[source]#

Bases: QAOA[HUBOInstance]

The class for QAOA with higher-order unconstrained binary (HUBO) cost function.

The class inherits a lot of functionality from its parent iqm.qaoa.generic_qaoa.QAOA. One new addition is the attribute hamiltonian_bp which stores the coefficient of the problem Hamiltonian.

Parameters:
  • problem (HUBOInstance) – A HUBOInstance object describing the HUBO problem to be solved.

  • num_layers (int) – The number of QAOA layers, commonly referred to as p in the literature.

  • betas (Sequence[float] | np.ndarray | None) – An optional list of the initial beta angles of QAOA. Has to be provided together with gammas.

  • gammas (Sequence[float] | np.ndarray | None) – An optional list of the initial gamma angles of QAOA. Has to be provided together with betas.

  • initial_angles (Sequence[float] | np.ndarray | None) – An optional list of the initial QAOA angles as one variable. Shouldn’t be provided together with either betas or gammas. The gamma and beta angles are interleaved, so that the first pair of entries corresponds to \(\gamma_1\) and \(\beta_1\) (the angles of the first QAOA layer). The second pair of entries corresponds to \(\gamma_2\) and \(\beta_2\), etc. …

Attributes

hamiltonian_bp

The BP representation of the problem, taken from the input HUBOInstance.

Methods

property hamiltonian_bp: BinaryPolynomial#

The BP representation of the problem, taken from the input HUBOInstance.

Inheritance

Inheritance diagram of iqm.qaoa.hubo_qaoa.HUBOQAOA