Skip to content

Conversation

@MathiB123
Copy link
Contributor

A notebook with examples on how to use the distributions currently in qutip.distributions.

Comment on lines 26 to 27
from qutip import *
from qutip.distributions import *
Copy link
Member

Choose a reason for hiding this comment

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

from ... import * hide what is imported.
For tutorials, we should always import implicitly what we need.
We also don't shorten qutip to qt in tutorials.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified it just now. Also removed example for WignerDistribution, QDistribution and TwoModeQuadratureCorrelations because already in visualization-exposition.md

Examples for removed material are already in visualization-exposition.md

Optionally, define a range of values for each coordinate with the parameter called `extent`. Also, define a number of data points inside the given range with the optional parameter called `steps`. From this information, the distribution is generated and can be visualized with the `.visualize()` method.

It is also possible to calculate, along a given axis, the marginal distribution with `.marginal()` or the projection distribution with `.project()`.
Copy link
Member

Choose a reason for hiding this comment

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

marginal and project are only useful for 2d distributions.
It's not used for harmonic oscillator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed that

@Ericgig
Copy link
Member

Ericgig commented Jan 15, 2025

Could you merge the latest change in the main branch.
There was a bug stopping the automated tests.

@MathiB123 MathiB123 closed this Jan 16, 2025
@MathiB123 MathiB123 deleted the distributions_notebook branch January 16, 2025 13:49
@MathiB123 MathiB123 restored the distributions_notebook branch January 16, 2025 13:49
@MathiB123 MathiB123 reopened this Jan 16, 2025
@Ericgig Ericgig merged commit 0d87e07 into qutip:main Jan 16, 2025
3 checks passed
@MathiB123 MathiB123 deleted the distributions_notebook branch January 16, 2025 18:48
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