pystella/fourier/rayleigh.py
def init_vector_from_pol(self, projector, vector, plus_ps, minus_ps,
                             queue=None, **kwargs):
        """
        A wrapper which calls :meth:`generate` to initialize a transverse
        three-vector field in Fourier space and returns its inverse Fourier
        transform.
        In contrast to :meth:`init_transverse_vector`, modes are generated
        for the plus and minus polarizations of the vector field, from which
        the vector field itself is constructed.

        :arg projector: A :class:`Projector` used to project out
            longitudinal components of the vector field.

        :arg vector: The array in which the vector field will be stored.

        :arg plus_ps: A :class:`~collections.abc.Callable`
            returning the power spectrum of the
            plus polarization as a function of momentum ``kmag``.

        :arg minus_ps: A :class:`~collections.abc.Callable`
            returning the power spectrum of the
            minus polarization as a function of momentum ``kmag``.

        The following keyword arguments are recognized:

        :arg queue: A :class:`pyopencl.CommandQueue`.
            Defaults to ``vector.queue``.

        Any additional keyword arguments are passed to :meth:`generate`.
        """

        queue = queue or vector.queue

        fk = self.generate(queue, field_ps=plus_ps, **kwargs)
        plus_k = cla.to_device(queue, fk)

        fk = self.generate(queue, field_ps=minus_ps, **kwargs)
        minus_k = cla.to_device(queue, fk)

        vector_k = cla.empty(queue, (3,)+self.fft.shape(True), self.cdtype)
        projector.pol_to_vec(queue, plus_k, minus_k, vector_k)

        for mu in range(3):
            self.fft.idft(vector_k[mu], vector[mu])

        A wrapper which calls :meth:`generate` to initialize a transverse
        three-vector field in Fourier space and returns its inverse Fourier
        transform.
        In contrast to :meth:`init_transverse_vector`, modes are generated
        for the plus and minus polarizations of the vector field, from which
        the vector field itself is constructed.

        :arg projector: A :class:`Projector` used to project out
            longitudinal components of the vector field.

        :arg vector: The array in which the vector field will be stored.

        :arg plus_ps: A :class:`~collections.abc.Callable`
            returning the power spectrum of the
            plus polarization as a function of momentum ``kmag``.

        :arg minus_ps: A :class:`~collections.abc.Callable`
            returning the power spectrum of the
            minus polarization as a function of momentum ``kmag``.

        The following keyword arguments are recognized:

        :arg queue: A :class:`pyopencl.CommandQueue`.
            Defaults to ``vector.queue``.

        Any additional keyword arguments are passed to :meth:`generate`.
        
A wrapper which calls :meth:`generate` to initialize a transverse
three-vector field in Fourier space and returns its inverse Fourier
transform.
In contrast to :meth:`init_transverse_vector`, modes are generated
for the plus and minus polarizations of the vector field, from which
the vector field itself is constructed.
A wrapper which calls : meth : ` generate ` to initialize a transverse three - vector field in Fourier space and returns its inverse Fourier transform . In contrast to : meth : ` init_transverse_vector ` modes are generated for the plus and minus polarizations of the vector field from which the vector field itself is constructed .
def init_vector_from_pol(self, projector, vector, plus_ps, minus_ps,
                             queue=None, **kwargs):
        queue = queue or vector.queue
        fk = self.generate(queue, field_ps=plus_ps, **kwargs)
        plus_k = cla.to_device(queue, fk)
        fk = self.generate(queue, field_ps=minus_ps, **kwargs)
        minus_k = cla.to_device(queue, fk)
        vector_k = cla.empty(queue, (3,)+self.fft.shape(True), self.cdtype)
        projector.pol_to_vec(queue, plus_k, minus_k, vector_k)
        for mu in range(3):
            self.fft.idft(vector_k[mu], vector[mu])
def init_vector_from_pol ( self , projector , vector , plus_ps , minus_ps , queue = None , ** kwargs ) : queue = queue or vector . queue fk = self . generate ( queue , field_ps = plus_ps , ** kwargs ) plus_k = cla . to_device ( queue , fk ) fk = self . generate ( queue , field_ps = minus_ps , ** kwargs ) minus_k = cla . to_device ( queue , fk ) vector_k = cla . empty ( queue , ( 3 , ) + self . fft . shape ( True ) , self . cdtype ) projector . pol_to_vec ( queue , plus_k , minus_k , vector_k ) for mu in range ( 3 ) : self . fft . idft ( vector_k [ mu ] , vector [ mu ] )
A wrapper which calls :meth:`generate` to initialize a transverse
three-vector field in Fourier space and returns its inverse Fourier
transform.
A wrapper which calls : meth : ` generate ` to initialize a transverse three - vector field in Fourier space and returns its inverse Fourier transform .
"""
        A wrapper which calls :meth:`generate` to initialize a transverse
        three-vector field in Fourier space and returns its inverse Fourier
        transform.
        In contrast to :meth:`init_transverse_vector`, modes are generated
        for the plus and minus polarizations of the vector field, from which
        the vector field itself is constructed.

        :arg projector: A :class:`Projector` used to project out
            longitudinal components of the vector field.

        :arg vector: The array in which the vector field will be stored.

        :arg plus_ps: A :class:`~collections.abc.Callable`
            returning the power spectrum of the
            plus polarization as a function of momentum ``kmag``.

        :arg minus_ps: A :class:`~collections.abc.Callable`
            returning the power spectrum of the
            minus polarization as a function of momentum ``kmag``.

        The following keyword arguments are recognized:

        :arg queue: A :class:`pyopencl.CommandQueue`.
            Defaults to ``vector.queue``.

        Any additional keyword arguments are passed to :meth:`generate`.
        """
self
projector
A :class:`Projector` used to project out
longitudinal components of the vector field.
A : class : ` Projector ` used to project out longitudinal components of the vector field .
vector
The array in which the vector field will be stored.
The array in which the vector field will be stored .
plus_ps
A :class:`~collections.abc.Callable`
returning the power spectrum of the
plus polarization as a function of momentum ``kmag``.
A : class : ` ~collections . abc . Callable ` returning the power spectrum of the plus polarization as a function of momentum ` ` kmag ` ` .
minus_ps
A :class:`~collections.abc.Callable`
returning the power spectrum of the
minus polarization as a function of momentum ``kmag``.

The following keyword arguments are recognized.
A : class : ` ~collections . abc . Callable ` returning the power spectrum of the minus polarization as a function of momentum ` ` kmag ` ` . The following keyword arguments are recognized .
queue
A :class:`pyopencl.CommandQueue`.
Defaults to ``vector.queue``.

Any additional keyword arguments are passed to :meth:`generate`.
A : class : ` pyopencl . CommandQueue ` . Defaults to ` ` vector . queue ` ` . Any additional keyword arguments are passed to : meth : ` generate ` .