Calculator Inputs
Enter the inverse metric components gμν and the covariant energy momentum tensor components Tμν. Blank cells default to zero.
Plotly Contribution Graph
The heatmap shows each contraction term gμνTμν. The bar chart shows row-wise contribution totals.
Contribution Matrix
| Pair | Inverse metric gμν | Tensor Tμν | Contribution | Share of absolute total |
|---|---|---|---|---|
| tt | 1 | 12 | 12 | 57.142857% |
| tx | 0 | 0 | 0 | 0% |
| ty | 0 | 0 | 0 | 0% |
| tz | 0 | 0 | 0 | 0% |
| xt | 0 | 0 | 0 | 0% |
| xx | -1 | 3 | -3 | 14.285714% |
| xy | 0 | 0 | 0 | 0% |
| xz | 0 | 0 | 0 | 0% |
| yt | 0 | 0 | 0 | 0% |
| yx | 0 | 0 | 0 | 0% |
| yy | -1 | 3 | -3 | 14.285714% |
| yz | 0 | 0 | 0 | 0% |
| zt | 0 | 0 | 0 | 0% |
| zx | 0 | 0 | 0 | 0% |
| zy | 0 | 0 | 0 | 0% |
| zz | -1 | 3 | -3 | 14.285714% |
| Trace total | 3 | |||
Formula Used
General trace formula:
T = gμνTμν = Σμ=03Σν=03 gμνTμν
This page multiplies every inverse metric component by the matching covariant stress tensor component, then sums all sixteen products.
For a flat metric with signature (+, -, -, -) and a diagonal perfect fluid tensor, the trace becomes:
T = ρ - px - py - pz
For isotropic pressure, this reduces to T = ρ - 3p.
How to Use This Calculator
- Enter the inverse metric components gμν, not gμν.
- Enter the covariant energy momentum tensor components Tμν.
- Use the preset buttons for common relativistic test cases.
- Press Calculate Trace to compute the full contraction.
- Review the trace value, status, dominant term, and symmetry checks.
- Use the CSV or PDF buttons to export the current result.
- Inspect the heatmap to see which index pair drives the contraction.
Example Data Table
| Example | Inverse metric gμν | Tensor Tμν | Expected trace | Interpretation |
|---|---|---|---|---|
| Perfect fluid | diag(1, -1, -1, -1) | diag(12, 3, 3, 3) | 3 | ρ - 3p = 12 - 9 |
| Radiation | diag(1, -1, -1, -1) | diag(12, 4, 4, 4) | 0 | Traceless in flat spacetime |
| Anisotropic matter | diag(1, -1, -1, -1) | diag(15, 4, 3, 2) | 6 | ρ - px - py - pz |
FAQs
1. What does this calculator compute?
It computes the scalar trace of the energy momentum tensor by contracting the inverse metric with the covariant tensor components. The result is a coordinate-dependent scalar built from your chosen signature and components.
2. Should I enter gμν or gμν?
Enter the inverse metric gμν. The formula on this page uses that form directly. If you only know gμν, first invert the metric before entering values.
3. Can I use off-diagonal tensor terms?
Yes. The calculator accepts all sixteen entries. That allows mixed time-space terms, shear terms, or non-diagonal coordinate choices during contraction.
4. Why can the trace become zero?
A zero trace often appears for conformal or radiation-like systems in suitable conventions. It means the summed contraction cancels exactly or numerically within tolerance.
5. Does the metric signature matter?
Yes. Switching between (+, -, -, -) and (-, +, +, +) changes signs in the contraction. Always match the metric convention used in your derivation.
6. What does the heatmap show?
The heatmap shows every product gμνTμν. Large positive and negative cells immediately reveal which component pairs dominate the trace value.
7. What do the symmetry checks mean?
They test whether each matrix matches its transpose. Many physical stress tensors are symmetric, but the calculator still works for general component sets.
8. What is the best quick check for perfect fluids?
In flat spacetime with signature (+, -, -, -), use T = ρ - 3p. If your entered diagonal values disagree, the metric convention or tensor form may need review.