Skip to content
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

Enable the use of Phantom{Array{T, N}, MotionModel{T}} #347

Open
cncastillo opened this issue Mar 28, 2024 · 2 comments
Open

Enable the use of Phantom{Array{T, N}, MotionModel{T}} #347

cncastillo opened this issue Mar 28, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@cncastillo
Copy link
Member

Feature Request

This is related to #184. By doing this, we can dispatch based on the dimension of the phantom, Maps like obj.T1 will preserve their structure (no T1[:]), preserve neighbor information (#52 ?), save memory (x, y, z can be dropped from the definition), dispatch the plotting function if the phantom is 1D, 2D, 3D, etc.

From #342 (comment):

Possibly some more of the code could go in supporting functions or macros going forward as well. A possible variation would be a an abstract phantom parent object inheriting the dimensionality and the specific input dataset along with supporting methods?

I am not sure if I understood correctly, but right now the maps (obj.T1, obj.T2, etc..) are converted to Vector{T}'s before being stored in Phantom{T}, so we lose some information. Your suggestion would be to enable Array{T,N}s? If that is the case, that sounds good to me.
It was like that at some point actually. I simplified it for simulation reasons, so the first dimension is the "spin" dimension, and the second dimension is time. Nevertheless, there are no good reasons (besides simulating fewer points ρ.==0) to pass this burden to the user, and in the cases in which we have Phantom{Array{T,N}}, that has an implicit structure, the spins' positions could be dropped.

@cncastillo cncastillo added the enhancement New feature or request label Mar 28, 2024
@cncastillo cncastillo changed the title Enable the use of Phantom{Array{T, N}, MotionModel} Enable the use of Phantom{Array{T, N}, MotionModel{T}} Mar 28, 2024
@cncastillo
Copy link
Member Author

cncastillo commented Apr 3, 2024

Maybe to not break all the code we can still provide x, y, and z but these can be UnitRange's (very memory efficient). @pvillacorta

@cncastillo
Copy link
Member Author

Maybe we to use 2D iterators (CartesianIndices).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant