Skip to content

Commit

Permalink
update units in dwave schedules and docs, closes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoffrin committed Feb 23, 2022
1 parent bbbf46a commit 2fbf9ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ QuantumAnnealing.jl Change Log
- Add variant of `solve_de` with adaptive solve tolerance
- Add tools for working with classical Ising models (#8)
- Add data processing tools (#6)
- Update units in dwave annealing schedules

### v0.0.1
- Initial release
12 changes: 6 additions & 6 deletions src/dwave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const AS_DW_QUADRATIC = AnnealingSchedule(
if s >= 0.69
return 0
else
return 6.366401*((1.449275)^2*s^2 + (-2.898551)*s + 1.0)/-2.0*(2.0*π)
return (6.366401*((1.449275)^2*s^2 + (-2.898551)*s + 1.0)*(2.0*π))/-2.0
end
end,
function B(s)
return 14.55571*(0.85*s^2 + 0.15*s + 0.0)/2.0*(2.0*π)
return (14.55571*(0.85*s^2 + 0.15*s + 0.0)*(2.0*π))/2.0
end,
default_dwave_initial_state
)
Expand Down Expand Up @@ -154,15 +154,15 @@ function parse_dwave_annealing_schedule(infile; header=1, delim=',', interpolati
push!(b_values, row[3])
end

# change from GHz to natural units (annealing time in nanoseconds)
a_values = a_values .* (2.0*π)
b_values = b_values .* (2.0*π)

# rescale and swap sign based on D-Wave hamiltonian convention
# https://docs.dwavesys.com/docs/latest/c_qpu_annealing.html
a_values = a_values ./ -2.0
b_values = b_values ./ 2.0

# change from GHz to natural units (annealing time in nanoseconds)
a_values = a_values .* (2.0*π)
b_values = b_values .* (2.0*π)

if interpolation == :none
a_pwp = _calc_constant_pwp(s_values, a_values)
b_pwp = _calc_constant_pwp(s_values, b_values)
Expand Down

0 comments on commit 2fbf9ee

Please sign in to comment.