qml.templates.embeddings.AngleEmbedding

AngleEmbedding(features, wires, rotation='X')[source]

Encodes \(N\) features into the rotation angles of \(n\) qubits, where \(N \leq n\).

The rotations can be chosen as either RX, RY or RZ gates, as defined by the rotation parameter:

  • rotation='X' uses the features as angles of RX rotations

  • rotation='Y' uses the features as angles of RY rotations

  • rotation='Z' uses the features as angles of RZ rotations

The length of features has to be smaller or equal to the number of qubits. If there are fewer entries in features than rotations, the circuit does not apply the remaining rotation gates.

Parameters
  • features (array) – input array of shape (N,), where N is the number of input features to embed, with \(N\leq n\)

  • wires (Sequence[int] or int) – qubit indices that the template acts on

  • rotation (str) – Type of rotations used

Raises

ValueError – if inputs do not have the correct format