Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boltzmann sampling functionality, closes #34 #35

Merged
merged 4 commits into from
May 4, 2022

Conversation

zmorrell
Copy link
Collaborator

@zmorrell zmorrell commented Apr 6, 2022

@ccoffrin The testing on this is rather rudimentary, but I couldn't figure out a much better way to do it, since theoretically boltzmann sampling of the classical and quantum hamiltonian would give the same results under the tests which I added. I think it is best to just double check that the code is correct, which should be fine since it is only 4 lines or so.

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #35 (2a90105) into main (d7adf1b) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   92.80%   92.86%   +0.05%     
==========================================
  Files           5        5              
  Lines         598      603       +5     
==========================================
+ Hits          555      560       +5     
  Misses         43       43              
Impacted Files Coverage Δ
src/base.jl 98.33% <100.00%> (+0.15%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@ccoffrin
Copy link
Member

ccoffrin commented Apr 6, 2022

I didn't get a deep understanding of what Marc had in mind for this feature but I had imagine the API would work for an arbitrary Hamiltonian. I was expecting it would look something like z_probailities_boltzmann(hamiltonian_transverse_ising(...),1.0). My inclination is to make the beta parameter explicit as this is a fundamental term in the Boltzmann model. We might even break it down further like, z_measure_probabilities(distribution_boltzmann(hamiltonian_transverse_ising(...),1.0))

In general I would also reserve the term "sample" for functions that return a vector/histogram of states, rather than ones that can return exact probabilities.

@zmorrell
Copy link
Collaborator Author

zmorrell commented Apr 6, 2022

@ccoffrin I agree that the word sample has some different meanings when it comes to statistics, so it would probably be a good idea for me to change the name. If I am not mistaken, the code as it is written will work for any Hamiltonian that is a function of s. I will send you an email separately pointing you to what I believe Marc had in mind. I will change the name to the suggested z_probabilities_boltzmann suggestion since I think that name is consistent with the rest of the package.

@zmorrell zmorrell merged commit 73c69e6 into main May 4, 2022
@zmorrell zmorrell deleted the boltzmann-sampling branch May 23, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants