qml.qaoa.mixers.x_mixer¶
- x_mixer(wires)[source]¶
Creates a basic Pauli-X mixer Hamiltonian.
This Hamiltonian is defined as:
HM = ∑iXi,where i ranges over all wires, and Xi denotes the Pauli-X operator on the i-th wire.
This is mixer is used in A Quantum Approximate Optimization Algorithm by Edward Farhi, Jeffrey Goldstone, Sam Gutmann [arXiv:1411.4028].
- Parameters
wires (Iterable or Wires) – The wires on which the Hamiltonian is applied
- Returns
Mixer Hamiltonian
- Return type
Hamiltonian
Example
The mixer Hamiltonian can be called as follows:
>>> from pennylane import qaoa >>> wires = range(3) >>> mixer_h = qaoa.x_mixer(wires) >>> print(mixer_h) 1 * X(0) + 1 * X(1) + 1 * X(2)