scri.flux

Functions

angular_momentum_flux(h[, hdot])

Compute angular momentum flux from waveform

boost_flux(h[, hdot])

Computes the boost flux from the waveform.

energy_flux(h)

Compute energy flux from waveform

j_plusminus(ell_min, ell_max, sign)

Produce the function j_plus or j_minus, based on sign.

j_z(ell_min, ell_max)

Generator for jᶻ matrix elements (for use with matrix_expectation_value)

matrix_expectation_value(a, M, b[, ...])

The matrix expectation value ⟨a|M|b⟩(u), where M is a linear operator

momentum_flux(h)

Compute momentum flux from waveform

p_plusminus(ell_min, ell_max, sign[, s])

Produce the function p_plus or p_minus, based on sign.

p_z(ell_min, ell_max[, s])

Generator for pᶻ matrix elements (for use with matrix_expectation_value)

poincare_fluxes(h[, hdot])

Compute fluxes of energy, momentum, angular momemntum, and boost

sparse_expectation_value(abar, rows, ...)

Helper function for the main calculation of matrix_expectation_value

swsh_indices_to_matrix_indices(matrix_iterator)

Convert SWSH-indexed function into caching sparse matrix-indexed function

scri.flux.angular_momentum_flux(h, hdot=None)[source]

Compute angular momentum flux from waveform

This implements Eq. (2.24) from Ruiz et al. (2008) [0707.4654] by using matrix_expectation_value with (internal) helper functions j_z, j_plus, and j_minus.

scri.flux.boost_flux(h, hdot=None)[source]

Computes the boost flux from the waveform.

This implements Eq. (C.1) from Flanagan & Nichols (2016) [1510.03386] for the boost vector field.

Notes

Boost flux is analytically calculated using the Wald & Zoupas formalism, following the calculation by Flanagan & Nichols [1510.03386]. Then, the NP formalism is implemented to make it computationally feasible. The conventions of Ruiz et al. (2008) [0707.4654] are followed.

The expression for boost flux is

boost_flux(h) = (-1/32π) (

(1/8) [⟨ð̄N|χ|ð̄h⟩ - ⟨ðN|χ|ðh⟩ + ⟨ð̄h|χ|ð̄N⟩ - ⟨ðh|χ|ðN⟩ + 6⟨N|χ|h⟩ + 6⟨h|χ|N⟩] - (1/4) [⟨ðN|ðχ|h⟩ + ⟨h|ð̄χ|ðN⟩] - (u/2) ⟨N|χ|N⟩

)

h and N have spin weight s=-2. χ is an l=1, s=0 function characterizing the direction of the boost. ð and ð̄ are spin raising and lowering operators.

The matrix elements for most of the terms are identical to pᶻ, p⁺, and p⁻ matrix elements, except that input for s is different. For example, ⟨ð̄N|χ|ð̄h⟩ will have s = -3. There are two terms ⟨ðN|ðχ|h⟩ and ⟨h|ð̄χ|ðN⟩ for which matrix elements have been defined below.

scri.flux.energy_flux(h)[source]

Compute energy flux from waveform

This implements Eq. (2.8) from Ruiz et al. (2008) [0707.4654].

scri.flux.j_minus(ell_min, ell_max, *, sign=-1)

Produce the function j_plus or j_minus, based on sign.

The conventions for these matrix elements, to agree with Ruiz et al. (2008) [0707.4654], should be:

⟨j,n|j⁺|l,m⟩ = i √[(l-m)(l+m+1)] δⱼₗ δₙₘ₊₁ ⟨j,n|j⁻|l,m⟩ = i √[(l+m)(l-m+1)] δⱼₗ δₙₘ₋₁

The spinsfast function ladder_operator_coefficient(l, m) gives √[(l-m)(l+m+1)].

scri.flux.j_plus(ell_min, ell_max, *, sign=1)

Produce the function j_plus or j_minus, based on sign.

The conventions for these matrix elements, to agree with Ruiz et al. (2008) [0707.4654], should be:

⟨j,n|j⁺|l,m⟩ = i √[(l-m)(l+m+1)] δⱼₗ δₙₘ₊₁ ⟨j,n|j⁻|l,m⟩ = i √[(l+m)(l-m+1)] δⱼₗ δₙₘ₋₁

The spinsfast function ladder_operator_coefficient(l, m) gives √[(l-m)(l+m+1)].

scri.flux.j_plusminus(ell_min, ell_max, sign)[source]

Produce the function j_plus or j_minus, based on sign.

The conventions for these matrix elements, to agree with Ruiz et al. (2008) [0707.4654], should be:

⟨j,n|j⁺|l,m⟩ = i √[(l-m)(l+m+1)] δⱼₗ δₙₘ₊₁ ⟨j,n|j⁻|l,m⟩ = i √[(l+m)(l-m+1)] δⱼₗ δₙₘ₋₁

The spinsfast function ladder_operator_coefficient(l, m) gives √[(l-m)(l+m+1)].

scri.flux.j_z(ell_min, ell_max)[source]

Generator for jᶻ matrix elements (for use with matrix_expectation_value)

Matrix elements yielded are

⟨j,n|jᶻ|l,m⟩ = i m δⱼₗ δₙₘ

This follows the convention for jᶻ from Ruiz et al. (2008) [0707.4654]

scri.flux.matrix_expectation_value(a, M, b, allow_LM_differ=False, allow_times_differ=False)[source]

The matrix expectation value ⟨a|M|b⟩(u), where M is a linear operator

Treat two spin-s waveforms a, b (in the modal representation) as vectors. Then we can form the ‘expectation value’

⟨a|M|b⟩(u) ≡ ∑ⱼₙₗₘ āⱼₙ(u) Mⱼₙₗₘ bₗₘ(u).

