1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
use crateAddGroup;
/// A marker trait for an **Abelian Group** (also known as a Commutative Group).
///
/// An Abelian group is a `Group` where the binary operation is commutative.
/// This means that the order of the operands does not affect the result.
///
/// # Mathematical Definition
///
/// A group `(G, *)` is Abelian if it satisfies the following additional law:
///
/// 1. **Commutativity:** `a * b = b * a` for all `a, b` in `G`.
///
/// Since this trait builds on `AddGroup`, the operation is `+`, and the law is
/// `a + b = b + a`.
///
/// # Note on Implementation
///
/// This is a **marker trait**. It has no methods and provides no new functionality.
/// Its purpose is to signal at the type level that the commutativity law holds.
/// The compiler cannot verify this law, so implementing this trait is a promise
/// by the developer that the underlying type's addition operation is commutative.
// Automatic impls for standard types we know are Abelian.
// The default impl for f32 and f64 is in the field_real file for coherence with the complex field trait hierarchy.
// Note: Complex, Dual, and MultiVector (Vector addition) are also Abelian.
// Impl this trait for them in their respective crates.