Documentation
¶
Overview ¶
Package qaoa implements the Quantum Approximate Optimization Algorithm.
QAOA solves combinatorial optimization problems by alternating cost and mixer layers parameterized by gamma and beta angles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxCutHamiltonian ¶
MaxCutHamiltonian encodes a graph as a cost Hamiltonian for the MaxCut problem. C = 0.5 * sum_{(i,j) in edges} (I - Z_i*Z_j) Minimizing -C maximizes the cut. The returned Hamiltonian is negated so that minimization yields the maximum cut.
Types ¶
type Config ¶
type Config struct {
// CostHamiltonian is the objective to minimize.
CostHamiltonian pauli.PauliSum
// MixerHamiltonian is the mixer operator. Nil uses the default X-mixer.
MixerHamiltonian *pauli.PauliSum
// Layers is the number of QAOA layers (p). Default: 1.
Layers int
// Optimizer is the classical optimization method.
Optimizer optim.Optimizer
// InitialParams are the starting [gamma_1..gamma_p, beta_1..beta_p]. Nil means heuristic.
InitialParams []float64
// Shots for sampling the best bitstring. Default: 1024.
Shots int
}
Config specifies the QAOA problem and solver.
Click to show internal directories.
Click to hide internal directories.