'Drawing Quantum Circuit for Vehicle Routing Protocol (VQE) given in qiskit
I have recently started to explore about Quantum Computing and was looking at Vehicle Routing Protocol using VQE. My aim is to generate a quantum circuit from the above link and I referred to this post in stack-overflow. It shows how quantum circuit can be generated using hamiltonian and ansatz. I did following:
quantum_instance = QuantumInstance(
BasicAer.get_backend("qasm_simulator"),
seed_simulator=algorithm_globals.random_seed,
seed_transpiler=algorithm_globals.random_seed,
)
vqe = VQE(quantum_instance=quantum_instance)
optimizer = MinimumEigenOptimizer(min_eigen_solver=vqe)
ansatz = EfficientSU2(3)
parameters = list(ansatz.parameters)
op,offset = qp.to_ising() //qp is my quadratic program from qiskit documentation
circuits = vqe.construct_circuit(parameters, op)
for circuit in circuits:
print(circuit.draw())
I have also tweaked construct_problem to include qp.objective.num_qubits=54. I am not sure if I am approaching it correctly to display the quantum circuit. I must notify that I am a software engineering student and an absolute beginner with quantum computing and any pointers to the right direction will be greatly appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
