-
Notifications
You must be signed in to change notification settings - Fork 4
Add tutorial for the Dicke model #31
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
Conversation
|
Why don't we see the preview? |
|
After I push out the dummy commit, it somehow worked. |
|
This pr is currently waiting for this pr to be merged. |
albertomercurio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from these comments, it is well written. I would avoid to use many underscores like _g, _ax and many other cases. They make the syntax more complicated.
| _ρcav = ptrace(ψGs[idx], 1) # cavity reduced state | ||
| # plot wigner | ||
| _, _ax, _hm = plot_wigner(_ρcav, location = fig[1,hpos]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to repeat the ylabel starting from the second one. I think this can be done with something like ylabel!(_ax, nothing). One can also remove the ticks labels for the y axis with something like hideydecotrations!(_ax, ticks = false). With this we should gain a bit of space, as the layout is a bit packed.
| slist = [] | ||
| for g in gs | ||
| H_ = H(M0, N, g) | ||
| _, vecs = eigenstates(H_) | ||
| S = entropy_mutual(vecs[1], 1, 2) | ||
| H_ = H(M0, N, g) | ||
| _, vecs = eigenstates(H_) | ||
| S = entropy_mutual(vecs[1], 1, 2) | ||
| push!(slist, S) | ||
| end | ||
| push!(slists, slist) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it only now. Also this case is inefficient and should be avoided in the tutorials. We are initializing an empty vector slist = [] of type Any. Moreover, I always recommend to not use push!, as it allocates memory.
You could use the same example I suggested before, with slist = map(gs) do g.
|
LGTM. I don't know if @ytdHuang has something to say. |
|
Nope~ |
Checklist
Thank you for contributing to Tutorials for Quantum Toolbox in
Julia! Please make sure you have finished the following tasks before opening the PR.datewere modified for new or updated tutorials.Version Informationsection was added at the end and displays the output ofversioninfo().make render.Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.
Description
As title