English
Languages
English
Italian
Japanese
Korean
Malayalam
Russian
Spanish
Tamil
Turkish
Vietnamese
Shortcuts



OpflowQNN

class OpflowQNN(operator, input_params=None, weight_params=None, exp_val=None, gradient=None, quantum_instance=None, input_gradients=False)[source]

Bases: qiskit_machine_learning.neural_networks.neural_network.NeuralNetwork

Opflow Quantum Neural Network.

Parameters
  • operator (OperatorBase) – The parametrized operator that represents the neural network.

  • input_params (Optional[List[Parameter]]) – The operator parameters that correspond to the input of the network.

  • weight_params (Optional[List[Parameter]]) – The operator parameters that correspond to the trainable weights.

  • exp_val (Optional[ExpectationBase]) – The Expected Value converter to be used for the operator.

  • gradient (Optional[Gradient]) – The Gradient converter to be used for the operator’s backward pass.

  • quantum_instance (Union[Backend, BaseBackend, QuantumInstance, None]) – The quantum instance to evaluate the network.

  • input_gradients (bool) – Determines whether to compute gradients with respect to input data. Note that this parameter is False by default, and must be explicitly set to True for a proper gradient computation when using TorchConnector.

Attributes

input_gradients

Returns whether gradients with respect to input data are computed by this neural network in the backward method or not.

operator

Returns the underlying operator of this QNN.

Methods