Skip to content

Commit

Permalink
docstring typo corrected, edge case in tests corrected for.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackraymond authored and randomir committed Jun 10, 2022
1 parent e2046b8 commit 3d154ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions neal/sampler.py
Expand Up @@ -378,7 +378,7 @@ def _default_ising_beta_range(h, J,
Couplings of Ising model (also called quadratic biases)
max_single_qubit_excitation_rate (float, optional, default = 0.01):
Targetted single qubit excitation rate at final temperature.
Targeted single qubit excitation rate at final temperature.
We can set this value small to lower the probability of
excitations at the end of the anneal, combined with a simple
approximation to the ground-state energy structure.
Expand Down Expand Up @@ -408,7 +408,7 @@ def _default_ising_beta_range(h, J,
a global (or local) minimum.
"""
if not (max_single_qubit_excitation_rate>0 and max_single_qubit_excitation_rate<1):
raise ValueError('Targetted single qubit excitations rates must be in range (0,1)')
raise ValueError('Targeted single qubit excitations rates must be in range (0,1)')


# Approximate worst and best cases of the [non-zero] energy signal (effective field)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_simulated_annealing.py
Expand Up @@ -126,7 +126,7 @@ def test_submit_problem(self):
self.assertTrue(samples.shape == (num_samples, num_variables),
"Sampler returned wrong shape for samples")
# make sure samples contain only +-1
self.assertTrue(set(np.unique(samples)) == {-1, 1},
self.assertTrue(set(np.unique(samples)).issubset({-1, 1}),
"Sampler returned spins with values not equal to +-1")

# ensure energies is valid
Expand Down

0 comments on commit 3d154ab

Please sign in to comment.