> For the complete documentation index, see [llms.txt](https://applied-physics.gitbook.io/warp-factory/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://applied-physics.gitbook.io/warp-factory/modules/metrics-module/metric-functions/threeplusonebuilder.md).

# threePlusOneBuilder

## 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 is constructed from the 3+1 terms as defined in the spacetime grid.

## Syntax

`[`<mark style="color:green;">`Metric`</mark>`] = threePlusOneBuilder(`<mark style="color:blue;">`alpha`</mark>`,`` `<mark style="color:blue;">`beta`</mark>`,`` `<mark style="color:blue;">`gamma`</mark>`)`

### Input Arguments

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

<table><thead><tr><th width="125">Inputs</th><th width="125">Format</th><th width="169">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>alpha</code></mark></td><td>4D array</td><td>double</td><td>Lapse rate.</td></tr><tr><td><mark style="color:blue;"><code>beta</code></mark> </td><td>1x3 cell of 4D arrays</td><td>double</td><td>Shift vector. </td></tr><tr><td><mark style="color:blue;"><code>gamma</code></mark></td><td>3x3 cell of 4D arrays</td><td>double</td><td>Spatial terms.</td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="205">Outputs</th><th width="144.33333333333331">Format</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>Metric</code></mark></td><td>4x4 cell of 4D arrays</td><td>double</td><td>Returns the standard metric tensor constructed from the 3+1 components.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://applied-physics.gitbook.io/warp-factory/modules/metrics-module/metric-functions/threeplusonebuilder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
