pyriemann_qiskit.pipelines.QuantumClassifierWithDefaultRiemannianPipeline

class pyriemann_qiskit.pipelines.QuantumClassifierWithDefaultRiemannianPipeline(nfilter=1, classes=None, dim_red=PCA(), gamma='scale', C=1.0, max_iter=None, shots=1024, feature_reps=2, spsa_trials=None, two_local_reps=None, params={})[source]

Default pipeline with Riemannian geometry and a quantum classifier.

Projects the data into the tangent space of the Riemannian manifold and applies quantum classification.

The type of quantum classification (quantum SVM or VQC) depends on the value of the parameters.

Data are entangled using a ZZFeatureMap. A SPSA optimizer and a two-local circuits are used in addition when the VQC is selected.

Parameters:
  • nfilter (int (default: 1)) – The number of filter for the xDawnFilter. The number of components selected is 2 x nfilter.

  • classes (list[int] (default: None)) – Classes for the XdawnCovariances.

  • dim_red (TransformerMixin (default: PCA())) – A transformer that will reduce the dimension of the feature, after the data are projected into the tangent space.

  • gamma (float | None (default:None)) – Used as input for sklearn rbf_kernel which is used internally. See [1] for more information about gamma.

  • C (float (default: 1.0)) – Regularization parameter. The strength of the regularization is inversely proportional to C. Must be strictly positive. Note, if pegasos is enabled you may want to consider larger values of C.

  • max_iter (int | None (default: None)) – number of steps in Pegasos or SVC. If None, respective default values for Pegasos and (Q)SVC are used. The default value for Pegasos is 1000. For (Q)SVC it is -1 (that is no limit).

  • shots (int | None (default: 1024)) – Number of repetitions of each circuit, for sampling. If None, classical computation will be performed.

  • feature_reps (int (default: 2)) – The number of repeated circuits for the FeatureMap, greater or equal to 1.

  • spsa_trials (int (default: None)) – Maximum number of iterations to perform using SPSA optimizer. For VQC, you can use 40 as a default. VQC is only enabled if spsa_trials and two_local_reps are not None.

  • two_local_reps (int (default: None)) – The number of repetition for the two-local cricuit. VQC is only enabled if spsa_trials and two_local_reps are not None. For VQC, you can use 3 as a default.

  • params (dict (default: {})) – Additional parameters to pass to the nested instance of the quantum classifier. See QuanticClassifierBase, QuanticVQC and QuanticSVM for a complete list of the parameters.

classes_

list of classes.

Type:

list

Notes

Added in version 0.0.1.

Changed in version 0.2.0: Changed feature map from ZZFeatureMap to XFeatureMap. Therefore remove unused parameter feature_entanglement.

See also

XdawnCovariances, TangentSpace, gen_x_feature_map, gen_two_local, get_spsa, QuanticVQC, QuanticSVM, QuanticClassifierBase

References

__init__(nfilter=1, classes=None, dim_red=PCA(), gamma='scale', C=1.0, max_iter=None, shots=1024, feature_reps=2, spsa_trials=None, two_local_reps=None, params={})[source]

Examples using pyriemann_qiskit.pipelines.QuantumClassifierWithDefaultRiemannianPipeline

Classification of P300 datasets from MOABB

Classification of P300 datasets from MOABB

Brain-Invaders with illiteracy classification example

Brain-Invaders with illiteracy classification example

Multiclass EEG classification with Quantum Pipeline

Multiclass EEG classification with Quantum Pipeline

Determine best dimension reduction technics

Determine best dimension reduction technics