qlauncher.routines.qiskit.algorithms.qml#
Summary#
Classes:
This is just |
|
Train a quantum kernel with additional parameters to be optimized. The kernel will be optimized to provide maximum accuracy with a support vector classifier on the provided dataset. If no trainable parameters are provided, the algorithm will return a |
Reference#
- class qlauncher.routines.qiskit.algorithms.qml.ComputeUncomputeCustom(sampler: BaseSampler | BaseSamplerV2, *, options: Options | None = None, local: bool = False, pass_manager: PassManager | None = None)[source]#
Bases:
ComputeUncompute
This is just
qiskit_machine_learning.state_fidelities.ComputeUncompute
that checks if a sampler is an instance of BaseSamplerV1 instead of BaseSampler. The reason was that classes basing BaseSampler were getting isinstance(cls(),BaseSampler) == False probably because of some qiskit shenanigans.
- class qlauncher.routines.qiskit.algorithms.qml.TrainQSVCKernel(kernel_circuit: QuantumCircuit, trainable_params: Sequence[Parameter] | None = None, **alg_kwargs)[source]#
Bases:
Algorithm
Train a quantum kernel with additional parameters to be optimized. The kernel will be optimized to provide maximum accuracy with a support vector classifier on the provided dataset. If no trainable parameters are provided, the algorithm will return
a
qiskit_machine_learning.kernels.FidelityQuantumKernel
kernel with a sampler assigned to the provided backend. Otherwise an instance ofqiskit_machine_learning.kernels.TrainableFidelityQuantumKernel
with optimal parameters and a sampler assigned to the provided backend will be returned.- Parameters:
kernel_circuit (QuantumCircuit) – A parametrizable quantum circuit. The measurements will be used to produce kernel output.
trainable_params (Sequence[Parameter] | None, optional) – The parameters to be optimized during training. If None no optimization will be done. Defaults to None.