hypercomplex-engine 0.4.2.6__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {hypercomplex_engine-0.4.2.6/hypercomplex_engine.egg-info → hypercomplex_engine-0.5.0}/PKG-INFO +21 -19
  2. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/README.md +19 -17
  3. hypercomplex_engine-0.5.0/hypercomplex_engine/core/fast/fast_dual.py +60 -0
  4. hypercomplex_engine-0.5.0/hypercomplex_engine/core/holographic/dual.py +50 -0
  5. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/validation.py +6 -6
  6. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/facade.py +3 -32
  7. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/printer/cd_table_printer.py +1 -2
  8. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0/hypercomplex_engine.egg-info}/PKG-INFO +21 -19
  9. hypercomplex_engine-0.5.0/hypercomplex_engine.egg-info/SOURCES.txt +38 -0
  10. hypercomplex_engine-0.5.0/hypercomplex_engine.egg-info/top_level.txt +1 -0
  11. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/pyproject.toml +3 -3
  12. hypercomplex_engine-0.5.0/tests/test_dual_tuple_regression.py +55 -0
  13. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/tests/test_fast_mode.py +22 -12
  14. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/tests/test_fixes_0_4.py +1 -18
  15. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/tests/test_mega_mother.py +7 -7
  16. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/tests/test_split_dim.py +1 -5
  17. hypercomplex_engine-0.5.0/tests/test_strict_dual_3tuple.py +143 -0
  18. hypercomplex_engine-0.4.2.6/hypercomplex-engine/core/fast/fast_dual.py +0 -188
  19. hypercomplex_engine-0.4.2.6/hypercomplex-engine/core/holographic/dual.py +0 -90
  20. hypercomplex_engine-0.4.2.6/hypercomplex_engine.egg-info/SOURCES.txt +0 -38
  21. hypercomplex_engine-0.4.2.6/hypercomplex_engine.egg-info/top_level.txt +0 -1
  22. hypercomplex_engine-0.4.2.6/tests/test_dual_tuple_regression.py +0 -92
  23. hypercomplex_engine-0.4.2.6/tests/test_logging.py +0 -66
  24. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/LICENSE +0 -0
  25. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/NOTICE +0 -0
  26. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/__init__.py +0 -0
  27. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/__init__.py +0 -0
  28. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/basis_element.py +0 -0
  29. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/basis_notation.py +0 -0
  30. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/fast/__init__.py +0 -0
  31. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/fast/bit_utils.py +0 -0
  32. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/fast/fast_split.py +0 -0
  33. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/fast/fast_standard.py +0 -0
  34. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/holographic/__init__.py +0 -0
  35. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/holographic/split.py +0 -0
  36. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/holographic/standard.py +0 -0
  37. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/table_builder/__init__.py +0 -0
  38. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/table_builder/common.py +0 -0
  39. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/table_builder/dual.py +0 -0
  40. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/table_builder/split.py +0 -0
  41. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/core/table_builder/standard.py +0 -0
  42. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/printer/__init__.py +0 -0
  43. {hypercomplex_engine-0.4.2.6/hypercomplex-engine → hypercomplex_engine-0.5.0/hypercomplex_engine}/printer/cd_format.py +0 -0
  44. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/hypercomplex_engine.egg-info/dependency_links.txt +0 -0
  45. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/hypercomplex_engine.egg-info/requires.txt +0 -0
  46. {hypercomplex_engine-0.4.2.6 → hypercomplex_engine-0.5.0}/setup.cfg +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hypercomplex-engine
3
- Version: 0.4.2.6
3
+ Version: 0.5.0
4
4
  Summary: Fast O(1)/O(n) multiplication engine for arbitrary dimensions and table generator for ordinary, split, and dual Cayley-Dickson algebras.
5
5
  Author-email: Maher Ben Abdessalem <ba.maher94@gmail.com>
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/maher1719/hypercomplex-engine
8
8
  Project-URL: Repository, https://github.com/maher1719/hypercomplex-engine
9
9
  Project-URL: Preprint: Sign Structure, https://doi.org/10.6084/m9.figshare.33705022
10
- Keywords: hypercomplex,cayley-dickson,quaternions,octonions,split-algebra,math,physics,geometry
10
+ Keywords: hypercomplex,cayley-dickson,quaternions,octonions,split-algebra,math,physics,geometry,sedenions
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Science/Research
@@ -111,7 +111,7 @@ pytest -v
111
111
  The simplest way to use the library is through the top-level facade API.
