We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This message occurs when using RawFeatureVector with CircuitStateFn Cannot compute gradient operator! Continuing without gradients!
RawFeatureVector
CircuitStateFn
Cannot compute gradient operator! Continuing without gradients!
from qiskit import QuantumCircuit from qiskit.opflow import StateFn, PauliSumOp, AerPauliExpectation, Gradient from qiskit.utils import QuantumInstance from qiskit_machine_learning.neural_networks import OpflowQNN from qiskit_machine_learning.circuit.library import RawFeatureVector expval = AerPauliExpectation() gradient = Gradient() qi_sv = QuantumInstance(Aer.get_backend('statevector_simulator')) inputs = RawFeatureVector(16) qc = QuantumCircuit(4) qc.append(inputs,range(4)) qc_sfn = StateFn(qc) H1 = StateFn(PauliSumOp.from_list([('Z', 1.0)])) op = ~H1 @ qc_sfn qnn4 = OpflowQNN(operator = op, input_params = inputs.parameter, weight_params = [], exp_val = expval, gradient = gradient, quantum_instance = qi_sv)
Can pass the Parameter or ParameterVector to OpflowQNN or another Opflow from qiskit_machine_learning.neural_networks
Parameter
ParameterVector
OpflowQNN
qiskit_machine_learning.neural_networks
Check the Gradient condition on qiskit.opflow
qiskit.opflow
The text was updated successfully, but these errors were encountered:
Hello! I would like to work on this issue.
Sorry, something went wrong.
RawFeatureVector.copy()
Closed in #182.
ElePT
No branches or pull requests
Information
What is the current behavior?
This message occurs when using
RawFeatureVector
withCircuitStateFn
Cannot compute gradient operator! Continuing without gradients!
Steps to reproduce the problem
What is the expected behavior?
Can pass the
Parameter
orParameterVector
toOpflowQNN
or another Opflow fromqiskit_machine_learning.neural_networks
Suggested solutions
Check the Gradient condition on
qiskit.opflow
The text was updated successfully, but these errors were encountered: