Skip to content

Commit

Permalink
Use zeros when constructing offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Sep 3, 2024
1 parent 1479e81 commit 2b2de72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Measurements/MeasureSpec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function empty_measurespec(sys)
corr_pairs = NTuple{2, Int}[]
combiner = (_, _) -> 0.0
formfactors = zeros(FormFactor, 0, natoms(sys.crystal))
offsets = [Vec3(0,0,0) for _ in 0:0, i in 1:natoms(sys.crystal)]
offsets = zeros(Vec3, 0, natoms(sys.crystal))
return MeasureSpec(observables, corr_pairs, combiner, formfactors, offsets)
end

Expand Down Expand Up @@ -149,14 +149,14 @@ See also the Sunny documentation on [Structure Factor Conventions](@ref).
"""
function ssf_custom(f, sys::System; apply_g=true, formfactors=nothing)
observables = all_dipole_observables(sys; apply_g)
offsets = [Vec3(0,0,0) for _ in 1:3, _ in 1:natoms(sys.crystal)]
corr_pairs = [(3,3), (2,3), (1,3), (2,2), (1,2), (1,1)]
combiner(q, data) = f(q, SA[
data[6] data[5] data[3]
conj(data[5]) data[4] data[2]
conj(data[3]) conj(data[2]) data[1]
])
formfactors = propagate_form_factors(sys, formfactors)
offsets = zeros(Vec3, 3, natoms(sys.crystal))
return MeasureSpec(observables, corr_pairs, combiner, formfactors, offsets)
end

Expand Down

0 comments on commit 2b2de72

Please sign in to comment.