Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Point Mass Amplitudes

Authors
Affiliations
NTNU---Norwegian University of Science and Technology
NTNU---Norwegian University of Science and Technology

This test follows up on problems arising from Custom Amplitudes Files and tests calculation of roulette amplitudes from python.

Preparation

CosmoSim version: 3.4.0

We use the same configuration as we have used before.

We set up two simulators. We show only the raytrace simulation for now. This will be used as a reference to assess the fidelity of other simulations. Even though the simulator is set up for raytrace, it will also compute the roulette amplitudes for us. We centre the image, as this is the standard mode of operation in practice, and thus best tested.

<Figure size 640x480 with 1 Axes>

Roulette Amplitudes

As we have shown in previous demos, we can retrieve all the amplitudes as a pandas Series object.

This calculation is made in double precision in the C+= library. The python code also offers a calculation in arbidtrary precision. The default is 64 digits at present. This computation is slow, so do not worry if you do not see the results immediately.

[['0', '1', '-g**2*x/(x**2 + y**2)', '-g**2*y/(x**2 + y**2)'], ['1', '0', '0', '0']]

We can compare the two, but we need a little trick to disregard non-numeric entries.

Loading...

We can quickly check the worst discrepancy:

Loading...
Absolute error: 0.000000000000001205503640941245663955074471175680505937357722165289236644271295
Loading...

It is impossible to read the high precision numbers in this display format. For instance β14\beta^4_1 seems to have a differance greater than one. We can check this by converting to double, or otherwise print in scientific notation.

C++                    0.0
Python                 0.0
Difference             0.0
Relative difference    NaN
Name: beta[4][1], dtype: float64

Resimulation

[getSource] src=SersicSphere, ltprf0=None, verbose=1
[SphericalSource] constructor done
<Figure size 1500x500 with 3 Axes>
[getSource] src=SersicSphere, ltprf0=None, verbose=1
[SphericalSource] constructor done
<Figure size 1500x500 with 3 Axes>
<Figure size 1500x500 with 3 Axes>
<Figure size 1500x500 with 3 Axes>

Further inspection

[46.44635086 23.22317543]

Conclusion