-
Notifications
You must be signed in to change notification settings - Fork 56
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
Adds functions for calculating the total photon distribution of k lossy squeezed states #230
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e4bf46e
passes test_total_photon_number_distribution_values
nquesada dbf9946
All test pass
nquesada 80c39e6
All test pass
nquesada 6b2dfb3
Removes repetition
nquesada 905cc43
Removes repetition
nquesada 314816e
Implements code review
nquesada 229e538
Apply suggestions from code review
nquesada 6b4cf2a
Apply suggestions from code review
nquesada 3f5c8ff
Apply suggestions from code review
nquesada 959d492
updates changelog
nquesada File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how this
pref
comes in here, but I assume it's correct. It was the only part I didn't recognize in the equation. 😆There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. So, you at least agree that if
pref=1
everything checks. Now the idea is that we want to calculate the probability times pref**n. If you check both the even and the odd cases you can verify that this indeed the case. I just have put the prefactorpref
in the same bracket as any other terms that is also raised to the powern
, namelyeta * np.tanh(s)
to make it more stable. For example imagine that prefactor ispref=1.99
andeta*np.tanh(s) = 0.5
then if you take power separately you will find a gigantic number times a very small number, if you multiply them together and then take the power you will get something like0.995*n
which is a lot nicer numerically.