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

Brute force samplers #152

Merged
merged 24 commits into from
Mar 18, 2020
Merged

Brute force samplers #152

merged 24 commits into from
Mar 18, 2020

Conversation

nquesada
Copy link
Collaborator

@nquesada nquesada commented Mar 17, 2020

Adds a number of methods for calculating the photon number distributions.

  • Adds the ability to calculate the photon number distribution of a pure state or mixed state using generate_probabilities.

  • Allows to update the photon number distirbution when undergoing loss by using update_probabilities_with_loss.

  • Adds a brute force sampler photon_number_sampler that given a (multi-)mode photon number distribution generates photon number samples.

@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

Merging #152 into master will not change coverage by %.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #152   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          887       924   +37     
=========================================
+ Hits           887       924   +37     
Impacted Files Coverage Δ
thewalrus/quantum.py 100.00% <100.00%> (ø)
thewalrus/samples.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4a1089...94a4884. Read the comment docs.

@nquesada nquesada requested a review from thisac March 17, 2020 19:07
@nquesada nquesada requested a review from josh146 March 17, 2020 19:27
Copy link
Contributor

@thisac thisac left a comment

Choose a reason for hiding this comment

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

Looks great @nquesada! Just a few minor aesthetic/pylint things and docstring changes I suggested. 🙂

thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/samples.py Show resolved Hide resolved
thewalrus/samples.py Outdated Show resolved Hide resolved
thewalrus/tests/test_quantum.py Show resolved Hide resolved
thewalrus/tests/test_quantum.py Show resolved Hide resolved
thewalrus/tests/test_samples.py Show resolved Hide resolved
thewalrus/samples.py Show resolved Hide resolved
thewalrus/tests/test_integration.py Show resolved Hide resolved
thewalrus/tests/test_integration.py Show resolved Hide resolved
thewalrus/tests/test_quantum.py Outdated Show resolved Hide resolved
nquesada and others added 11 commits March 17, 2020 16:05
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Co-Authored-By: Theodor <theodor@xanadu.ai>
Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Awesome new features @nquesada

thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Show resolved Hide resolved
thewalrus/samples.py Outdated Show resolved Hide resolved
thewalrus/samples.py Outdated Show resolved Hide resolved
thewalrus/samples.py Outdated Show resolved Hide resolved
thewalrus/tests/test_samples.py Show resolved Hide resolved
@nquesada nquesada merged commit ffcccd2 into master Mar 18, 2020
@nquesada nquesada deleted the brute_force branch March 18, 2020 14: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.

3 participants