- class VQC(num_qubits=None, feature_map=None, ansatz=None, loss='cross_entropy', optimizer=None, warm_start=False, quantum_instance=None, initial_point=None, callback=None)¶
Quantum neural network classifier.
int]) – The number of qubits for the underlying CircuitQNN. If None, derive from feature_map or ansatz. If neither of those is given, raise exception.
QuantumCircuit]) – The feature map for underlying CircuitQNN. If None, use ZZFeatureMap.
QuantumCircuit]) – The ansatz for the underlying CircuitQNN. If None, use RealAmplitudes.
Loss]) – A target loss function to be used in training. Default is cross entropy.
Optimizer]) – An instance of an optimizer to be used in training. When None defaults to SLSQP.
bool) – Use weights from previous fit to start next fit.
ndarray]) – Initial point for the optimizer to start from.
None]]) – a reference to a user’s callback function that has two parameters and returns
None. The callback can access intermediate data during training. On each iteration an optimizer invokes the callback and passes current weights as an array and a computed value as a float of the objective function being optimized. This allows to track how well optimization / training process is going on.
QiskitMachineLearningError – Needs at least one out of num_qubits, feature_map or ansatz to be given.
Returns the used ansatz.
Returns the underlying quantum circuit.
Returns the used feature map.
Returns the number of qubits used by ansatz and feature map.
Fit the model to data matrix X and targets y.