Closed jackraymond closed 7 months ago
@JoelPasvolsky suggested as a reviewer.
@jackraymond, I started reviewing now but is it possible you have a switched sign for your temperatures.h_to_fluxbias()
function?
>>> fb = [0]*qpu.properties['num_qubits']
>>> fb[30] = temperatures.h_to_fluxbias(0.5)
>>> # What I expect is an equivalent to this (most spins down):
>>> sampleset = qpu.sample_ising({30: 0.5}, {}, num_reads=5000, auto_scale=False)
>>> print(sampleset)
30 energy num_oc.
0 -1 -0.5 4923
1 +1 0.5 77
>>> # What I get is the opposite (most spins up):
>>> sampleset = qpu.sample_ising({30: 0}, {}, num_reads=5000, auto_scale=False, flux_biases=fb)
>>> print(sampleset)
30 energy num_oc.
0 -1 0.0 277
1 +1 0.0 4723
@jackraymond, I started reviewing now but is it possible you have a switched sign for your
temperatures.h_to_fluxbias()
function?>>> fb = [0]*qpu.properties['num_qubits'] >>> fb[30] = temperatures.h_to_fluxbias(0.5) >>> # What I expect is an equivalent to this (most spins down): >>> sampleset = qpu.sample_ising({30: 0.5}, {}, num_reads=5000, auto_scale=False) >>> print(sampleset) 30 energy num_oc. 0 -1 -0.5 4923 1 +1 0.5 77 >>> # What I get is the opposite (most spins up): >>> sampleset = qpu.sample_ising({30: 0}, {}, num_reads=5000, auto_scale=False, flux_biases=fb) >>> print(sampleset) 30 energy num_oc. 0 -1 0.0 277 1 +1 0.0 4723
Yep - convention for flux_biases is opposite to the convention for h. Minus sign matters!
Also need to be added to this file I'm not sure that having these function under Temperature Utilities is optimal.
This repo contains conversions from GHz to kB T , and some other related functions. Not sure there is a better spot. The temperature estimators can use this function directly under the freeze-out hypothesis to estimate effective temperature, so the code will interface directly with other functions in the module.
However, happy to consider other options.
This repo contains conversions from GHz to kB T , and some other related functions.
I wasn't concerned with the source file, I mean that users looking to use flux bias as a substitution for an h
bias might not look at this temperature-related doc section.
For the docs, should these be bumped out to general Utilities page functions?
This repo contains conversions from GHz to kB T , and some other related functions.
I wasn't concerned with the source file, I mean that users looking to use flux bias as a substitution for an
h
bias might not look at this temperature-related doc section. For the docs, should these be bumped out to general Utilities page functions?
I'll create a 'Unit conversion' subsection, unless you have a better suggestion
@JoelPasvolsky, test failures here are caused by (private) changes in cloud-client 0.11.3. The fix for mock tests that tweak client internals is in https://github.com/dwavesystems/dwave-system/pull/515.
Attention: Patch coverage is 79.31034%
with 6 lines
in your changes are missing coverage. Please review.
Project coverage is 87.61%. Comparing base (
7ddf451
) to head (22f3153
).
Files | Patch % | Lines |
---|---|---|
dwave/system/temperatures.py | 79.31% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Both flux_biases and h apply time dependent longitudinal fields (fields conjugate to sigma^z in the Hamiltonian description, see documentation). At given point in the anneal s=t/t_a, h and flux_biases can apply equal longitudinal fields subject to rescaling. If a freeze-out phenomena is assumed at a given s, as relevant to quantum Boltzmann or Boltzmann sampling, flux_biases can be replaced by h or vice-versa. 'h' is typically unitless, whereas flux has units of Phi0, the conversion is a function of published QPU properties B(s) and M_AFM. This pull request adds code for this conversion.