XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
101 stars 55 forks source link

Why is hbar=2? Physicist may assume hbar=1 #234

Closed yu289333 closed 3 years ago

yu289333 commented 3 years ago

Before posting an issue

Search existing GitHub issues to make sure the issue does not already exist: https://github.com/XanaduAI/thewalrus/issues

If posting a library issue, delete everything above the dashed line, and fill in the template.

If making a feature request, delete the following template and describe, in detail, the feature and why it is needed.

For general technical details check out our documentation: https://the-walrus.readthedocs.io


Issue description

Description of the issue - include code snippets and screenshots here if relevant. You may use the following template below

Source code and tracebacks

Please include any additional code snippets and error tracebacks related to the issue here.

Additional information

Any additional information, configuration or data that might be necessary to reproduce the issue.

nquesada commented 3 years ago

hbar = 2 is only the default value. All the functions where hbar is relevant can be modified by passing an extra optional argument hbar to change this value. The reason why hbar=2 is handy is because if this is the case the covariance matrix of vacuum V = (\hbar/2) identity() is just the identity.