# getEnergyConditions

## Description

The energy conditions are evaluated point-wise for all spacetime gridpoints of the stress-energy tensor. The function only evaluates the Null Energy Condition (NEC), Weak Energy Condition (WEC), Strong Energy Condition (SEC), and Dominant Energy Condition (DEC).

<details>

<summary>Null Energy Condition (NEC) </summary>

The NEC expresses the observed energy density for null (light-ray) observers. For this to be physical, energy density must be non-negative as viewed by any light rays. The NEC is determined by:

$$\Xi\_{NEC}(X) = T\_{\hat{\mu}\hat{\nu}}(X) k^{\hat{\mu}} k^{\hat{\nu}} \ge 0$$

where $$T\_{\hat{\mu}\hat{\nu}}$$ is the Eulerian stress-energy tensor and $$k^{\hat{\mu}}$$ is a null vector field.

</details>

<details>

<summary>Weak Energy Condition (WEC)</summary>

The WEC expresses the observed energy density for timelike (matter) observers. For this to be physical, energy density must be non-negative as viewed by any timelike observer. The WEC is determined by:

&#x20;$$\Xi\_{WEC}(X) = T\_{\hat{\mu}\hat{\nu}}(X) V^{\hat{\mu}} V^{\hat{\nu}} \ge 0$$

where $$T\_{\hat{\mu}\hat{\nu}}$$ is the Eulerian stress-energy tensor and $$V^{\hat{\mu}}$$ is a timelike vector field.

</details>

<details>

<summary>Strong Energy Condition (SEC)</summary>

The SEC expresses the tidal effect of gravity acting on observers. For this to be physical, the gravitational tidal effect should be non-negative, i.e., matter should always gravitate toward other matter. The SEC is determined by:&#x20;

$$\Xi\_{SEC}(X) = \left(T\_{\hat{\mu}\hat{\nu}}(X) - \frac{1}{2} T(X) \eta\_{\hat{\mu}\hat{\nu}} \right)V^{\hat{\mu}} V^{\hat{\nu}} \ge 0$$

where $$T\_{\hat{\mu}\hat{\nu}}$$ is the Eulerian stress-energy tensor, $$\eta\_{\hat{\mu}\hat{\nu}}$$ is the Minkowski metric, and $$V^{\hat{\mu}}$$ is a timelike vector field.

</details>

<details>

<summary>Dominant Energy Condition (DEC)</summary>

The DEC expresses the velocity of observed matter flow. For this to be physical, the matter should not be seen flowing faster than light by any timelike observer.&#x20;

$$\Upsilon^{\hat{\mu}}(X) = -T^{\hat{\mu}}\_{\ \ \hat{\nu}}(X) V^{\hat{\nu}}$$&#x20;

where $$T^{\hat{\mu}}\_{\ \ \hat{\nu}}$$ is the mixed form of the Eulerian stress-energy tensor and $$V^{\hat{\mu}}$$ is a timelike vector field. The energy condition is for this to be future pointing, so this is further evaluated as:

$$\xi\_D(X) = \eta\_{\hat{\mu}\hat{\nu}} \Upsilon^{\hat{\mu}}(X) \Upsilon^{\hat{\nu}}(X) \le 0$$

which is the returned energy condition. **The value returned is additionally flipped in sign such that violations are negative values, so as to match the returns of other energy conditions.**

</details>

For more general background on the energy conditions, please read:&#x20;

{% embed url="<https://arxiv.org/abs/2003.01815>" %}

## Method

The evaluation of the point-wise energy conditions samples a set of observer vector fields. The null vector is defined within a Cartesian locally-Minkowskian space. The direction of the spatial velocity is sampled from a set of vectors that map to evenly distributed points on a sphere, which, in a spherical coordinate representation, result in the set of four-velocities that map to different observers. The resulting vectors for each observer are then normalized. For timelike vectors, the four-velocity is defined in the same manner but is additionally scaled from 0 to 1 for a specified number of timelike samples for each of the spatial velocity direction samples. All vectors are then normalized.

## Syntax

