pttools.bubble.bag

Functions for the bag equation of state.

See page 37 of Hindmarsh et al., 2021.

Functions

pttools.bubble.bag.adiabatic_index_bag(w, phase, theta_s, theta_b=0.)

Returns array of float, adiabatic index (ratio of enthalpy to energy).

Parameters:
  • w (float | float64 | ndarray) – enthalpy \(w\)

  • phase (int | ndarray) – phase indicator

  • theta_s (float | float64 | ndarray) – \(\theta\) for symmetric phase, ahead of bubble (phase = 0)

  • theta_b (float | float64 | ndarray) – \(\theta\) for broken phase, behind bubble (phase = 1)

Returns:

adiabatic index

Return type:

float | float64 | ndarray

pttools.bubble.bag.check_thetas(theta_s, theta_b)

Check that \(\theta_s \leq \theta_b\).

Parameters:
  • theta_s (float | float64 | ndarray) – \(\theta_s\)

  • theta_b (float | float64 | ndarray) – \(\theta_b\)

Return type:

None

pttools.bubble.bag.cs2_bag(w, phase)

Speed of sound squared in Bag model, equal to \(\frac{1}{3}\) independent of enthalpy \(w\).

Parameters:
  • w (float | float64 | ndarray) – enthalpy \(w\)

  • phase (float | float64 | ndarray) – phase \(\phi\)

Returns:

speed of sound squared \(c_s^2\)

Return type:

float | float64 | ndarray

pttools.bubble.bag.cs2_bag_arr(w, phase)
Parameters:
Return type:

ndarray

pttools.bubble.bag.cs2_bag_scalar(w, phase)

The scalar versions of the bag functions have to be compiled to cfuncs if jitting is disabled, as otherwise the cfunc version of the differential cannot be created.

Parameters:
  • w (float)

  • phase (Phase)

Return type:

float

pttools.bubble.bag.e_bag(w, phase, theta_s, theta_b=0.)

Energy density \(e\) as a function of enthalpy \(w\), assuming bag model. \(\theta = \frac{e - 3p}{4}\) (“vacuum energy”). Enthalpy and phase can be arrays of the same shape. See also the equation 4.10.

Parameters:
  • w (float | float64 | ndarray) – enthalpy \(w\)

  • phase (int | ndarray) – phase indicator

  • theta_s (float | float64 | ndarray) – \(\theta\) for symmetric phase, ahead of bubble (phase = 0)

  • theta_b (float | float64 | ndarray) – \(\theta\) for broken phase, behind bubble (phase = 1)

Returns:

energy density \(e\)

Return type:

float | float64 | ndarray

pttools.bubble.bag.p_bag(w, phase, theta_s, theta_b=0.)

Pressure as a function of enthalpy \(w\), assuming bag model. \(\theta = \frac{e - 3p}{4}\) (trace anomaly or “vacuum energy”). Enthalpy, theta and phase can be arrays of the same shape. See also the equation 4.40.

Parameters:
  • w (float | float64 | ndarray) – enthalpy \(w\)

  • phase (int | ndarray) – phase indicator

  • theta_s (float | float64 | ndarray) – \(\theta\) for symmetric phase, ahead of bubble (phase = 0)

  • theta_b (float | float64 | ndarray) – \(\theta\) for broken phase, behind bubble (phase = 1)

Returns:

pressure \(p\)

Return type:

float | float64 | ndarray

pttools.bubble.bag.theta_bag(w, phase, alpha_n)

Trace anomaly \(\theta = \frac{1}{4} (e - 3p)\) in the Bag model. Equation 7.24 in the lecture notes, equation 2.10 in the article.

Parameters:
  • w (float | float64 | ndarray) – enthalpy \(w\)

  • phase (int | ndarray) – phase(s)

  • alpha_n (float | float64 | ndarray) – strength of the transition \(\alpha_n\)

Returns:

trace anomaly \(\theta_\text{bag}\)

Return type:

float | float64 | ndarray

pttools.bubble.bag.w_bag(e, phase, theta_s, theta_b=0.)

Enthalpy \(w\) as a function of energy density, assuming bag model. \(\theta = \frac{e - 3p}{4}\) (“vacuum energy”). Enthalpy and phase can be arrays of the same shape. Mentioned on page 23.

Parameters:
  • e (float | float64 | ndarray) – energy density

  • phase (int | ndarray) – phase indicator

  • theta_s (float | float64 | ndarray) – \(\theta\) for symmetric phase, ahead of bubble (phase = 0)

  • theta_b (float | float64 | ndarray) – \(\theta\) for broken phase, behind bubble (phase = 1)

Returns:

enthalpy \(w\)

Return type:

float | float64 | ndarray