From bc7ac93abd25fceb2a453c4aaa5d933328e1cee3 Mon Sep 17 00:00:00 2001 From: James Osborn Date: Fri, 16 Aug 2024 13:11:03 -0500 Subject: [PATCH] add Gauge type --- src/gauge/gaugeUtils.nim | 57 +++++++++++++++++++++++++++++++++------- src/physics/qcdTypes.nim | 16 +++++++++++ 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/src/gauge/gaugeUtils.nim b/src/gauge/gaugeUtils.nim index 8afb886..a61c3dc 100644 --- a/src/gauge/gaugeUtils.nim +++ b/src/gauge/gaugeUtils.nim @@ -12,23 +12,39 @@ import maths, rng, physics/qcdTypes import std/[hashes, tables] -#[ type GroupKind* = enum - gkU, gkSU, gkHerm, gkAntiHerm # traceless, real/complex - Gauge*[T] = object - u*: seq[T] - n*: int + gkU, gkAntiHerm, + gkSU, gkTracelessAntiHerm, + gkO, gkRealAntiSym, + gkSO, gkTracelessRealAntiSym, + gkSp, + gkHerm, gkTracelessHerm, + gkRealSym, gkTracelessRealSym + GaugeBase* {.inheritable.} = object group*: GroupKind -]# + n*: int + GaugeObj*[T] = object of GaugeBase + u*: seq[T] + Gauge*[T] = ref GaugeObj[T] +proc default*(g: Gauge) = + let nd = g.u.len + threads: + if g.group in {gkU, gkSU, gkO, gkSO}: + for i in 0..