Initial conditions¶
The initial
module is for initial condition profiles.
These profiles are typically generated by Monte Carlo initial condition models for input to hydrodynamics.
The central class is hic.initial.IC
.
It takes an IC energy or entropy density profile and calculates relevant properties.
Let’s fabricate a smooth profile:
import numpy as np
Y, X = np.mgrid[-8.:8.1:.1, -8.:8.1:.1]
Y = Y[::-1] # reverse direction
Z = np.zeros_like(X)
for x0, y0 in (0, 0), (2, 3), (-2, 3), (-3, -2):
Z += np.exp(-.2*(np.square(X-x0) + np.square(Y-y0)))
This profile Z
consists of a few Gaussian blobs evaluated on a 161x161 grid from -8 to 8 fm in steps of 0.1 fm.
We can visualize it:
import matplotlib.pyplot as plt
plt.imshow(Z, cmap=plt.cm.Blues, interpolation='none')
plt.axis('off')

Now let’s create an IC
class from this profile:
from hic import initial
ic = initial.IC(Z, 0.1) # second arg is grid spacing
The center of mass of the profile is (-3/4, 1) within discretization error:
cm = ic.cm()
The total entropy (or energy) of the profile is the Riemann sum of the grid, i.e. the sum of all grid cells multiplied by the grid cell area:
total = ic.sum()
Eccentricity harmonics¶
The IC
class is most useful for calculating eccentricity harmonics \(\varepsilon_n\), defined by
where \(S\) is the entropy (or energy) profile and the integrals are taken over the entire profile relative to the center of mass. Numerically, the integrals are of course implemented as Riemann sums. Continuing with the above example, the ellipticity \(\varepsilon_2\) is
e2 = ic.ecc(2)
The triangularity is
e3 = ic.ecc(3)
We can make a list of \((n, \varepsilon_n)\) pairs:
[(n, ic.ecc(n)) for n in range(1, 10)]
Reference¶
-
class
hic.initial.
IC
(profile, dxy)¶ Initial condition entropy or energy density profile.
Parameters: - profile (array-like) – The IC profile as a block-style grid.
- dxy (float or pair of floats) – Size of each grid cell in fm, either a single value
dxy = dx = dy
or a pairdxy = (dx, dy)
.
-
cm
()¶ Center of mass coordinates, assuming the middle of the profile is (0, 0).
-
ecc
(n)¶ Calculate eccentricity harmonic \(\varepsilon_n\).
Parameters: n (int) – Eccentricity order.
-
sum
()¶ Total entropy or energy.