diff options
| author | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-07-28 19:59:01 +0200 |
|---|---|---|
| committer | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-07-28 19:59:01 +0200 |
| commit | 15008182250908f6a60e537826e9872b44446dd1 (patch) | |
| tree | 31c9232dc48262db45846e065917c3b1b4cb8f9b | |
| parent | 2e4a8e535ea7fcd65eabadaf424a56ef1297be61 (diff) | |
Add ensure_list
| -rw-r--r-- | tensors.mac | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tensors.mac b/tensors.mac index 6e9cf8d..2249b0d 100644 --- a/tensors.mac +++ b/tensors.mac @@ -22,3 +22,5 @@ box_op(func) := ( - contr(ug[μ,ν] * mcs[μ,ν,ρ] * cdiff(func, ρ), [μ,ν,ρ])))$ mappend(f, list) := apply(append, map(f, list)); + +ensure_list(x) := if listp(x) then x else [x]; |
