The VQE.run method only takes a quantum_instance of type QuantumInstance or BaseBackend and NOT IBMQBackend. How then can I run VQE experiments on actual IBMQ Backends rather than just locally using a qasm_simulator with the NoiseModel of an IBMQBackend.
Asked
Active
Viewed 622 times
3
2 Answers
1
BaseBackend is the abstract base class all backend classes inherit from, so IBMQBackend is actually a BaseBackend.
jyu00
- 849
- 4
- 5
0
Please find here a code for using IBM Q backend for VQE.
Note that the code was tested in IBM Quatum Lab at IBM Q website.
provider = IBMQ.load_account() #your IBM Q account
backend = provider.backends(name = 'ibmq_ourense')[0] #getting IBM Q Backend
#connect IBM backend to VQE
vqe_solver = MinimumEigenOptimizer(VQE(quantum_instance = backend))
#solve a problem (qubo is variable with QUBO problem which construction is not a part of this code)
vqe_results = vqe_solver.solve(qubo)
Martin Vesely
- 15,244
- 4
- 32
- 75