`[`<mark style="color:green;">`map`</mark>`,`` `<mark style="color:green;">`vec`</mark>`,`` `<mark style="color:green;">`vectorFieldOut`</mark>`] = getEnergyConditions(`<mark style="color:blue;">`energyTensor`</mark>`,`` `<mark style="color:blue;">`metric`</mark>`,`` `<mark style="color:blue;">`condition`</mark>`,`` `<mark style="color:blue;">`numAngularVec`</mark>`,`` `<mark style="color:orange;">`numTimeVec`</mark>`,`` `<mark style="color:orange;">`returnVec`</mark>`,`` `<mark style="color:orange;">`tryGPU`</mark>`)`

### Input Arguments

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

<mark style="color:orange;">orange</mark> are optional inputs with native default values.
{% endhint %}

<table><thead><tr><th width="232">Inputs</th><th width="94">Format</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>energyTensor</code></mark> </td><td>struct</td><td>object</td><td>Input stress-energy tensor to determine energy conditions. </td></tr><tr><td><mark style="color:blue;"><code>metric</code></mark></td><td>struct</td><td>object</td><td>Input metric which determined the stress-energy tensor. </td></tr><tr><td><mark style="color:blue;"><code>condition</code></mark></td><td>1x1 array</td><td>string</td><td>The selected energy condition. Can be either "Null", "Weak", "Strong", or "Dominant".</td></tr><tr><td><mark style="color:blue;"><code>numAngularVec</code></mark></td><td>1x1 array</td><td>integer</td><td>The set number of even-spaced angular samples of four-velocity orientations. This sets the number of directions to sample.</td></tr><tr><td><mark style="color:orange;"><code>numTimeVec</code></mark></td><td>1x1 array</td><td>integer</td><td>The set number of time samples. This evenly reduces the magnitude of the four-velocity spatial part in the given sample number. <strong>The default value is 10.</strong></td></tr><tr><td><mark style="color:orange;"><code>returnVec</code></mark></td><td>1x1 array</td><td>integer</td><td>Return the vectors and each of their respective energy condition evaluation results. <strong>The default value is 0.</strong></td></tr><tr><td><mark style="color:orange;"><code>tryGPU</code></mark></td><td>1x1 array</td><td>integer</td><td>Use the GPU for evaluations, input either 1 for true or 0 for false. <strong>The default value is 0.</strong></td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="202">Outputs</th><th width="104.33333333333331">Format</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>map</code></mark></td><td>4D array</td><td>double</td><td><p>Returned energy condition at each spacetime grid point. The array format is specified as:</p><p></p><p><span class="math">[x_0, x_1, x_2, x_3]</span></p><p></p><p>where <span class="math">x_\mu</span>is the spacetime dimension.</p></td></tr><tr><td><mark style="color:green;"><code>vec</code></mark></td><td>6D array</td><td>double</td><td><p>The energy condition evaluation for each of the sampled vectors at each spacetime grid point. The array format is specified as:</p><p></p><p> <span class="math">[x_0, x_1, x_2, x_3, N_{ang}, N_{time}]</span></p><p></p><p>where <span class="math">x_\mu</span> is the spacetime dimensions, <span class="math">N_{ang}</span> is the angular samples, and <span class="math">N_{time}</span> is the time samples.</p><p></p><p><strong>This is only returned if </strong><mark style="color:orange;"><strong><code>returnVec</code></strong></mark><strong> is not 0.</strong></p></td></tr><tr><td><mark style="color:green;"><code>vectorFieldOut</code></mark></td><td>3D or 4D array</td><td>double</td><td><p>The set of observer 4-vectors that are used to sample the energy conditions at each point in spacetime. If the energy condition requires a null vector field then the return is a 3D array specified as:</p><p></p><p><span class="math">[n_{obs}, N_{ang}]</span></p><p></p><p>where <span class="math">n_{obs}</span> is the observer four-velocity (length of 4) and <span class="math">N_{ang}</span> is the length of the angular samples. If the energy condition requires a timelike vector field, then the return is a 4D array specified as:</p><p></p><p><span class="math">[n_{obs}, N_{ang}, N_{time}]</span></p><p></p><p>where <span class="math">N_{time}</span> is the length of the time samples.</p><p></p><p><strong>This is only returned if </strong><mark style="color:orange;"><strong><code>returnVec</code></strong></mark><strong> is not 0.</strong></p></td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://applied-physics.gitbook.io/warp-factory/modules/analyzer-module/getenergyconditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
