-
Notifications
You must be signed in to change notification settings - Fork 21
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
Eigenmode viewer hooks #180
Conversation
(since this is getting merged first, we'll see how the diff between (also note this includes |
`Observable` hook for spin dipoles Store local rotation in LSWT.
d5ae01d
to
b012b5e
Compare
I pushed some updates:
Why not expose Makie |
This will be very slow because it empties the whole array of points and dipole vectors and then rebuilds it on every single frame. The point of having If this is the way that you want this in main Sunny, that's fine, and I'll write my own viewer function in SunnyContributed :) |
To the contrary, this is designed for maximal speed. Ping me on slack and
we can work out how your use case will fit.
…On Thu, Oct 26, 2023, 11:10 Sam Quinn ***@***.***> wrote:
This will be very slow because it empties the whole array of points and
dipole vectors and then rebuilds it on every single frame. The point of
having spin_data be separate is that it is fast to redraw (and modular to
notify, unlike NotifiableFigure).
If this is the way that you want this in main Sunny, that's fine, and I'll
write my own viewer function in SunnyContributed :)
—
Reply to this email directly, view it on GitHub
<#180 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACG3HM7RZH526VMFRPUKT3YBKKO5AVCNFSM6AAAAAA6OIIBFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRGUYTMNBZGQ>
.
You are receiving this because you commented.Message ID: <SunnySuite/Sunny
.***@***.***>
|
Following discussion on Slack and various benchmarks, it appears that this implementation is getting about maximal speed. In particular, Makie is intelligent in ignoring extra notifications if the data hasn't changed. That is, these extra notifications don't matter. notify.((vecs, pts, pts_shifted, arrowcolor)) For a system with 10k spins, I get these results for one notify
This is much slower than I like, but I think the slowdown is fundamentally on the Makie side. Note the speedup we get if the Another important thing to know is that this pattern is non-allocating: function f(a)
l = length(a)
empty!(a)
for i in 1:l
push!(a, 42)
end
end
r = randn(10)
using BenchmarkTools
@btime f(r) In particular, |
This includes all helper functions and hooks needed to make the eigenmode viewer work.