pystella/fourier/spectra.py
def gw_polarization(self, hij, projector, hubble, queue=None, k_power=3,
                        allocator=None):
        """
        Computes the polarization components of the present gravitational wave
        power spectrum.

        .. math::

            \\Delta_{h_\\lambda}^2(k)
            = \\frac{1}{24 \\pi^{2} \\mathcal{H}^{2}}
                \\frac{1}{V}
                \\int \\mathrm{d} \\Omega \\,
                \\left\\vert \\mathbf{k} \\right\\vert^3
                \\left\\vert h_\\lambda^{\\prime}(k) \\right \\vert^{2}

        :arg hij: The array containing the
            position-space tensor field whose power spectrum is to be computed.
            Must be 4-dimensional, with the first axis being length-6.

        :arg projector: A :class:`Projector`.

        :arg hubble: The current value of the conformal Hubble parameter.

        The remaining arguments are the same as those to :meth:`__call__`.

        :returns: A :class:`numpy.ndarray` containing
            :math:`\\Delta_{h_\\lambda}^2(k)` with shape ``(2, num_bins)``.

        .. versionadded:: 2020.1
        """

        queue = queue or hij.queue

        hij_k = cla.empty(queue, (6,)+self.kshape, self.cdtype, allocator=None)
        # overwrite hij_k
        plus = hij_k[0]
        minus = hij_k[1]

        for mu in range(6):
            self.fft.dft(hij[mu], hij_k[mu])

        projector.tensor_to_pol(queue, plus, minus, hij_k)

        result = np.zeros((2, self.num_bins,), self.rdtype)
        result[0] = self.bin_power(plus, queue, k_power, allocator=allocator)
        result[1] = self.bin_power(minus, queue, k_power, allocator=allocator)

        return self.norm / 12 / hubble**2 * result

        Computes the polarization components of the present gravitational wave
        power spectrum.

        .. math::

            \\Delta_{h_\\lambda}^2(k)
            = \\frac{1}{24 \\pi^{2} \\mathcal{H}^{2}}
                \\frac{1}{V}
                \\int \\mathrm{d} \\Omega \\,
                \\left\\vert \\mathbf{k} \\right\\vert^3
                \\left\\vert h_\\lambda^{\\prime}(k) \\right \\vert^{2}

        :arg hij: The array containing the
            position-space tensor field whose power spectrum is to be computed.
            Must be 4-dimensional, with the first axis being length-6.

        :arg projector: A :class:`Projector`.

        :arg hubble: The current value of the conformal Hubble parameter.

        The remaining arguments are the same as those to :meth:`__call__`.

        :returns: A :class:`numpy.ndarray` containing
            :math:`\\Delta_{h_\\lambda}^2(k)` with shape ``(2, num_bins)``.

        .. versionadded:: 2020.1
        
Computes the polarization components of the present gravitational wave
power spectrum.




Computes the polarization components of the present gravitational wave power spectrum .
def gw_polarization(self, hij, projector, hubble, queue=None, k_power=3,
                        allocator=None):
        queue = queue or hij.queue
        hij_k = cla.empty(queue, (6,)+self.kshape, self.cdtype, allocator=None)
        plus = hij_k[0]
        minus = hij_k[1]
        for mu in range(6):
            self.fft.dft(hij[mu], hij_k[mu])
        projector.tensor_to_pol(queue, plus, minus, hij_k)
        result = np.zeros((2, self.num_bins,), self.rdtype)
        result[0] = self.bin_power(plus, queue, k_power, allocator=allocator)
        result[1] = self.bin_power(minus, queue, k_power, allocator=allocator)
        return self.norm / 12 / hubble**2 * result
def gw_polarization ( self , hij , projector , hubble , queue = None , k_power = 3 , allocator = None ) : queue = queue or hij . queue hij_k = cla . empty ( queue , ( 6 , ) + self . kshape , self . cdtype , allocator = None ) plus = hij_k [ 0 ] minus = hij_k [ 1 ] for mu in range ( 6 ) : self . fft . dft ( hij [ mu ] , hij_k [ mu ] ) projector . tensor_to_pol ( queue , plus , minus , hij_k ) result = np . zeros ( ( 2 , self . num_bins , ) , self . rdtype ) result [ 0 ] = self . bin_power ( plus , queue , k_power , allocator = allocator ) result [ 1 ] = self . bin_power ( minus , queue , k_power , allocator = allocator ) return self . norm / 12 / hubble ** 2 * result
Computes the polarization components of the present gravitational wave
power spectrum.
Computes the polarization components of the present gravitational wave power spectrum .
"""
        Computes the polarization components of the present gravitational wave
        power spectrum.

        .. math::

            \\Delta_{h_\\lambda}^2(k)
            = \\frac{1}{24 \\pi^{2} \\mathcal{H}^{2}}
                \\frac{1}{V}
                \\int \\mathrm{d} \\Omega \\,
                \\left\\vert \\mathbf{k} \\right\\vert^3
                \\left\\vert h_\\lambda^{\\prime}(k) \\right \\vert^{2}

        :arg hij: The array containing the
            position-space tensor field whose power spectrum is to be computed.
            Must be 4-dimensional, with the first axis being length-6.

        :arg projector: A :class:`Projector`.

        :arg hubble: The current value of the conformal Hubble parameter.

        The remaining arguments are the same as those to :meth:`__call__`.

        :returns: A :class:`numpy.ndarray` containing
            :math:`\\Delta_{h_\\lambda}^2(k)` with shape ``(2, num_bins)``.

        .. versionadded:: 2020.1
        """ # overwrite hij_k

A :class:`numpy.ndarray` containing
:math:`\\Delta_{h_\\lambda}^2(k)` with shape ``(2, num_bins)``.


A : class : ` numpy . ndarray ` containing : math : ` \\ Delta_ { h_ \\ lambda } ^2 ( k ) ` with shape ` ` ( 2 num_bins ) ` ` .
self
hij
The array containing the
position-space tensor field whose power spectrum is to be computed.
Must be 4-dimensional, with the first axis being length-6.
The array containing the position - space tensor field whose power spectrum is to be computed . Must be 4 - dimensional with the first axis being length - 6 .
projector
None
hubble
The current value of the conformal Hubble parameter.
The remaining arguments are the same as those to :meth:`__call__`.
The current value of the conformal Hubble parameter . The remaining arguments are the same as those to : meth : ` __call__ ` .
queue
k_power
allocator