Skip to content

Commit a97a82f

Browse files
committed
Adjust energy computation
1 parent 27f8389 commit a97a82f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/PySA.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ function QUBODrivers.sample(sampler::Optimizer{T}) where {T}
5757
# Since PySA adopts the s = 1 - 2x instead of the s = 2x - 1
5858
# convention, the sign of 'h' has to be inverted, as well as
5959
# the value for each state variable in 'ψ' below
60-
h = -h
61-
62-
problem = np.array(Symmetric(J + diagm(h)))
60+
problem = np.array(Symmetric(J - diagm(h)))
6361

6462
solver = pysa_sa.Solver(
6563
problem = problem,

0 commit comments

Comments
 (0)