Skip to content

Extend plot support for entanglementplot and transferplot to Makie.jl#428

Open
borisdevos wants to merge 14 commits into
mainfrom
bd/plotting
Open

Extend plot support for entanglementplot and transferplot to Makie.jl#428
borisdevos wants to merge 14 commits into
mainfrom
bd/plotting

Conversation

@borisdevos
Copy link
Copy Markdown
Member

Deals with #249. This works locally, below I attach the results for both Plots.jl and CairoMakie.jl*. I didn't really test any other Makie backend, but I think CairoMakie is the one you want anyways in this context.

As you can see in the attachment, I didn't really bother to make the Plots.jl plots any prettier than they were, and they remain equally blurry. Anyone willing to prettify these, feel free to do so. I put slightly more effort in the Makie plots, but even there plenty of improvements can be added.

I added todo's here and there, mostly stylistic choices.

*There are two plots per function, just to show that keyword arguments are being taken correctly:

# gs is the ground-state of the Ising Hamiltonian at g = 0.1
entanglementplot(gs)
entanglementplot(gs, expand_symmetry = true, sortby = maximum, sector_formatter = c -> "Sector $c")

transferplot(gs)
transferplot(gs; sectors = [Z2Irrep(0), Z2Irrep(1)], transferkwargs = (; num_vals = 1))

someplots.pdf

Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

This definitely looks great!
I have a couple questions, mostly since it has been a while since I looked at Makie:

Do you know if the other attributes can still be set/changed? For example, what happens if I want to override the default title/ticks/...?

I seem to recall also that there was some system with observables etc, where various parts where dynamically recalculated. Do you know if this is still relevant?

Comment thread test/Project.toml Outdated
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BlockTensorKit = "5f87ffc2-9cf1-4a46-8172-465d160bd8cd"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should probably be a weakdep?

Comment thread Project.toml Outdated
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this make sense to have as a default dependency? We could in principle also have a default xlabel that uses Unicode, and require people that wish Latex strings to specify the xlabel themselves (which I would assume people typically want anyways)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

At least for Makie I could keep the default latexstring expressions and put it as a weakdep, since it's explicitly in the deps of Makie. I put it here in deps to get it working for Plots, but we can indeed default to whatever and let the user overwrite themselves (if possible for Plots, I think I've got it working for Makie right now)

@borisdevos
Copy link
Copy Markdown
Member Author

entspec_makie_plotkwargs transpec_makie_plotkwargs

I just tried some random keyword arguments for the Makie plots, and they seem to work. I'll test tomorrow if I can do the same for Plots.
(Also I realised I was running Z2-symmetric MPS in the Z2 SSB phase 🫠)

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