Module: pennylane.templates.embeddings

BasisEmbedding(features, wires)[source]

Encodes \(n\) binary features into a basis state of \(n\) qubits.

For example, for features=[0, 1, 0], the quantum system will be prepared in state \(|010 \rangle\).


BasisEmbedding uses PennyLane’s BasisState and only works in conjunction with devices that implement this function.

  • features (array) – Binary input array of shape (n, )
  • wires (Sequence[int]) – sequence of qubit indices that the template acts on