entropica_qaoa
entropica_qaoa copied to clipboard
How to get result bitstring data in case of QAOACostFunctionOnQVM?
this module is really helpful. Could you please let me know how to capture the measured results in case of using QAOACostFunctionOnQVM. In the case of Wavefunction simulator there is a get_wavefunction method helps to retrieve the data. But how to see the results incase of QAOACostFunctionOnQVM like the minimum energy related bit string
QAOACostFunctionOnQVM works fine with the pyquil 2.x.x ... with pyquil 3.x.x need to update bitstring capture as qvm.run return QAMExecutionResult
updated the class PrepareAndMeasureOnQVM as
`def __call__(self, params, nshots): if nshots is None: nshots = self.nshots bitstrings = [] for exe in self.exes: result = self.qvm.run(exe) bitstring = result.readout_data.get('ro') for i in range(nshots - 1): result = self.qvm.run(exe) new_bits = result.readout_data.get('ro') bitstring = np.append(bitstring, new_bits, axis=0) bitstrings.append(bitstring) out = sampling_expectation(self.hams, bitstrings) if self.scalar: return out[0] else: return out`
works with out errors as mentioned in the pyquil migration docs
Please help me how to capture the bitstring with highest amplitudes or probability...
Hi @eswarthammana ! Apologies for the delay with which I answer you. This repository is not actively maintained, and that is the reason why entropica_qaoa does not work well with pyquil 3.x.x
However, could you please reach us at [email protected] ? We could tell you a bit more about our upcoming open source project which is soon going to replace entropica_qaoa.
Thanks and take care!
@eswarthammana, this project has effectively been incorporated into OpenQAOA.
Head over there if you are still working with QAOA and Rigetti's backends :)