Open quosta opened 1 year ago
Hi @quosta, thanks for trying out OpenQAOA; we are glad you like it! Your proposition to add cuQuantum
simulator in OpenQAOA sounds quite exciting!
So, backends that are non-conventional and do not produce either a wavefunction or some measurement counts as the output of the quantum circuit need to be handled separately. We have been working internally to add one such backend in PR #147.
The process I encourage you to follow to add a new backend to OpenQAOA is as follows:
openqaoa/basebackend.py
cuQuantum
simulator does not support any measurement outcomes, you can set the attribute self.measurement_outcomes = {}
(an empty dictionary) in the __init__
of the backend. NotImplementedError
for unsupported methods for this backend like the get_counts
function.Once you have added and tested your new backend class in OpenQAOA, we can proceed to add it as a supported backend in get_qaoa_backend
.
Feel free to ask more questions, and we will be happy to help you!
P.S. One important workflow comment -- The best way to contribute would be to fork the dev
branch
I like the openQAOA ecosystem and I am trying to integrate a tensor network based backend (using cuQuantum SDK), which does not calculate the explicit wf as statevec. I can use qiskit circuits as starting point before converting them to perform TN contractions, so I adapted a backend from qiskit_sim. However the optimization fails at the first cycle without measurement_outcomes.
Here is the kernel code from the backend, is there a way to bypass measurement_outcomes?