pyriemann_qiskit.utils.hyper_params_factory.gen_zz_feature_map

pyriemann_qiskit.utils.hyper_params_factory.gen_zz_feature_map(reps=2, entanglement='linear')[source]

Return a callable that generates a ZZFeatureMap.

A feature map encodes data into a quantum state. A ZZFeatureMap is a second-order Pauli-Z evolution circuit. See [1] for more details.

Parameters:
  • reps (int (default 2)) – The number of repeated circuits, greater or equal to 1.

  • entanglement (str | list[list[list[int]]] | Callable[int, list[list[list[int]]]]) – Specifies the entanglement structure. Entanglement structure can be provided with indices or string. Possible string values are: ‘full’, ‘linear’, ‘circular’ and ‘sca’. See [2] for more details on entanglement structure.

Returns:

ret – A callable that takes into arguments:

  • the number of features

  • the prefix string for the parameters

And returns an instance of ZZFeatureMap.

Return type:

Callable[[int, str], ZZFeatureMap]

Raises:

ValueError – Raised if reps is lower than 1.

References

Notes

Added in version 0.0.1.

Changed in version 0.4.0: Possibility to specify parameter prefix.