# threePlusOneDecomposer

## Description

The solver in Warp Factory requires the metric tensor defined in the standard way, but constructing the spacetime in terms of its 3+1 foliation terms is often helpful. The builder function takes in the 3+1 components and constructs the metric for use in evaluating the stress-energy tensor and metric scalars.

<details>

<summary>Metric in 3+1</summary>

In this section, we will use Latin indices as summing from 1 to 3 and Greek indices as summing from 0 to 3. The spatial components of the metric map directly to the spatial terms $$\gamma$$:

$$g\_{ij} = \gamma\_{ij} \ , \ \ g^{ij} = \gamma^{ij}$$

The shift vector maps directly to the time-space cross terms of the metric:

$$g\_{0i} = g\_{i0} = \beta\_i$$

The lapse rate $$\alpha$$ and shift vector $$\beta$$ determine the time component of the metric:

$$g\_{00} = -\alpha^2 + \beta^i \beta\_i$$

where $$\beta^i = \gamma^{ij}\beta\_i$$

</details>

For more general background on 3+1 formalism please read:

{% embed url="<https://arxiv.org/abs/gr-qc/0703035>" %}

## Method

The metric terms are used to find the 3+1 terms and return them in the spacetime grid.

## Syntax

`[`<mark style="color:green;">`alpha`</mark>`,`<mark style="color:green;">`betaDown`</mark>`,`<mark style="color:green;">`gammaDown`</mark>`,`<mark style="color:green;">`betaUp`</mark>`,`<mark style="color:green;">`gammaUp`</mark>`] = threePlusOneDecomposer(`<mark style="color:blue;">`metric`</mark>`)`

### Input Arguments

{% hint style="info" %} <mark style="color:blue;">blue</mark> are required inputs.
{% endhint %}

<table><thead><tr><th width="188">Inputs</th><th width="125">Format</th><th width="217">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>metric</code></mark></td><td>struct</td><td>object</td><td>Metric tensor object.</td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="151">Outputs</th><th width="153.33333333333331">Format</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>alpha</code></mark></td><td>4D array</td><td>double</td><td>lapse function across the spacetime grid.</td></tr><tr><td><mark style="color:green;"><code>betaDown</code></mark></td><td>1x3 cell of 4D arrays</td><td>double</td><td>covariant shift function across the spacetime grid.</td></tr><tr><td><mark style="color:green;"><code>gammaDown</code></mark></td><td>3x3 cell of 4D arrays</td><td>double</td><td>covariant spatial function across the spacetime grid.</td></tr><tr><td><mark style="color:green;"><code>gammaUp</code></mark></td><td>3x3 cell of 4D arrays</td><td>double</td><td>contravariant spatial function across the spacetime grid.</td></tr><tr><td><mark style="color:green;"><code>betaUp</code></mark></td><td>1x3 cell of 4D arrays</td><td>double</td><td>contravariant shift function across the spacetime grid.</td></tr></tbody></table>
