Class TempLat::SU2TraceDeficit
template <typename R>
ClassList > TempLat > SU2TraceDeficit
The Wilson trace deficit 2 - tr U of an SU(2)-valued expression, returned as a scalar. More...
#include <su2tracedeficit.h>
Inherits the following classes: TempLat::UnaryOperator
Public Functions
| Type | Name |
|---|---|
| SU2TraceDeficit (const R & pR) |
|
| DEVICE_INLINE_FUNCTION auto | eval (const IDX &... idx) const |
| virtual std::string | operatorString () override const Override this method in your derived class, to have an easy implementation of your toString method. |
Public Functions inherited from TempLat::UnaryOperator
| Type | Name |
|---|---|
| UnaryOperator (const R & pR) |
|
| device::Idx | confirmGhostsUpToDate () const |
| void | confirmSpace (const LayoutStruct< NDim > & newLayout, const SpaceStateType & spaceType) const |
| void | doWeNeedGhosts () const |
| auto | getDx () const |
| auto | getKIR () const |
| auto | getToolBox () const |
| virtual std::string | operatorString () const Override this method in your derived class, to have an easy implementation of your toString method. |
| void | postGet () |
| void | preGet () |
| std::string | toString () const If your descending class implements operatorString() and your operator is of the type "OP b" (where OP is * or whatever), this toString method does all the work for you, only adding parentheses if b contains spaces. |
Public Static Functions inherited from TempLat::UnaryOperator
| Type | Name |
|---|---|
| consteval size_t | getNDim () |
Protected Attributes inherited from TempLat::UnaryOperator
| Type | Name |
|---|---|
| R | mR |
Detailed Description
Computed WITHOUT the catastrophic cancellation of the naive 2 - trace(U). In the four-real-component representation U = c_0 + i c_a sigma_a with c_0^2 + |c|^2 = 1, the two algebraically equal forms are conditioned very differently. Near the identity c_0 = 1 - O(|c|^2), so the naive form subtracts two numbers agreeing to ~2 log10(1/|c|) digits and keeps mostly roundoff, while the deficit form is built purely from the small components c_a and carries a relative error of order eps. The roles swap as c_0 -> -1, where 1 + c_0 cancels instead and the naive form is the well-conditioned one - hence the branch.
This matters because the plaquette trace deficit is essentially always consumed with a 1/dx^4 prefactor (the SU(2) magnetic energy, cf. CosmoInterface FieldFunctionals::B2SU2), which amplifies whatever error survives. Two effects then compound in single precision:
- the deficit itself is small near the continuum limit, so the naive form loses most of its digits;
- the stored links slowly leave the group (SU2ExpMap is exactly unitary per step, but the accumulated product U <- exp(dt X) U is never reprojected), giving a plaquette of norm 1 + delta. The naive form picks that up as an ADDITIVE -4 delta error, comparable to or larger than the signal, whereas the deficit form only sees it multiplicatively at relative order delta.
Measured on a CosmoLattice SU(2)+Higgs run at N = 64, dx = 0.08 in float: the naive form drives the magnetic energy NEGATIVE and leaks 6.5e-2 of the total energy over 4.5 time units, while the deficit form conserves to 6e-6 - a 1e4 improvement from this expression alone, with no reunitarization.
Note the deficit form is manifestly non-negative for any c_0 > -1, whether or not the operand is exactly unit-norm. That makes it robust against links that have drifted off the group, but it does not repair such a drift: it reports the deficit of the projected link while the dynamics still uses the drifted one.
Like SU2Dotter, the operand is evaluated ONCE through the fused eval path rather than as four separate SU2Get(a) component expressions - for a deep operand such as a plaquette or a clover, building the components separately blows up the expression object.
Unit test: ctest -R test-su2tracedeficit
Public Functions Documentation
function SU2TraceDeficit
function eval
template<typename... IDX>
inline DEVICE_INLINE_FUNCTION auto TempLat::SU2TraceDeficit::eval (
const IDX &... idx
) const
function operatorString
Override this method in your derived class, to have an easy implementation of your toString method.
Implements TempLat::UnaryOperator::operatorString
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/algebra/su2algebra/su2tracedeficit.h