Closed patdenim closed 2 years ago
VQEProgram
has been deprecated and renamed to VQEClient
link
Edit: When running VQE
with no parameters (ansatz = EfficientSU2()) there is an error
ValueError: The dimension of the initial point (0) does not match the number of parameters in the circuit (32).
I'm getting the same error when running the real VQEProgram
with no parameters
raise ValueError(\'Mismatching number of parameters and initial point dimension.\')\n2022-01-24T21:54:09.216710947Z ValueError: Mismatching number of parameters and initial point dimension.\n'
or depending on the other VQEProgram
parameters
qiskit.algorithms.exceptions.AlgorithmError: \'The number of qubits of the ansatz does not match the operator, and the ansatz does not allow setting the number of qubits using `num_qubits`.\'\n'
@patdenim I left some comments above - there should be a more detailed error message when ansatz = EfficientSU2()
is used with no parameters
Describe the bug VQEProgram fails when using ansatz = EfficientSU2() that does not have any parameter. This specific ansatz works well in classical VQE (i guess some parameter values are used by default when none is specified)
Error stack message:
Steps to reproduce ansatz = EfficientSU2() backend = provider.get_backend('ibmq_qasm_simulator') quantum_instance = QuantumInstance(backend=backend, optimization_level=3) optimizer = SPSA(maxiter=10) minimum_eigen_solver = VQEProgram( ansatz=ansatz, optimizer=optimizer, provider=provider, backend=backend ) result = ground_state_solver.solve(problem=problem)
Expected behavior
Suggested solutions Error message might be explicit or Runtime VQEProgram might use predefined default parameters
Additional Information