For efficiency with sparse matrices, M should be implemented as a generator which yields tuples (j, n, l, m, Mⱼₙₗₘ) for only the non-vanishing matrix elements.

Parameters:
aWaveformModes object

The waveform |a⟩. This function is “antilinear” in a.

Mcallable

M will be called like for ellp, mp, ell, m, M_el in M(ell_min, ell_max): This is best implemented as a generator yielding tuples (ellp, mp, ell, m, M_{ellp mp ell m}) which range over ell, ellp values up to and including ell_max, for only the non-vanishing matrix elements of M.

bWaveformModes object

The waveform |b⟩. This function is linear in b.

allow_LM_differbool, optional [default: False]

If True and if the set of (ell,m) modes between a and b differ, then the inner product will be computed using the intersection of the set of modes.

allow_times_differ: bool, optional [default: False]

If True and if the set of times between a and b differ, then both WaveformModes will be interpolated to the intersection of the set of times.

Returns:
times, expect_valndarray, complex ndarray

Resulting tuple has length two. The first element is the set of times u for the timeseries. The second element is the timeseries of ⟨a|M|b⟩(u).

scri.flux.momentum_flux(h)[source]

Compute momentum flux from waveform

This implements Eq. (2.11) from Ruiz et al. (2008) [0707.4654] by using matrix_expectation_value with p_z, p_plus, and p_minus.

scri.flux.p_minus(ell_min, ell_max, *, sign=-1, s=-2)

Produce the function p_plus or p_minus, based on sign.

p⁺ = -√(8π/3) Y₁₊₁ = sinθ exp[+iϕ] p⁻ = +√(8π/3) Y₁₋₁ = sinθ exp[-iϕ]

These are what Ruiz et al. (2008) [0707.4654] call “l⁺” and “l⁻”.

We use swsh_Y_mat_el to compute the matrix elements. Notice that since the operator has definite m=±1, we only have mp==m±1 nonvanishing in the matrix elements.

scri.flux.p_plus(ell_min, ell_max, *, sign=1, s=-2)

Produce the function p_plus or p_minus, based on sign.

p⁺ = -√(8π/3) Y₁₊₁ = sinθ exp[+iϕ] p⁻ = +√(8π/3) Y₁₋₁ = sinθ exp[-iϕ]

These are what Ruiz et al. (2008) [0707.4654] call “l⁺” and “l⁻”.

We use swsh_Y_mat_el to compute the matrix elements. Notice that since the operator has definite m=±1, we only have mp==m±1 nonvanishing in the matrix elements.

scri.flux.p_plusminus(ell_min, ell_max, sign, s=-2)[source]

Produce the function p_plus or p_minus, based on sign.

p⁺ = -√(8π/3) Y₁₊₁ = sinθ exp[+iϕ] p⁻ = +√(8π/3) Y₁₋₁ = sinθ exp[-iϕ]

These are what Ruiz et al. (2008) [0707.4654] call “l⁺” and “l⁻”.

We use swsh_Y_mat_el to compute the matrix elements. Notice that since the operator has definite m=±1, we only have mp==m±1 nonvanishing in the matrix elements.

scri.flux.p_z(ell_min, ell_max, s=-2)[source]

Generator for pᶻ matrix elements (for use with matrix_expectation_value)

This function is specific to the case where waveforms have s=-2.

pᶻ = cosθ = 2 √(π/3) Y₁₀

This is what Ruiz et al. (2008) [0707.4654] call “lᶻ”.

The matrix elements yielded are

⟨s,j,n|cosθ|s,l,m⟩ = √[(2l+1)/(2j+1)] ⟨l,m,1,0|j,m⟩ ⟨l,-s,1,0|j,-s⟩

where the terms on the last line are the ordinary Clebsch-Gordan coefficients. Because of the magnetic selection rules, we only have nonzero elements for n==m.

We could have used _swsh_Y_mat_el but I am just preemptively combining the prefactors.

scri.flux.poincare_fluxes(h, hdot=None)[source]

Compute fluxes of energy, momentum, angular momemntum, and boost

This function will compute the time derivative 1 or 0 times (if an optional argument is passed) so is more efficient than separate calls to energy_flux, momentum_flux, angular_momentum_flux, and boost_flux.

Parameters:
hWaveformModes object

Must have type h

hdotWaveformModes object, optional [default: None]

The time derivative of h. If None, computed from h. Must have type hdot.

Returns:
edot, pdot, jdot, boost_fluxndarray, ndarray, ndarray, ndarray
scri.flux.sparse_expectation_value(abar, rows, columns, values, b)[source]

Helper function for the main calculation of matrix_expectation_value

Computes ⟨a|M|b⟩, assuming that ⟨a| and |b⟩ have the same shapes, and that (rows, columns, values) are corresponding arrays containing the nonzero elements of the matrix M.

Parameters:
abarndarray

The data for ⟨a| (after complex conjugation was applied).

rows, columnslist

Lists of same length, containing indices into (respectively) abar and b.

valuesndarray

Should have shape (n,) where n is the same length as rows and columns. These values are the matrix elements themselves to be summed.

bndarray

The data for |b⟩. Must have the same shape as abar.

Returns:
expectation_valuendarray
scri.flux.swsh_indices_to_matrix_indices(matrix_iterator)[source]

Convert SWSH-indexed function into caching sparse matrix-indexed function

This function is designed to decorate functions with signature (ell_min, ell_max) that yield tuples of (ellp, mp, ell, m, value), and convert them into functions with the same signature but returning tuples of (rows, columns, values). Here, the rows are row indices of a matrix, corresponding to the (ellp, mp) in standard spherical_functions order. Similarly the columns are column indices corresponding to (ell, m). The result can be passed into the sparse_expectation_value function.