From d89d9c5dff44b971a21ba4d1056eaa6390df5ad2 Mon Sep 17 00:00:00 2001 From: pfrank <philipp@mpa-garching.mpg.de> Date: Mon, 28 Jan 2019 12:12:01 +0100 Subject: [PATCH] docstrings lightcone --- nifty5/library/dynamic_operator.py | 2 +- nifty5/library/light_cone_operator.py | 35 ++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/nifty5/library/dynamic_operator.py b/nifty5/library/dynamic_operator.py index bc4407570..089ed00ae 100644 --- a/nifty5/library/dynamic_operator.py +++ b/nifty5/library/dynamic_operator.py @@ -217,7 +217,7 @@ def dynamic_lightcone_operator(*, quant, causal=True, minimum_phase=False): - '''Extends the functionality of :function: dynamic_operator to a Green's + '''Extends the functionality of :func:`dynamic_operator` to a Green's function which is constrained to be within a light cone. The resulting Green's function is constrained to be within a light cone. diff --git a/nifty5/library/light_cone_operator.py b/nifty5/library/light_cone_operator.py index 205d05f8a..4c28201e0 100644 --- a/nifty5/library/light_cone_operator.py +++ b/nifty5/library/light_cone_operator.py @@ -96,12 +96,39 @@ def _cone_arrays(c, domain, sigx, want_gradient): class LightConeOperator(Operator): - ''' - FIXME + '''Constructs a Light cone from a set of lightspeed parameters. + + The resulting cone is defined as follows + + .. math:: + \\exp \\left(- \\frac{1}{2} \\Re \\left( \\Delta \\right)^2 \\right) + + with + + .. math:: + \\Delta = \\sqrt{- \\left(t^2 - \\frac{x^\\dagger C^{-1} x} + {\\sigma_x^2} \\right)} + + where t and x are the coordinates of the target space. Note that axis zero + of the space is interpreted as the time axis. C denotes the input + paramters of the operator and parametrizes the shape of the cone. + sigx is the width of the asymptotic Gaussian in x necessary for + discretization. + + Parameters + ---------- + domain : Domain, tuple of Domain or DomainTuple + The domain of the input parameters of the light cone, the values of the + lightspeed tensor. + target : Domain, tuple of Domain or DomainTuple + Output space on which the lightcone should be defined. The zeroth axis + of this space is interpreted as the time axis. + sigx : float + Width of the Gaussian for the discretized representation of the cone. ''' def __init__(self, domain, target, sigx): - self._domain = domain - self._target = target + self._domain = DomainTuple.make(domain) + self._target = DomainTuple.make(target) self._sigx = sigx def apply(self, x): -- GitLab