qml.qaoa.mixers.x_mixer

x_mixer(wires)[source]

Creates a basic Pauli-X mixer Hamiltonian.

This Hamiltonian is defined as:

\[H_M \ = \ \displaystyle\sum_{i} X_{i},\]

where \(i\) ranges over all wires, and \(X_i\) 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) [X0]
+ (1) [X1]
+ (1) [X2]