Skip to content

Conversation

JosephPeterDevlin
Copy link
Collaborator

No description provided.

@mattsignorelli
Copy link
Member

@JosephPeterDevlin could you take a look at my modifcations?

@JosephPeterDevlin
Copy link
Collaborator Author

@mattsignorelli There is a problem with them, this line with the Toy AGS as ring causes a seg fault:

M = track(ring, [0.0 0.0 2.5e-4 0.0 0.0 0.0], [0.0 1.0 0.0]; n_turns=1000);

@mattsignorelli
Copy link
Member

Ok I kinda fixed it but it is super slow. Was it this slow in your original implementation?

@mattsignorelli
Copy link
Member

1 particle for 1000 turns should not take several seconds

@mattsignorelli
Copy link
Member

mattsignorelli commented Oct 14, 2025

I guarantee most of the tracking time is spent writing to the tensor and poor performance practices in the track loop (which i too am guilty of).

I wonder if we can try to quickly eek-out a memcopy kernel and just skip this 3-vector every single turn thing instead just tracking the quaternion always

@JosephPeterDevlin
Copy link
Collaborator Author

No, it wasn't that slow before. 1 particle for 10,000 turns was 6 seconds before.

@JosephPeterDevlin
Copy link
Collaborator Author

I just tried it with storing 3-vectors and 1 particle for 1,000 turns only took 0.76 seconds. This is about the same speed as before. I don't understand the advantage of tracking the quaternion always if I'm going to want to turn every single turn into a spin vector in the end anyway.

@mattsignorelli mattsignorelli merged commit e0f4a5d into main Oct 15, 2025
4 checks passed
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