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

Change photon_number_expectation #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dorakingx
Copy link

@dorakingx dorakingx commented Aug 12, 2024

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new Python code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • The Walrus source code conforms to
    PEP8 standards.
    We check all of our code against Pylint.
    To lint modified files, simply pip install pylint, and then
    run pylint thewalrus/path/to/file.py.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@nquesada
Copy link
Collaborator

Is this related to this bug: #336 ?

@dorakingx
Copy link
Author

No, it's not. When calculating the variance of third-body correlations, I needed to compute the expected value of polynomial products such as N_1^2N_2 . However, I was only able to handle cases where all exponents were either 1 or 2. Therefore, I modified the photon_number_expectation function to allow for the calculation of expected values with a wider range of exponents.

@nquesada
Copy link
Collaborator

Understood. You will need to add new tests in test_quantum.py and make sure to pass pylint and black on the PR. Finally, should you be interested in the theory behind photon_number_moments, we wrote a paper explaining all sort of useful properties: https://arxiv.org/abs/2212.06067 .

@dorakingx dorakingx closed this Aug 14, 2024
@dorakingx dorakingx reopened this Aug 14, 2024
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.

2 participants