Skip to content

Commit

Permalink
Changing a comment, and removing splat in program generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ampolloreno committed May 29, 2018
1 parent b129bfa commit 96c1ffa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions grove/pyqaoa/qaoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, qvm, qubits, steps=1, init_betas=None,
Default=False.
"""

# Randomize seed
# Seed the random number generator, if a seed is provided.
if rand_seed is not None:
np.random.seed(rand_seed)

Expand Down Expand Up @@ -97,7 +97,7 @@ def __init__(self, qvm, qubits, steps=1, init_betas=None,

self.ref_state_prep = (
driver_ref or
pq.Program(*[H(i) for i in self.qubits])
pq.Program([H(i) for i in self.qubits])
)

if store_basis:
Expand Down Expand Up @@ -153,8 +153,7 @@ def psi_ref(params):
:return: a pyquil program object
"""
if len(params) != 2*self.steps:
raise ValueError("params doesn't match the number of parameters set "
"by `steps`")
raise ValueError("params doesn't match the number of parameters set by `steps`")
betas = params[:self.steps]
gammas = params[self.steps:]

Expand Down

0 comments on commit 96c1ffa

Please sign in to comment.