Skip to content

Temperature feature#436

Merged
randomir merged 33 commits intodwavesystems:masterfrom
jackraymond:temperature-feature
Oct 31, 2022
Merged

Temperature feature#436
randomir merged 33 commits intodwavesystems:masterfrom
jackraymond:temperature-feature

Conversation

@jackraymond
Copy link
Contributor

@jackraymond jackraymond commented Dec 20, 2021

Routines are provided to efficiently establish the temperature of a Classical Boltzmann sampler from a set of samples for an arbitary Hamiltonian.
This can be used to provide an estimate to the QPU 'effective temperature' (T), where it is assumed the QPU returns Boltzmann samples P(x) = exp(-H(x)/T)/Z where H(x) is the problem Hamiltonian and Z is the partition function.
This is a common support question. Uses of the QPU as a Boltzmann sampler include machine learning applications.

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2021

Codecov Report

Merging #436 (cbd9958) into master (97ac44f) will decrease coverage by 5.07%.
The diff coverage is 80.95%.

@@            Coverage Diff             @@
##           master     #436      +/-   ##
==========================================
- Coverage   91.05%   85.97%   -5.08%     
==========================================
  Files          23       24       +1     
  Lines        1543     1669     +126     
==========================================
+ Hits         1405     1435      +30     
- Misses        138      234      +96     
Impacted Files Coverage Δ
dwave/system/temperatures.py 80.64% <80.64%> (ø)
dwave/system/__init__.py 100.00% <100.00%> (ø)
dwave/system/coupling_groups.py 12.50% <0.00%> (-81.25%) ⬇️
dwave/system/samplers/leap_hybrid_sampler.py 61.42% <0.00%> (-14.29%) ⬇️
dwave/system/samplers/clique.py 73.85% <0.00%> (-13.73%) ⬇️
dwave/system/samplers/dwave_sampler.py 82.03% <0.00%> (-3.00%) ⬇️
dwave/system/composites/embedding.py 96.57% <0.00%> (-1.15%) ⬇️
dwave/system/testing.py 95.23% <0.00%> (-0.80%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@arcondello arcondello self-requested a review December 20, 2021 19:57
@arcondello arcondello added the feature-request/enhancement New feature or request label Dec 20, 2021
@arcondello
Copy link
Member

You'll need to also add this to the docs, and resolve any doctest failures. I think the simplest would be to edit https://github.com/dwavesystems/dwave-system/blob/master/docs/reference/utilities.rst to something like

.. _utilities_system:

=========
Utilities
=========

Graph Utilities
--------------

.. automodule:: dwave.system.utilities

.. currentmodule:: dwave.system.utilities

.. autosummary::
   :toctree: generated/

   common_working_graph


Temperature Utilities
---------------------

.. automodule:: dwave.system.temperatures

.. currentmodule:: dwave.system.temperatures

.. autosummary::
   :toctree: generated/

   effective_field
   maximum_pseudolikelihood_temperature
   freezeout_effective_temperature
   fast_effective_temperature

@jackraymond
Copy link
Contributor Author

As part of getting doctest to work had to overflow (beyond 80 characters) some lines, and # doctest: +SKIP to bypass this error:
WARNING: broken link: https://www.jstor.org/stable/25464568 (403 Client Error: Forbidden for url: https://www.jstor.org/stable/25464568)
Link works fine in compiled documentation.

@JoelPasvolsky
Copy link
Contributor

@jackraymond, looks like this website detects & reject robots from accessing https://www.jstor.org/stable: if you try with curl it returns Please complete this reCAPTCHA to demonstrate that it's you making the requests and not a robot.

We can update code line linkcheck_ignore = [r'https://cloud.dwavesys.com/leap', # redirects, many checks in https://github.com/dwavesystems/dwave-system/blob/master/docs/conf.py and https://github.com/dwavesystems/dwave-ocean-sdk/blob/master/docs/conf.py to ignore URL https://www.jstor.org/stable

Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are comments on the first two functions, taking a break now for other stuff

Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on third function

Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on function 4

Great new addition, @jackraymond , thank you!

@davidmerwin
Copy link

❤️

1 similar comment
@davidmerwin
Copy link

❤️

Copy link
Member

@randomir randomir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few minor issues to fix.

jackraymond and others added 22 commits October 28, 2022 15:55
Co-authored-by: Joel <34041130+JoelPasvolsky@users.noreply.github.com>
Co-authored-by: Joel <34041130+JoelPasvolsky@users.noreply.github.com>
Co-authored-by: Joel <34041130+JoelPasvolsky@users.noreply.github.com>
Co-authored-by: Joel <34041130+JoelPasvolsky@users.noreply.github.com>
@randomir randomir merged commit 05ac4f5 into dwavesystems:master Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants