Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vqe.rst to fix issue #212 (VQE documentation is out of date) #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/vqe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ variational quantum eigensolver.

.. code:: python

result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, None, qvm=qvm)
result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, None, qc=qvm)
print(result)

.. parsed-literal::
Expand Down Expand Up @@ -227,7 +227,7 @@ with a larger simplex so we don't get stuck at an initial minimum.
.. code:: python

vqe_inst.minimizer_kwargs = {'method': 'Nelder-mead', 'options': {'initial_simplex': np.array([[0.0], [0.05]]), 'xatol': 1.0e-2}}
result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, samples=10000, qvm=noisy_qvm)
result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, samples=10000, qc=noisy_qvm)
print(result)

.. parsed-literal::
Expand Down Expand Up @@ -296,7 +296,7 @@ Measurement noise has a different effect:
for noise in noises:
meas_channel = [noise] * 3
noisy_qvm = api.QVMConnection(measurement_noise=meas_channel)
result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, samples=10000, qvm=noisy_qvm)
result = vqe_inst.vqe_run(small_ansatz, hamiltonian, initial_angle, samples=10000, qc=noisy_qvm)
data.append(result['fun'])

.. code:: python
Expand Down Expand Up @@ -336,7 +336,7 @@ easily change the number of gates.
vqe_inst = VQE(minimizer=minimize,
minimizer_kwargs={'method': 'nelder-mead'})
initial_angles = [1.0, 1.0]
result = vqe_inst.vqe_run(smallish_ansatz, hamiltonian, initial_angles, None, qvm=qvm)
result = vqe_inst.vqe_run(smallish_ansatz, hamiltonian, initial_angles, None, qc=qvm)
print(result)

.. parsed-literal::
Expand Down Expand Up @@ -367,7 +367,7 @@ parameterization:
.. code:: python

initial_params = [1.0, 3]
result = vqe_inst.vqe_run(variable_gate_ansatz, hamiltonian, initial_params, None, qvm=qvm)
result = vqe_inst.vqe_run(variable_gate_ansatz, hamiltonian, initial_params, None, qc=qvm)
print(result)

.. parsed-literal::
Expand Down