Skip to content

VQE documentation is out of date with code #212

@jmbr

Description

@jmbr

When running the code snippets in grove/docs/vqe.rst the line

result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, samples=10000, qvm=noisy_qvm)

Raises the following exception:
TypeError: vqe_run() got an unexpected keyword argument 'qvm'

Similarly, the line result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, samples=10000, qvm=qvm) yields the error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/test_vqe.py in <module>
     17 vqe_inst = VQE(minimizer=minimize,
     18                minimizer_kwargs={'method': 'nelder-mead', 'options': {'disp': True}})
---> 19 result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle)

~/rigetti/grove/grove/pyvqe/vqe.py in vqe_run(self, variational_state_evolve, hamiltonian, initial_params, gate_noise, measurement_noise, jacobian, qc, disp, samples, return_all)
    133             qc = QuantumComputer(name=f"{len(qubits)}q-noisy-qvm",
    134                                  qam=QVM(gate_noise=gate_noise,
--> 135                                          measurement_noise=measurement_noise))
    136         else:
    137             self.qc = qc

~/rigetti/pyquil/pyquil/api/_error_reporting.py in wrapper(*args, **kwargs)
    236             global_error_context.log[key] = pre_entry
    237
--> 238         val = func(*args, **kwargs)
    239
    240         # poke the return value of that call in

TypeError: __init__() missing 1 required positional argument: 'connection'```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions