Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian S. Steiger committed Sep 22, 2018
1 parent 960e6d0 commit c57bfd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/variational_eigensolver.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Implementation of a variational quantum eigensolver.
The example shown here is from the paper "Scalable Quantum Simulation of
The example shown here is from the paper "Scalable Quantum Simulation of
Molecular Energies" by P.J.J. O'Malley et al. arXiv:1512.06860v2
(Note that only the latest arXiv version contains the correct coefficients of
the hamiltonian)
Expand Down Expand Up @@ -116,7 +116,7 @@ def energy(theta, hamiltonian):
for i in range(len(raw_data_table_1)):
# Use data of paper to construct the Hamiltonian
bond_distances.append(raw_data_table_1[i][0])
hamiltonian = raw_data_table_1[i][1] * QubitOperator(()) # == identity
hamiltonian = raw_data_table_1[i][1] * QubitOperator(()) # == identity
hamiltonian += raw_data_table_1[i][2] * QubitOperator("Z0")
hamiltonian += raw_data_table_1[i][3] * QubitOperator("Z1")
hamiltonian += raw_data_table_1[i][4] * QubitOperator("Z0 Z1")
Expand All @@ -136,4 +136,4 @@ def energy(theta, hamiltonian):
plt.plot(bond_distances, lowest_energies, "b.-",
label="Ground-state energy of molecular hydrogen")
plt.legend()
plt.show()
plt.show()

0 comments on commit c57bfd1

Please sign in to comment.