112
112
 
113
113
  ```python
114
- from hypercomplex import (
114
+ from hypercomplex_engine import (
115
115
  build_table,
116
116
  multiply,
117
117
  format_element,
@@ -324,7 +324,7 @@ multiply(kind, a, b, dim=None, engine="fast")
324
324
  Example:
325
325
 
326
326
  ```python
327
- from hypercomplex import multiply
327
+ from hypercomplex_engine import multiply
328
328
 
329
329
  a = (1, 3)
330
330
  b = (1, 5)
@@ -355,7 +355,7 @@ For `split`, `dual` and `dual_split`, `dim` is required.
355
355
  ## Table builders directly
356
356
 
357
357
  ```python
358
- from hypercomplex import (
358
+ from hypercomplex_engine import (
359
359
  StandardTableBuilder,
360
360
  SplitTableBuilder,
361
361
  DualTableBuilder,
@@ -394,7 +394,7 @@ For dual tables:
394
394
  ## Multipliers directly
395
395
 
396
396
  ```python
397
- from hypercomplex import (
397
+ from hypercomplex_engine import (
398
398
  StandardHolographic,
399
399
  SplitHolographic,
400
400
  DualHolographic,
@@ -433,7 +433,7 @@ print(result)
433
433
  ## Fast O(1) multipliers directly
434
434
 
435
435
  ```python
436
- from hypercomplex import (
436
+ from hypercomplex_engine import (
437
437
  FastStandard,
438
438
  FastSplit,
439
439
  FastDual,
@@ -484,7 +484,7 @@ print(result)
484
484
  Example:
485
485
 
486
486
  ```python
487
- from hypercomplex import format_element
487
+ from hypercomplex_engine import format_element
488
488
 
489
489
  element = (-1, 5)
490
490
 
@@ -517,25 +517,25 @@ This section is for contributors, benchmarking, physics engines, and symbolic pi
517
517
  If you prefer explicit imports:
518
518
 
519
519
  ```python
520
- from hypercomplex.core.table_builder import (
520
+ from hypercomplex_engine.core.table_builder import (
521
521
  StandardTableBuilder,
522
522
  SplitTableBuilder,
523
523
  DualTableBuilder,
524
524
  )
525
525
 
526
- from hypercomplex.core.holographic import (
526
+ from hypercomplex_engine.core.holographic import (
527
527
  StandardHolographic,
528
528
  SplitHolographic,
529
529
  DualHolographic,
530
530
  )
531
531
 
532
- from hypercomplex.core.fast import (
532
+ from hypercomplex_engine.core.fast import (
533
533
  FastStandard,
534
534
  FastSplit,
535
535
  FastDual,
536
536
  )
537
537
 
538
- from hypercomplex.printer import (
538
+ from hypercomplex_engine.printer import (
539
539
  CDFormat,
540
540
  CDTablePrinter,
541
541
  )
@@ -546,7 +546,7 @@ from hypercomplex.printer import (
546
546
  ## Cross-validating O(1) against the full table
547
547
 
548
548
  ```python
549
- from hypercomplex import StandardTableBuilder, FastStandard
549
+ from hypercomplex_engine import StandardTableBuilder, FastStandard
550
550
 
551
551
  builder = StandardTableBuilder()
552
552
  fast = FastStandard()
@@ -571,7 +571,7 @@ This proves that the O(1) evaluator agrees with the O(4^n) table builder.
571
571
  ## Cross-validating split O(1) against the split table
572
572
 
573
573
  ```python
574
- from hypercomplex import SplitTableBuilder, FastSplit
574
+ from hypercomplex_engine import SplitTableBuilder, FastSplit
575
575
 
576
576
  builder = SplitTableBuilder()
577
577
  fast = FastSplit()
@@ -629,7 +629,7 @@ The output convention is:
629
629
  This makes formatting easy:
630
630
 
631
631
  ```python
632
- from hypercomplex import format_element
632
+ from hypercomplex_engine import format_element
633
633
 
634
634
  result = (1, 0, 1)
635
635
 
@@ -647,7 +647,7 @@ print(format_element(result, mode="latex"))
647
647
  For simulations, avoid building large tables. Use the fast engine directly.
648
648
 
649
649
  ```python
650
- from hypercomplex import FastStandard
650
+ from hypercomplex_engine import FastStandard
651
651
 
652
652
  fast = FastStandard()
653
653
 
@@ -1114,18 +1114,20 @@ If you use this engine in your research, physics simulations, or geometric deep
1114
1114
  ```bibtex
1115
1115
  @article{ben abdessalem2026,
1116
1116
  author = "maher ben abdessalem",
1117
- title = "{A Proven Sign Law for Cayley-Dickson Algebras: Ordinary, Split, dual Constructions and their computational proofs and implementations}",
1117
+ title = "{An O(1) Bitwise Evaluator for Cayley--Dickson Sign Structure: Ordinary, Split, Dual, and Tensor Constructions}",
1118
1118
  year = "2026",
1119
1119
  month = "9",
1120
1120
  url = "https://figshare.com/articles/preprint/A_Proven_Sign_Law_for_Cayley-Dickson_Algebras_Ordinary_and_Split_Constructions/33705022",
1121
- doi = "10.6084/m9.figshare.33705022.v5"
1121
+ doi = "10.6084/m9.figshare.33705022.v8"
1122
1122
  }
1123
1123
 
1124
1124
  ```
1125
1125
 
1126
+
1126
1127
  ### Acknowledgments
1127
1128
 
1128
- The author gratefully acknowledges **Greg Wilmot** for his work on the structure of Cayley-Dickson algebras and for acknowledging the author's contribution to his paper *"Structure of the Cayley-Dickson algebras"* ([arXiv:2505.11747](https://arxiv.org/abs/2505.11747)).
1129
+ The author gratefully acknowledges **Prof. Derek Abbott**, **Dr. James M. Chappell**, and PhD candidate **Greg P. Wilmot** from the University of Adelaide, Australia, for the opportunity of collaboration and a deeper study of hypercomplex numbers. Special thanks go to **Greg P. Wilmot** for his work on the structure of Cayley-Dickson algebras and for acknowledging the author's contribution to his paper, *"Structure of the Cayley-Dickson algebras"* ([arXiv:2505.11747](https://arxiv.org)).
1130
+
1129
1131
 
1130
1132
  ---
1131
1133
 
@@ -83,7 +83,7 @@ pytest -v
83
83
  The simplest way to use the library is through the top-level facade API.
84
84
 
85
85
  ```python
86
- from hypercomplex import (
86
+ from hypercomplex_engine import (
87
87
  build_table,
88
88
  multiply,
89
89
  format_element,
@@ -296,7 +296,7 @@ multiply(kind, a, b, dim=None, engine="fast")
296
296
  Example:
297
297
 
298
298
  ```python
299
- from hypercomplex import multiply
299
+ from hypercomplex_engine import multiply
300
300
 
301
301
  a = (1, 3)
302
302
  b = (1, 5)
@@ -327,7 +327,7 @@ For `split`, `dual` and `dual_split`, `dim` is required.
327
327
  ## Table builders directly
328
328
 
329
329
  ```python
330
- from hypercomplex import (
330
+ from hypercomplex_engine import (
331
331
  StandardTableBuilder,
332
332
  SplitTableBuilder,
333
333
  DualTableBuilder,
@@ -366,7 +366,7 @@ For dual tables:
366
366
  ## Multipliers directly
367
367
 
368
368
  ```python
369
- from hypercomplex import (
369
+ from hypercomplex_engine import (
370
370
  StandardHolographic,
371
371
  SplitHolographic,
372
372
  DualHolographic,
@@ -405,7 +405,7 @@ print(result)
405
405
  ## Fast O(1) multipliers directly
406
406
 
407
407
  ```python
408
- from hypercomplex import (
408
+ from hypercomplex_engine import (
409
409
  FastStandard,
410
410
  FastSplit,
411
411
  FastDual,
@@ -456,7 +456,7 @@ print(result)
456
456
  Example:
457
457
 
458
458
  ```python
459
- from hypercomplex import format_element
459
+ from hypercomplex_engine import format_element
460
460
 
461
461
  element = (-1, 5)
462
462
 
@@ -489,25 +489,25 @@ This section is for contributors, benchmarking, physics engines, and symbolic pi
489
489
  If you prefer explicit imports:
490
490
 
491
491
  ```python
492
- from hypercomplex.core.table_builder import (
492
+ from hypercomplex_engine.core.table_builder import (
493
493
  StandardTableBuilder,
494
494
  SplitTableBuilder,
495
495
  DualTableBuilder,
496
496
  )
497
497
 
498
- from hypercomplex.core.holographic import (
498
+ from hypercomplex_engine.core.holographic import (
499
499
  StandardHolographic,
500
500
  SplitHolographic,
501
501
  DualHolographic,
502
502
  )
503
503
 
504
- from hypercomplex.core.fast import (
504
+ from hypercomplex_engine.core.fast import (
505
505
  FastStandard,
506
506
  FastSplit,
507
507
  FastDual,
508
508
  )
509
509
 
510
- from hypercomplex.printer import (
510
+ from hypercomplex_engine.printer import (
511
511
  CDFormat,
512
512
  CDTablePrinter,
513
513
  )
@@ -518,7 +518,7 @@ from hypercomplex.printer import (
518
518
  ## Cross-validating O(1) against the full table
519
519
 
520
520
  ```python
521
- from hypercomplex import StandardTableBuilder, FastStandard
521
+ from hypercomplex_engine import StandardTableBuilder, FastStandard
522
522
 
523
523
  builder = StandardTableBuilder()
524
524
  fast = FastStandard()
@@ -543,7 +543,7 @@ This proves that the O(1) evaluator agrees with the O(4^n) table builder.
543
543
  ## Cross-validating split O(1) against the split table
544
544
 
545
545
  ```python
546
- from hypercomplex import SplitTableBuilder, FastSplit
546
+ from hypercomplex_engine import SplitTableBuilder, FastSplit
547
547
 
548
548
  builder = SplitTableBuilder()
549
549
  fast = FastSplit()
@@ -601,7 +601,7 @@ The output convention is:
601
601
  This makes formatting easy:
602
602
 
603
603
  ```python
604
- from hypercomplex import format_element
604
+ from hypercomplex_engine import format_element
605
605
 
606
606
  result = (1, 0, 1)
607
607
 
@@ -619,7 +619,7 @@ print(format_element(result, mode="latex"))
619
619
  For simulations, avoid building large tables. Use the fast engine directly.
620
620
 
621
621
  ```python
622
- from hypercomplex import FastStandard
622
+ from hypercomplex_engine import FastStandard
623
623
 
624
624
  fast = FastStandard()
625
625
 
@@ -1086,18 +1086,20 @@ If you use this engine in your research, physics simulations, or geometric deep
1086
1086
  ```bibtex
1087
1087
  @article{ben abdessalem2026,
1088
1088
  author = "maher ben abdessalem",
1089
- title = "{A Proven Sign Law for Cayley-Dickson Algebras: Ordinary, Split, dual Constructions and their computational proofs and implementations}",
1089
+ title = "{An O(1) Bitwise Evaluator for Cayley--Dickson Sign Structure: Ordinary, Split, Dual, and Tensor Constructions}",
1090
1090
  year = "2026",
1091
1091
  month = "9",
1092
1092
  url = "https://figshare.com/articles/preprint/A_Proven_Sign_Law_for_Cayley-Dickson_Algebras_Ordinary_and_Split_Constructions/33705022",
1093
- doi = "10.6084/m9.figshare.33705022.v5"
1093
+ doi = "10.6084/m9.figshare.33705022.v8"
1094
1094
  }
1095
1095
 
1096
1096
  ```
1097
1097
 
1098
+
1098
1099
  ### Acknowledgments
1099
1100
 
1100
- The author gratefully acknowledges **Greg Wilmot** for his work on the structure of Cayley-Dickson algebras and for acknowledging the author's contribution to his paper *"Structure of the Cayley-Dickson algebras"* ([arXiv:2505.11747](https://arxiv.org/abs/2505.11747)).
1101
+ The author gratefully acknowledges **Prof. Derek Abbott**, **Dr. James M. Chappell**, and PhD candidate **Greg P. Wilmot** from the University of Adelaide, Australia, for the opportunity of collaboration and a deeper study of hypercomplex numbers. Special thanks go to **Greg P. Wilmot** for his work on the structure of Cayley-Dickson algebras and for acknowledging the author's contribution to his paper, *"Structure of the Cayley-Dickson algebras"* ([arXiv:2505.11747](https://arxiv.org)).
1102
+
1101
1103
 
1102
1104
  ---
1103
1105
 
@@ -0,0 +1,60 @@
1
+ from ..validation import Validation
2
+ from .fast_standard import FastStandard
3
+ from .fast_split import FastSplit
4
+
5
+ class FastDual:
6
+ """
7
+ Dual Cayley-Dickson O(1) multiplier.
8
+
9
+ STRICT 3-TUPLE INPUT:
10
+ (sign, local_index, eps_flag)
11
+
12
+ local_index must be strictly < 2^dim.
13
+ eps_flag must be 0 or 1.
14
+ """
15
+
16
+ def __init__(self, split: bool = False):
17
+ self._split_mode = bool(split)
18
+ self._standard = FastStandard()
19
+ self._split = FastSplit() if self._split_mode else None
20
+
21
+ def multiply(self, t1: tuple, t2: tuple, dim: int) -> tuple:
22
+ dim = Validation.dimension(dim)
23
+ Validation.basis_tuple(t1, allow_zero=True, allow_eps=True)
24
+ Validation.basis_tuple(t2, allow_zero=True, allow_eps=True)
25
+
26
+ # STRICT 3-TUPLE UNPACKING
27
+ s1, i, i_eps = int(t1[0]), int(t1[1]), int(t1[2])
28
+ s2, j, j_eps = int(t2[0]), int(t2[1]), int(t2[2])
29
+
30
+ if s1 == 0 or s2 == 0:
31
+ return (0, 0, 0)
32
+
33
+ sign, idx, eps = self.multiply_indices(i, j, dim, i_eps, j_eps)
34
+ return (s1 * s2 * sign, idx, eps)
35
+
36
+ def multiply_indices(self, i: int, j: int, dim: int, i_eps_flag: int = 0, j_eps_flag: int = 0) -> tuple:
37
+ dim = Validation.dimension(dim)
38
+ half = 1 << dim
39
+
40
+ # STRICT LOCAL ENFORCEMENT: No more global overflow!
41
+ if i < 0 or i >= half:
42
+ raise ValueError(f"local index must be in [0, {half - 1}] for dual dim={dim}, got {i}")
43
+ if j < 0 or j >= half:
44
+ raise ValueError(f"local index must be in [0, {half - 1}] for dual dim={dim}, got {j}")
45
+
46
+ i_eps = bool(i_eps_flag)
47
+ j_eps = bool(j_eps_flag)
48
+
49
+ # Nilpotency: eps^2 = 0
50
+ if i_eps and j_eps:
51
+ return (0, 0, 0)
52
+
53
+ # Base multiplication (parent algebra)
54
+ if self._split_mode:
55
+ base_sign, local_idx = self._split.multiply_indices(i, j, dim)
56
+ else:
57
+ base_sign, local_idx = self._standard.multiply_indices(i, j)
58
+
59
+ eps_flag = 1 if (i_eps or j_eps) else 0
60
+ return (base_sign, local_idx, eps_flag)
@@ -0,0 +1,50 @@
1
+ from ..validation import Validation
2
+ from .standard import StandardHolographic
3
+ from .split import SplitHolographic
4
+
5
+ class DualHolographic:
6
+ """
7
+ Dual Cayley-Dickson holographic multiplier.
8
+ STRICT 3-TUPLE INPUT: (sign, local_index, eps_flag)
9
+ """
10
+
11
+ def __init__(self, split: bool = False):
12
+ self._split_mode = bool(split)
13
+ self._standard = StandardHolographic()
14
+ self._split = SplitHolographic() if self._split_mode else None
15
+
16
+ def multiply(self, t1: tuple, t2: tuple, dim: int) -> tuple:
17
+ Validation.basis_tuple(t1, allow_zero=True, allow_eps=True)
18
+ Validation.basis_tuple(t2, allow_zero=True, allow_eps=True)
19
+ dim = Validation.dimension(dim)
20
+
21
+ # STRICT 3-TUPLE UNPACKING
22
+ s1, i, i_eps_flag = int(t1[0]), int(t1[1]), int(t1[2])
23
+ s2, j, j_eps_flag = int(t2[0]), int(t2[1]), int(t2[2])
24
+
25
+ if s1 == 0 or s2 == 0:
26
+ return (0, 0, 0)
27
+
28
+ half = 1 << dim
29
+
30
+ # STRICT LOCAL ENFORCEMENT
31
+ if i < 0 or i >= half:
32
+ raise ValueError(f"local index must be in [0, {half - 1}] for dual dim={dim}, got {i}")
33
+ if j < 0 or j >= half:
34
+ raise ValueError(f"local index must be in [0, {half - 1}] for dual dim={dim}, got {j}")
35
+
36
+ i_eps = bool(i_eps_flag)
37
+ j_eps = bool(j_eps_flag)
38
+
39
+ # Nilpotency
40
+ if i_eps and j_eps:
41
+ return (0, 0, 0)
42
+
43
+ # Base multiplication
44
+ if self._split_mode:
45
+ base_sign, local_idx = self._split.multiply_indices(i, j, dim)
46
+ else:
47
+ base_sign, local_idx = self._standard.multiply_indices(i, j)
48
+
49
+ eps_flag = 1 if (i_eps or j_eps) else 0
50
+ return (s1 * s2 * base_sign, local_idx, eps_flag)
@@ -54,12 +54,12 @@ class Validation:
54
54
  if not isinstance(data, tuple):
55
55
  raise TypeError(f"Expected tuple, got {type(data).__name__}")
56
56
 
57
- if len(data) not in (2, 3):
58
- raise ValueError(f"Basis tuple must have length 2 or 3, got {len(data)}")
59
-
60
- if len(data) == 3 and not allow_eps:
61
- raise ValueError("3-tuple epsilon form is not allowed here")
62
-
57
+ if allow_eps:
58
+ if len(data) != 3:
59
+ raise ValueError(f"Dual basis tuple must have length 3 (sign, index, eps), got {len(data)}")
60
+ else:
61
+ if len(data) != 2:
62
+ raise ValueError(f"Standard/Split basis tuple must have length 2 (sign, index), got {len(data)}")
63
63
 
64
64
  sign = data[0]
65
65
  index = data[1]
@@ -126,33 +126,6 @@ def _unpack_table(table):
126
126
  )
127
127
 
128
128
 
129
- def _as_dual_global(t: tuple, dim: int) -> tuple:
130
- """
131
- Converts a dual input tuple into a global 2-tuple.
132
-
133
- Accepts:
134
- (sign, global_index)
135
- (sign, local_index, eps_flag)
136
-
137
- Returns:
138
- (sign, global_index)
139
- """
140
- sign = int(t[0])
141
- idx = int(t[1])
142
-
143
- if sign == 0:
144
- return (0, 0)
145
-
146
- half = 1 << Validation.dimension(dim)
147
-
148
- if len(t) >= 3:
149
- eps = int(t[2])
150
-
151
- if eps == 1 and idx < half:
152
- idx += half
153
-
154
- return (sign, idx)
155
-
156
129
 
157
130
  # ----------------------------------------------------------------------
158
131
  # Public simple API
@@ -280,11 +253,9 @@ def multiply(
280
253
  return (0, 0, 0)
281
254
  return (0, 0)
282
255
 
283
- # Dual inputs may be local 3-tuples: (sign, local_index, eps)
284
- if kind in ("dual", "dual_split"):
285
- a = _as_dual_global(a, dim)
286
- b = _as_dual_global(b, dim)
287
-
256
+ # Dual inputs are strictly local 3-tuples: (sign, local_index, eps_flag).
257
+ # We pass them directly to the engines. No global overflow conversion needed.
258
+
288
259
  # ------------------------------------------------------------------
289
260
  # O(1) engine
290
261
  # ------------------------------------------------------------------
@@ -106,8 +106,7 @@ class CDTablePrinter:
106
106
  )
107
107
 
108
108
  print()
109
-
110
- return rows
109
+
111
110
 
112
111
  @staticmethod
113
112
  def export_csv(
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hypercomplex-engine
3
- Version: 0.4.2.6
3
+ Version: 0.5.0
4
4
  Summary: Fast O(1)/O(n) multiplication engine for arbitrary dimensions and table generator for ordinary, split, and dual Cayley-Dickson algebras.
5
5
  Author-email: Maher Ben Abdessalem <ba.maher94@gmail.com>
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/maher1719/hypercomplex-engine
8
8
  Project-URL: Repository, https://github.com/maher1719/hypercomplex-engine
9
9
  Project-URL: Preprint: Sign Structure, https://doi.org/10.6084/m9.figshare.33705022
10
- Keywords: hypercomplex,cayley-dickson,quaternions,octonions,split-algebra,math,physics,geometry
10
+ Keywords: hypercomplex,cayley-dickson,quaternions,octonions,split-algebra,math,physics,geometry,sedenions
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Science/Research
@@ -111,7 +111,7 @@ pytest -v
111
111
  The simplest way to use the library is through the top-level facade API.
112
112
 
113
113
  ```python
114
- from hypercomplex import (
114
+ from hypercomplex_engine import (
115
115
  build_table,
116
116
  multiply,
117
117
  format_element,
@@ -324,7 +324,7 @@ multiply(kind, a, b, dim=None, engine="fast")
324
324
  Example:
325
325
 
326
326
  ```python
327
- from hypercomplex import multiply
327
+ from hypercomplex_engine import multiply
328
328
 
329
329
  a = (1, 3)
330
330
  b = (1, 5)
@@ -355,7 +355,7 @@ For `split`, `dual` and `dual_split`, `dim` is required.
355
355
  ## Table builders directly
356
356
 
357
357
  ```python
358
- from hypercomplex import (
358
+ from hypercomplex_engine import (
359
359
  StandardTableBuilder,
360
360
  SplitTableBuilder,
361
361
  DualTableBuilder,
@@ -394,7 +394,7 @@ For dual tables:
394
394
  ## Multipliers directly
395
395
 
396
396
  ```python
397
- from hypercomplex import (
397
+ from hypercomplex_engine import (
398
398
  StandardHolographic,
399
399
  SplitHolographic,
400
400
  DualHolographic,
@@ -433,7 +433,7 @@ print(result)
433
433
  ## Fast O(1) multipliers directly
434
434
 
435
435
  ```python
436
- from hypercomplex import (
436
+ from hypercomplex_engine import (
437
437
  FastStandard,
438
438
  FastSplit,
439
439
  FastDual,
@@ -484,7 +484,7 @@ print(result)
484
484
  Example:
485
485
 
486
486
  ```python
487
- from hypercomplex import format_element
487
+ from hypercomplex_engine import format_element
488
488
 
489
489
  element = (-1, 5)
490
490
 
@@ -517,25 +517,25 @@ This section is for contributors, benchmarking, physics engines, and symbolic pi
517
517
  If you prefer explicit imports:
518
518
 
519
519
  ```python
520
- from hypercomplex.core.table_builder import (
520
+ from hypercomplex_engine.core.table_builder import (
521
521
  StandardTableBuilder,
522
522
  SplitTableBuilder,
523
523
  DualTableBuilder,
524
524
  )
525
525
 
526
- from hypercomplex.core.holographic import (
526
+ from hypercomplex_engine.core.holographic import (
527
527
  StandardHolographic,
528
528
  SplitHolographic,
529
529
  DualHolographic,
530
530
  )
531
531
 
532
- from hypercomplex.core.fast import (
532
+ from hypercomplex_engine.core.fast import (
533
533
  FastStandard,
534
534
  FastSplit,
535
535
  FastDual,
536
536
  )
537
537
 
538
- from hypercomplex.printer import (
538
+ from hypercomplex_engine.printer import (
539
539
  CDFormat,
540
540
  CDTablePrinter,
541
541
  )
@@ -546,7 +546,7 @@ from hypercomplex.printer import (
546
546
  ## Cross-validating O(1) against the full table
547
547
 
548
548
  ```python
549
- from hypercomplex import StandardTableBuilder, FastStandard
549
+ from hypercomplex_engine import StandardTableBuilder, FastStandard
550
550
 
551
551
  builder = StandardTableBuilder()
552
552
  fast = FastStandard()
@@ -571,7 +571,7 @@ This proves that the O(1) evaluator agrees with the O(4^n) table builder.
571
571
  ## Cross-validating split O(1) against the split table
572
572
 
573
573
  ```python
574
- from hypercomplex import SplitTableBuilder, FastSplit
574
+ from hypercomplex_engine import SplitTableBuilder, FastSplit
575
575
 
576
576
  builder = SplitTableBuilder()
577
577
  fast = FastSplit()
@@ -629,7 +629,7 @@ The output convention is:
629
629
  This makes formatting easy:
630
630
 
631
631
  ```python
632
- from hypercomplex import format_element
632
+ from hypercomplex_engine import format_element
633
633
 
634
634
  result = (1, 0, 1)
635
635
 
@@ -647,7 +647,7 @@ print(format_element(result, mode="latex"))
647
647
  For simulations, avoid building large tables. Use the fast engine directly.
648
648
 
649
649
  ```python
650
- from hypercomplex import FastStandard
650
+ from hypercomplex_engine import FastStandard
651
651
 
652
652
  fast = FastStandard()
653
653
 
@@ -1114,18 +1114,20 @@ If you use this engine in your research, physics simulations, or geometric deep
1114
1114
  ```bibtex
1115
1115
  @article{ben abdessalem2026,
1116
1116
  author = "maher ben abdessalem",
1117
- title = "{A Proven Sign Law for Cayley-Dickson Algebras: Ordinary, Split, dual Constructions and their computational proofs and implementations}",
1117
+ title = "{An O(1) Bitwise Evaluator for Cayley--Dickson Sign Structure: Ordinary, Split, Dual, and Tensor Constructions}",
1118
1118
  year = "2026",
1119
1119
  month = "9",
1120
1120
  url = "https://figshare.com/articles/preprint/A_Proven_Sign_Law_for_Cayley-Dickson_Algebras_Ordinary_and_Split_Constructions/33705022",
1121
- doi = "10.6084/m9.figshare.33705022.v5"
1121
+ doi = "10.6084/m9.figshare.33705022.v8"
1122
1122
  }
1123
1123
 
1124
1124
  ```
1125
1125
 
1126
+
1126
1127
  ### Acknowledgments
1127
1128
 
1128
- The author gratefully acknowledges **Greg Wilmot** for his work on the structure of Cayley-Dickson algebras and for acknowledging the author's contribution to his paper *"Structure of the Cayley-Dickson algebras"* ([arXiv:2505.11747](https://arxiv.org/abs/2505.11747)).
1129
+ The author gratefully acknowledges **Prof. Derek Abbott**, **Dr. James M. Chappell**, and PhD candidate **Greg P. Wilmot** from the University of Adelaide, Australia, for the opportunity of collaboration and a deeper study of hypercomplex numbers. Special thanks go to **Greg P. Wilmot** for his work on the structure of Cayley-Dickson algebras and for acknowledging the author's contribution to his paper, *"Structure of the Cayley-Dickson algebras"* ([arXiv:2505.11747](https://arxiv.org)).
1130
+
1129
1131
 
1130
1132
  ---
1131
1133
 
@@ -0,0 +1,38 @@
1
+ LICENSE
2
+ NOTICE
3
+ README.md
4
+ pyproject.toml
5
+ hypercomplex_engine/__init__.py
6
+ hypercomplex_engine/facade.py
7
+ hypercomplex_engine.egg-info/PKG-INFO
8
+ hypercomplex_engine.egg-info/SOURCES.txt
9
+ hypercomplex_engine.egg-info/dependency_links.txt
10
+ hypercomplex_engine.egg-info/requires.txt
11
+ hypercomplex_engine.egg-info/top_level.txt
12
+ hypercomplex_engine/core/__init__.py
13
+ hypercomplex_engine/core/basis_element.py
14
+ hypercomplex_engine/core/basis_notation.py
15
+ hypercomplex_engine/core/validation.py
16
+ hypercomplex_engine/core/fast/__init__.py
17
+ hypercomplex_engine/core/fast/bit_utils.py
18
+ hypercomplex_engine/core/fast/fast_dual.py
19
+ hypercomplex_engine/core/fast/fast_split.py
20
+ hypercomplex_engine/core/fast/fast_standard.py
21
+ hypercomplex_engine/core/holographic/__init__.py
22
+ hypercomplex_engine/core/holographic/dual.py
23
+ hypercomplex_engine/core/holographic/split.py
24
+ hypercomplex_engine/core/holographic/standard.py
25
+ hypercomplex_engine/core/table_builder/__init__.py
26
+ hypercomplex_engine/core/table_builder/common.py
27
+ hypercomplex_engine/core/table_builder/dual.py
28
+ hypercomplex_engine/core/table_builder/split.py
29
+ hypercomplex_engine/core/table_builder/standard.py
30
+ hypercomplex_engine/printer/__init__.py
31
+ hypercomplex_engine/printer/cd_format.py
32
+ hypercomplex_engine/printer/cd_table_printer.py
33
+ tests/test_dual_tuple_regression.py
34
+ tests/test_fast_mode.py
35
+ tests/test_fixes_0_4.py
36
+ tests/test_mega_mother.py
37
+ tests/test_split_dim.py
38
+ tests/test_strict_dual_3tuple.py