ZZFeatureMap#

class pyqit.core.embeddings.ZZFeatureMap(n_qubits: int, n_repeats: int = 2)[source]#

Bases: BaseEmbedding

The second-order Pauli-Z feature map of Havlicek et al. (2019).

The feature map Qiskit ML’s VQC uses. It is a different circuit from IQPEmbedding. Takes one feature per wire, prescaled the way AngleEmbedding is, and needs at least two qubits.

Parameters:
  • n_qubits (int)

  • n_repeats (int, default 2) – Repetitions of the map, Qiskit’s default.

References

Havlicek et al., “Supervised learning with quantum-enhanced feature spaces”, Nature 567, 209 (2019).

forward(inputs)[source]#

Apply the feature map. Expects one feature per wire.

classmethod get_test_params()[source]#

List constructor kwargs used to parametrize this class in the test suite.