pyriemann_qiskit.classification.QuanticClassifierBase¶
- class pyriemann_qiskit.classification.QuanticClassifierBase(quantum=True, q_account_token=None, verbose=True, shots=1024, gen_feature_map=<function gen_zz_feature_map.<locals>.<lambda>>, seed=None)[source]¶
Quantum classifier
This class implements a scikit-learn wrapper around Qiskit library [1]. It provides a mean to run classification tasks on a local and simulated quantum computer or a remote and real quantum computer. Difference between simulated and real quantum computer will be that:
there is no noise on a simulated quantum computer (so results are better),
a real quantum computer is quicker than a quantum simulator,
tasks on a real quantum computer are assigned to a queue before being executed on a back-end (delayed execution).
- Parameters:
quantum (bool, default=True) –
If true will run on local or remote quantum backend (depending on q_account_token value),
If false, will perform classical computing instead.
q_account_token (string | None, default=None) – If quantum is True and q_account_token provided, the classification task will be running on a IBM quantum backend. If load_account is provided, the classifier will use the previous token saved with IBMProvider.save_account().
verbose (bool, default=True) – If true, will output all intermediate results and logs.
shots (int, default=1024) – Number of repetitions of each circuit, for sampling.
gen_feature_map (Callable[[int, str], QuantumCircuit | FeatureMap], default=Callable[int, ZZFeatureMap]) – Function generating a feature map to encode data into a quantum state.
seed (int | None, default=None) – Random seed for the simulation.
Notes
Added in version 0.0.1.
Changed in version 0.1.0: Added support for multi-class classification.
Changed in version 0.2.0: Add seed parameter
Changed in version 0.3.0: Switch from IBMProvider to QiskitRuntimeService.
Changed in version 0.6.0: Migrate to Qiskit 2.x: replace
BackendSamplerwithBackendSamplerV2. Moved topyriemann_qiskit.classification.wrappers.quantic_classifier_base.See also
References
[1]H. Abraham et al., Qiskit: An Open-source Framework for Quantum Computing. Zenodo, 2019. doi: 10.5281/zenodo.2562110.
Examples using pyriemann_qiskit.classification.QuanticClassifierBase¶
Suspicious financial activity detection using quantum computer
Art visualization of Variational Quantum Classifier.