Shamrock Gaussian generator#

This example shows how to use the mock gaussian function

run mock gaussian
10 import shamrock
11
12 eng = shamrock.algs.gen_seed(111)
13
14 import matplotlib.pyplot as plt
15 import numpy as np
16
17 hist, bins = np.histogram(
18     [shamrock.algs.mock_gaussian(eng) for _ in range(100000)], bins=1000, density=True
19 )
20 x = np.linspace(bins[0], bins[-1], 1000)
21 plt.plot(x, np.exp(-(x**2) / 2) / np.sqrt(2 * np.pi), "r--", lw=2)
22 plt.bar(bins[:-1], hist, np.diff(bins), alpha=0.5)
23 plt.show()

Total running time of the script: (0 minutes 0.707 seconds)

Estimated memory usage: 74 MB

Gallery generated by Sphinx-Gallery