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

intensities_bands doesn't accept arbitrarily shaped arrays #252

Closed
ddahlbom opened this issue Mar 22, 2024 · 2 comments
Closed

intensities_bands doesn't accept arbitrarily shaped arrays #252

ddahlbom opened this issue Mar 22, 2024 · 2 comments

Comments

@ddahlbom
Copy link
Member

In contrast with the other intensities functions (e.g., intensities_interpolated, intensities_broadened), intensities_bands only accepts linear arrays of wave vectors. For example, the following,

qs = [(a, b, 0) for a in range(-1, 1, 100), b in range(-1, 1, 100)]
disp, is = intensities_bands(swt, qs, formula)

will throw a broadcast error, whereas the other intensities functions will return an array with dimensions consistent with the input array of wave vectors.

Just leaving this as a reminder. Changing this would be good for interface consistency and for being able to create 3D plots of dispersion relations.

@Lazersmoke
Copy link
Contributor

Oops my bad! Just need to replace length(ks) -> size(ks)... on these lines I think:

https://github.com/SunnySuite/Sunny.jl/blob/4cebde92584accaf0be43f6e25a872ae8c442812/src/Intensities/LinearSpinWaveIntensities.jl#L68C38-L69

Lazersmoke added a commit to Lazersmoke/Sunny.jl that referenced this issue May 22, 2024
kbarros pushed a commit that referenced this issue May 24, 2024
@kbarros
Copy link
Member

kbarros commented May 25, 2024

This was fixed in #265, which has become part of #230.

@kbarros kbarros closed this as completed May 27, 2024
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

No branches or pull requests

3 participants