Description
The example max cut optimization problem given at https://github.com/rigetticomputing/grove/tree/master/grove/pyqaoa gives this error when I run it:
Traceback (most recent call last):
File "pyquil_optimization_test.py", line 24, in
for state_index in range(2**inst.n_qubits):
AttributeError: 'QAOA' object has no attribute 'n_qubits'
This makes sense because the instance used in qaoa.py is actually qubits, not n_qubits.
Then I would get this error after that correction:
Traceback (most recent call last):
File "pyquil_optimization_test.py", line 24, in
for state_index in range(2**inst.qubits):
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'list'
If I am not mistaken, the example under the directory pyqaoa should have this modification:
for state_index in range(2**len(inst.qubits)):
print inst.states[state_index], np.conj(wf[state_index])*wf[state_index]