MottonenStatePreparation(state_vector, wires)[source]

Prepares an arbitrary state on the given wires using a decomposition into gates developed by Möttönen et al. (2004).

The state is prepared via a sequence of “uniformly controlled rotations”. A uniformly controlled rotation on a target qubit is composed from all possible controlled rotations on said qubit and can be used to address individual elements of the state vector. In the work of Möttönen et al., the inverse of their state preparation is constructed by first equalizing the phases of the state vector via uniformly controlled Z rotations and then rotating the now real state vector into the direction of the state \(|0\rangle\) via uniformly controlled Y rotations.

This code is adapted from code written by Carsten Blank for PennyLane-Qiskit.


The final state is only equal to the input state vector up to a global phase.

  • state_vector (array) – Input array of shape (2^N,), where N is the number of wires the state preparation acts on. N must be smaller or equal to the total number of wires.

  • wires (Iterable or Wires) – Wires that the template acts on. Accepts an iterable of numbers or strings, or a Wires object.


ValueError – if inputs do not have the correct format