Skip to content
Snippets Groups Projects
Commit 300da90d authored by Philipp Arras's avatar Philipp Arras
Browse files

Comment

parent 0327ffdc
Branches
Tags
No related merge requests found
...@@ -56,6 +56,10 @@ def CorrelatedField(target, amplitude_operator, name='xi'): ...@@ -56,6 +56,10 @@ def CorrelatedField(target, amplitude_operator, name='xi'):
power_distributor = PowerDistributor(h_space, p_space) power_distributor = PowerDistributor(h_space, p_space)
A = power_distributor(amplitude_operator) A = power_distributor(amplitude_operator)
vol = h_space.scalar_dvol**-0.5 vol = h_space.scalar_dvol**-0.5
# When doubling the resolution of `tgt` the value of the highest k-mode
# will scale with a square root. `vol` cancels this effect such that the
# same power spectrum can be used for the spaces with the same volume,
# different resolutions and the same object in them.
return ht(vol*A*ducktape(h_space, None, name)) return ht(vol*A*ducktape(h_space, None, name))
...@@ -103,5 +107,6 @@ def MfCorrelatedField(target, amplitudes, name='xi'): ...@@ -103,5 +107,6 @@ def MfCorrelatedField(target, amplitudes, name='xi'):
a = [dd @ amplitudes[ii] for ii, dd in enumerate(d)] a = [dd @ amplitudes[ii] for ii, dd in enumerate(d)]
a = reduce(lambda x, y: x*y, a) a = reduce(lambda x, y: x*y, a)
A = pd @ a A = pd @ a
# For `vol` see comment in `CorrelatedField`
vol = reduce(lambda x, y: x*y, [sp.scalar_dvol**-0.5 for sp in hsp]) vol = reduce(lambda x, y: x*y, [sp.scalar_dvol**-0.5 for sp in hsp])
return ht(vol*A*ducktape(hsp, None, name)) return ht(vol*A*ducktape(hsp, None, name))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment