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

Fix silent ignoring of offset in coherent and coherent_dm when offset is non-zero. #1741

Conversation

hodgestar
Copy link
Contributor

Description
Raise an error instead of silently ignoring the offset when attempting to generate coherent states or density matrices with method 'operator' and non-zero offset.

Related issues or PRs

Changelog
Fix silent ignoring of offset in coherent and coherent_dm when offset is non-zero. A ValueError is now raised instead.

@hodgestar
Copy link
Contributor Author

I also removed an unused import and a bare except because robot minions complained about them while editing.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 68.347% when pulling c5e0aee on hodgestar:fix/raise-error-if-offset-nonzero-is-used-with-meth-operator-in-coherent into 9b859e8 on qutip:master.

@hodgestar hodgestar added this to the QuTiP 4.7 milestone Dec 14, 2021
@hodgestar hodgestar merged commit b71625e into qutip:master Dec 14, 2021
@hodgestar hodgestar deleted the fix/raise-error-if-offset-nonzero-is-used-with-meth-operator-in-coherent branch December 10, 2022 15:42
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