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

Rename get_noisy_dynamics to get_noisy_pulses #76

Merged
merged 4 commits into from
Jul 18, 2021

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Jul 11, 2021

Description
In the noise module, users are allowed to define custom noise for their own physical model. The Noise class uses a hook method get_noisy_dynamics to realize this. This method will be called when including noise in the physical model.

It was pointed out by @quantshah that the name get_noisy_dynamics was wrong because the noise object returns a list of Pulse, instead of QobjEvo. This PR fixed this issue and use the term get_noisy_pulses. The old API is still usable but will issue a PendingDeprecationWarning.

I also copied the docstring of get_noisy_pulses to those in the subclass for easier reference. I originally thought that if the docstrings are missing, they will be inherited automatically, but this is not the case.

I also pinned @hodgestar because I briefly mentioned this and asked for your advice in one of our discussions.

In the noise module, users are allowed to define custom noise for their own physical model. The `Noise` class uses a hook method `get_noisy_dynamics` to realize this. This method will be called when including noise in the physical model.

However, the name `get_noisy_dynamics` was wrong because the noise object returns a list of `Pulse`, instead of `QobjEvo`. This PR fixed this issue and use the term `get_noisy_pulses`. The old API is still usable but will issue a `PendingDeprecationWarning`.
@BoxiLi BoxiLi added this to the qutip-qip-0.2.0 milestone Jul 11, 2021
src/qutip_qip/noise.py Outdated Show resolved Hide resolved
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Woot. That should have been a comment / request changes.

@hodgestar hodgestar self-requested a review July 12, 2021 15:53
@hodgestar
Copy link
Contributor

The duplication of the docstrings is not great, but definitely better to have the documentation appear in the apidocs than not.

Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
src/qutip_qip/noise.py Outdated Show resolved Hide resolved
src/qutip_qip/noise.py Outdated Show resolved Hide resolved
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Left a few small docstring suggestions, but looks good to me. Happy for this to be merged whenever you think it is ready @BoxiLi.

Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
@BoxiLi
Copy link
Member Author

BoxiLi commented Jul 14, 2021

Thanks for correcting the typos!

Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
@BoxiLi BoxiLi merged commit a71277b into qutip:master Jul 18, 2021
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Jul 18, 2021
* rename get_noisy_dynamics to get_noisy_pulses

In the noise module, users are allowed to define custom noise for their own physical model. The `Noise` class uses a hook method `get_noisy_dynamics` to realize this. This method will be called when including noise in the physical model.

However, the name `get_noisy_dynamics` was wrong because the noise object returns a list of `Pulse`, instead of `QobjEvo`. This PR fixed this issue and use the term `get_noisy_pulses`. The old API is still usable but will issue a `PendingDeprecationWarning`.

Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
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