rigetti / grove

Quantum algorithms built using pyQuil.
http://rigetti.com/forest
Apache License 2.0
375 stars 123 forks source link

VQE with reference-qvm simulator #183

Open almullay opened 6 years ago

almullay commented 6 years ago

When running the "fast method" of VQE on the referenceqvm (local qvm) with samples = None in vqe_inst.vqe_run(uccsd, hamiltonian, np.random.random(9)*4, samples=None, qvm=qvm) command, I get the following error: 'QVM_Wavefunction' object has no attribute 'expectation' Can someone explain what this means and give a solution? Thanks!

peterse commented 5 years ago

what version of pyquil are you using? if before pyquil 2.0.0, you should be initializing your qvm using api.QVMConnection() - does this resolve the issue?

Otherwise if you're using pyquil 2.0.0, i'm guessing this is the same compatibility issue as in #184