hypercomplex-engine 0.4.1__tar.gz → 0.4.2__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.
- {hypercomplex_engine-0.4.1/hypercomplex_engine.egg-info → hypercomplex_engine-0.4.2}/PKG-INFO +87 -2
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/README.md +86 -1
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2/hypercomplex_engine.egg-info}/PKG-INFO +87 -2
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/pyproject.toml +1 -1
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/LICENSE +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/__init__.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/__init__.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/basis_element.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/basis_notation.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/__init__.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/bit_utils.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/fast_dual.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/fast_split.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/fast_standard.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/__init__.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/dual.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/split.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/standard.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/__init__.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/common.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/dual.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/split.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/standard.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/validation.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/facade.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/printer/__init__.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/printer/cd_format.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/printer/cd_table_printer.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/SOURCES.txt +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/dependency_links.txt +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/requires.txt +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/top_level.txt +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/setup.cfg +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/tests/test_dual_tuple_regression.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/tests/test_fast_mode.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/tests/test_fixes_0_4.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/tests/test_mega_mother.py +0 -0
- {hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/tests/test_split_dim.py +0 -0
{hypercomplex_engine-0.4.1/hypercomplex_engine.egg-info → hypercomplex_engine-0.4.2}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hypercomplex-engine
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Fast O(1)/O(n) multiplication engine 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: MIT License
|
|
@@ -50,7 +50,6 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
[](https://opensource.org/licenses/MIT)
|
|
52
52
|
[](https://www.python.org/downloads/)
|
|
53
|
-
[](#)
|
|
54
53
|
[](https://github.com/maher1719/hypercomplex-engine)
|
|
55
54
|
[](https://pypi.org/project/hypercomplex-engine/)
|
|
56
55
|
[](https://pepy.tech/project/hypercomplex-engine)
|
|
@@ -69,6 +68,11 @@ This library provides the computational substrate for high-dimensional hypercomp
|
|
|
69
68
|
|
|
70
69
|
---
|
|
71
70
|
|
|
71
|
+
## Scope and limitations
|
|
72
|
+
|
|
73
|
+
If you build upon this package, please read fully [Go to Scope, Strengths, and Limitations](#scope-strengths-and-limitations) below for more information or check [Scope, Strengths, and Limitations file](README_scope_and_limitations.md#scope-strengths-and-limitations)
|
|
74
|
+
|
|
75
|
+
|
|
72
76
|
## 📄 Publications & Preprints
|
|
73
77
|
|
|
74
78
|
This library serves as the formal verification substrate and computational engine for the following mathematical preprints:
|
|
@@ -1037,6 +1041,87 @@ hypercomplex-engine/
|
|
|
1037
1041
|
└── pyproject.toml
|
|
1038
1042
|
```
|
|
1039
1043
|
|
|
1044
|
+
# Scope, strengths and limitations
|
|
1045
|
+
|
|
1046
|
+
> **Status: 0.4.x, pre-1.0.** The API can still change. Read this section before building on the package.
|
|
1047
|
+
|
|
1048
|
+
## What this package is
|
|
1049
|
+
|
|
1050
|
+
It computes the product of two **signed basis elements** of a Cayley–Dickson algebra: `±e_i × ±e_j → ±e_k` (or zero in dual algebras). It is a low-level component, a sign and index calculator, not a number type. There are no coefficients, no sums, and no vectors.
|
|
1051
|
+
|
|
1052
|
+
## Advantages
|
|
1053
|
+
|
|
1054
|
+
- **One job, small surface.** About 2,000 lines, one dependency (NumPy), and multipliers that keep no per-call state.
|
|
1055
|
+
- **Two interchangeable engines.**
|
|
1056
|
+
- `fast` is a closed-form bitwise evaluator. It does constant work per call for word-sized indices, and cost grows only with bit length for arbitrary-precision indices.
|
|
1057
|
+
- `holographic` is an O(n) recursive descent, useful as a cross-check.
|
|
1058
|
+
- **Works where tables cannot.** Only the two indices are needed, so indices hundreds of bits long are fine. Full tables need 4^n entries.
|
|
1059
|
+
- **Cross-validated.** The test suite checks the table builders, the `fast` engine and the `holographic` engine against each other.
|
|
1060
|
+
- **Strict about types.** `bool`, `float`, `str` and `list` inputs are rejected. Results are plain Python `int`s.
|
|
1061
|
+
- **Tested on Python 3.10–3.14** and with NumPy 1.22 and newer.
|
|
1062
|
+
|
|
1063
|
+
## Input rules (0.4.x behavior)
|
|
1064
|
+
|
|
1065
|
+
| Kind | Element form | `dim` | Index range |
|
|
1066
|
+
|---|---|---|---|
|
|
1067
|
+
| `standard` | `(sign, index)` | not used | any integer ≥ 0 (no upper bound, since there is no `dim` to check against) |
|
|
1068
|
+
| `split` | `(sign, index)` | **required** | `0 ≤ index < 2**dim` |
|
|
1069
|
+
| `dual`, `dual_split` | `(sign, global_index)` or `(sign, local_index, eps)` | **required** | global: `0 ≤ i < 2**(dim+1)`; local: `0 ≤ i < 2**dim` |
|
|
1070
|
+
|
|
1071
|
+
- Elements must be **tuples**. Integers only, and NumPy integers are accepted.
|
|
1072
|
+
- `sign` should be `-1` or `+1`. Note: `multiply` currently also accepts `0` as a formal zero and returns zero. **Do not rely on this**; it may be removed.
|
|
1073
|
+
- Dual elements have two spellings of the same thing. At `dim=3`, `(1, 9)` and `(1, 1, 1)` both mean `+ε·e1` (global index `8 + 1`).
|
|
1074
|
+
- **Known looseness:** at `dim=3`, `(1, 9, 1)` and even `(1, 9, 0)` are also accepted and read as `+ε·e1`. The second one contradicts itself, so don't rely on it.
|
|
1075
|
+
- The dual result is always `(sign, local_index, eps)`, and `ε·ε` gives `(0, 0, 0)`.
|
|
1076
|
+
|
|
1077
|
+
## What the package cannot detect (your responsibility)
|
|
1078
|
+
|
|
1079
|
+
Elements are plain tuples, so they do not remember which algebra produced them.
|
|
1080
|
+
|
|
1081
|
+
- Feeding a result from one `dim` into an algebra of a different `dim` is not detected if the index happens to be in range.
|
|
1082
|
+
- Mixing `standard` and `split` elements is not detected. The same tuple means different things: `e2·e2` is `-1` in the standard algebra, `+1` in `split` with `dim=2`, and `-1` in `split` with `dim>=3`.
|
|
1083
|
+
- For `standard`, nothing tells you an index is "too big for the octonions".
|
|
1084
|
+
|
|
1085
|
+
## Not supported
|
|
1086
|
+
|
|
1087
|
+
- **No chain multiplication and no expressions.** `multiply` is strictly binary. You can pass a result into the next call yourself, but you choose the bracketing. From `n=3` (octonions) upward multiplication is **not associative**, so `(ab)c` and `a(bc)` can differ in sign.
|
|
1088
|
+
- **No coefficients, sums, vectors, arrays, or parsing** of expressions like `e1+e2+e12`. This is planned for a separate package built on top of this one.
|
|
1089
|
+
- **No addition, conjugation, norm, inverse, or division.**
|
|
1090
|
+
- **`split` means one split doubling on top of a standard parent.** Other sign patterns are not offered.
|
|
1091
|
+
- **`dual` and `dual_split`** extend a standard or split parent with a central `ε`, where `ε² = 0`.
|
|
1092
|
+
|
|
1093
|
+
## Algebra facts to keep in mind
|
|
1094
|
+
|
|
1095
|
+
| n | Standard | Split |
|
|
1096
|
+
|---|---|---|
|
|
1097
|
+
| 1 | complex, commutative | split-complex, commutative, has zero divisors |
|
|
1098
|
+
| 2 | quaternions, associative, **not commutative** | split-quaternions, associative, not commutative |
|
|
1099
|
+
| 3 | octonions, alternative, **not associative** | split-octonions, alternative, not associative, has zero divisors |
|
|
1100
|
+
| ≥ 4 | sedenions and beyond: **zero divisors**, no longer alternative | no longer alternative |
|
|
1101
|
+
|
|
1102
|
+
## Convention
|
|
1103
|
+
|
|
1104
|
+
Products follow the standard doubling `(a, b)(c, d) = (ac − d*b, da + bc*)` (split algebras flip the sign of the `d*b` term at the top level). Other conventions give isomorphic algebras with **different tables**, so comparing against another source may show sign differences after relabeling. For example, here `e1·e2 = e3` and `e1·e6 = −e7`.
|
|
1105
|
+
|
|
1106
|
+
## Direct low-level classes
|
|
1107
|
+
|
|
1108
|
+
`FastStandard`, `FastSplit`, `FastDual`, `StandardHolographic`, `SplitHolographic` and `DualHolographic` are exported, but they validate **differently** from each other and from `multiply`. For example, `FastSplit` accepts a zero element while the other three reject it. Their `multiply_indices` methods do only minimal checks. **Prefer `multiply`.** These classes are not a stable API and are expected to become internal.
|
|
1109
|
+
|
|
1110
|
+
## Tables and memory
|
|
1111
|
+
|
|
1112
|
+
Full tables have `4**n` entries. `build_table` refuses requests above a default memory budget (`max_bytes`, 256 MiB):
|
|
1113
|
+
|
|
1114
|
+
- `standard` and `split` are allowed up to `n = 13`.
|
|
1115
|
+
- `dual` and `dual_split` are allowed up to `n = 12`, since they are one doubling larger.
|
|
1116
|
+
|
|
1117
|
+
Use `estimate_table_bytes(kind, n)` to check a size, and pass a larger `max_bytes` (or `None`) if you really mean it. In dual tables, `sign == 0` marks `ε·ε`.
|
|
1118
|
+
|
|
1119
|
+
## Stability and planned changes
|
|
1120
|
+
|
|
1121
|
+
- Pin your dependency, for example `hypercomplex-engine>=0.4.1,<0.5`.
|
|
1122
|
+
- *Planned for 0.5.0, subject to change:* stricter inputs (no zero elements, one dual form), and low-level classes made internal. Breaking changes will be listed in the release notes.
|
|
1123
|
+
- Do not treat the package as 1.0-stable until it has been used by futur a palnned package the vector-and-expression package.
|
|
1124
|
+
|
|
1040
1125
|
---
|
|
1041
1126
|
|
|
1042
1127
|
# Citation
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://www.python.org/downloads/)
|
|
5
|
-
[](#)
|
|
6
5
|
[](https://github.com/maher1719/hypercomplex-engine)
|
|
7
6
|
[](https://pypi.org/project/hypercomplex-engine/)
|
|
8
7
|
[](https://pepy.tech/project/hypercomplex-engine)
|
|
@@ -21,6 +20,11 @@ This library provides the computational substrate for high-dimensional hypercomp
|
|
|
21
20
|
|
|
22
21
|
---
|
|
23
22
|
|
|
23
|
+
## Scope and limitations
|
|
24
|
+
|
|
25
|
+
If you build upon this package, please read fully [Go to Scope, Strengths, and Limitations](#scope-strengths-and-limitations) below for more information or check [Scope, Strengths, and Limitations file](README_scope_and_limitations.md#scope-strengths-and-limitations)
|
|
26
|
+
|
|
27
|
+
|
|
24
28
|
## 📄 Publications & Preprints
|
|
25
29
|
|
|
26
30
|
This library serves as the formal verification substrate and computational engine for the following mathematical preprints:
|
|
@@ -989,6 +993,87 @@ hypercomplex-engine/
|
|
|
989
993
|
└── pyproject.toml
|
|
990
994
|
```
|
|
991
995
|
|
|
996
|
+
# Scope, strengths and limitations
|
|
997
|
+
|
|
998
|
+
> **Status: 0.4.x, pre-1.0.** The API can still change. Read this section before building on the package.
|
|
999
|
+
|
|
1000
|
+
## What this package is
|
|
1001
|
+
|
|
1002
|
+
It computes the product of two **signed basis elements** of a Cayley–Dickson algebra: `±e_i × ±e_j → ±e_k` (or zero in dual algebras). It is a low-level component, a sign and index calculator, not a number type. There are no coefficients, no sums, and no vectors.
|
|
1003
|
+
|
|
1004
|
+
## Advantages
|
|
1005
|
+
|
|
1006
|
+
- **One job, small surface.** About 2,000 lines, one dependency (NumPy), and multipliers that keep no per-call state.
|
|
1007
|
+
- **Two interchangeable engines.**
|
|
1008
|
+
- `fast` is a closed-form bitwise evaluator. It does constant work per call for word-sized indices, and cost grows only with bit length for arbitrary-precision indices.
|
|
1009
|
+
- `holographic` is an O(n) recursive descent, useful as a cross-check.
|
|
1010
|
+
- **Works where tables cannot.** Only the two indices are needed, so indices hundreds of bits long are fine. Full tables need 4^n entries.
|
|
1011
|
+
- **Cross-validated.** The test suite checks the table builders, the `fast` engine and the `holographic` engine against each other.
|
|
1012
|
+
- **Strict about types.** `bool`, `float`, `str` and `list` inputs are rejected. Results are plain Python `int`s.
|
|
1013
|
+
- **Tested on Python 3.10–3.14** and with NumPy 1.22 and newer.
|
|
1014
|
+
|
|
1015
|
+
## Input rules (0.4.x behavior)
|
|
1016
|
+
|
|
1017
|
+
| Kind | Element form | `dim` | Index range |
|
|
1018
|
+
|---|---|---|---|
|
|
1019
|
+
| `standard` | `(sign, index)` | not used | any integer ≥ 0 (no upper bound, since there is no `dim` to check against) |
|
|
1020
|
+
| `split` | `(sign, index)` | **required** | `0 ≤ index < 2**dim` |
|
|
1021
|
+
| `dual`, `dual_split` | `(sign, global_index)` or `(sign, local_index, eps)` | **required** | global: `0 ≤ i < 2**(dim+1)`; local: `0 ≤ i < 2**dim` |
|
|
1022
|
+
|
|
1023
|
+
- Elements must be **tuples**. Integers only, and NumPy integers are accepted.
|
|
1024
|
+
- `sign` should be `-1` or `+1`. Note: `multiply` currently also accepts `0` as a formal zero and returns zero. **Do not rely on this**; it may be removed.
|
|
1025
|
+
- Dual elements have two spellings of the same thing. At `dim=3`, `(1, 9)` and `(1, 1, 1)` both mean `+ε·e1` (global index `8 + 1`).
|
|
1026
|
+
- **Known looseness:** at `dim=3`, `(1, 9, 1)` and even `(1, 9, 0)` are also accepted and read as `+ε·e1`. The second one contradicts itself, so don't rely on it.
|
|
1027
|
+
- The dual result is always `(sign, local_index, eps)`, and `ε·ε` gives `(0, 0, 0)`.
|
|
1028
|
+
|
|
1029
|
+
## What the package cannot detect (your responsibility)
|
|
1030
|
+
|
|
1031
|
+
Elements are plain tuples, so they do not remember which algebra produced them.
|
|
1032
|
+
|
|
1033
|
+
- Feeding a result from one `dim` into an algebra of a different `dim` is not detected if the index happens to be in range.
|
|
1034
|
+
- Mixing `standard` and `split` elements is not detected. The same tuple means different things: `e2·e2` is `-1` in the standard algebra, `+1` in `split` with `dim=2`, and `-1` in `split` with `dim>=3`.
|
|
1035
|
+
- For `standard`, nothing tells you an index is "too big for the octonions".
|
|
1036
|
+
|
|
1037
|
+
## Not supported
|
|
1038
|
+
|
|
1039
|
+
- **No chain multiplication and no expressions.** `multiply` is strictly binary. You can pass a result into the next call yourself, but you choose the bracketing. From `n=3` (octonions) upward multiplication is **not associative**, so `(ab)c` and `a(bc)` can differ in sign.
|
|
1040
|
+
- **No coefficients, sums, vectors, arrays, or parsing** of expressions like `e1+e2+e12`. This is planned for a separate package built on top of this one.
|
|
1041
|
+
- **No addition, conjugation, norm, inverse, or division.**
|
|
1042
|
+
- **`split` means one split doubling on top of a standard parent.** Other sign patterns are not offered.
|
|
1043
|
+
- **`dual` and `dual_split`** extend a standard or split parent with a central `ε`, where `ε² = 0`.
|
|
1044
|
+
|
|
1045
|
+
## Algebra facts to keep in mind
|
|
1046
|
+
|
|
1047
|
+
| n | Standard | Split |
|
|
1048
|
+
|---|---|---|
|
|
1049
|
+
| 1 | complex, commutative | split-complex, commutative, has zero divisors |
|
|
1050
|
+
| 2 | quaternions, associative, **not commutative** | split-quaternions, associative, not commutative |
|
|
1051
|
+
| 3 | octonions, alternative, **not associative** | split-octonions, alternative, not associative, has zero divisors |
|
|
1052
|
+
| ≥ 4 | sedenions and beyond: **zero divisors**, no longer alternative | no longer alternative |
|
|
1053
|
+
|
|
1054
|
+
## Convention
|
|
1055
|
+
|
|
1056
|
+
Products follow the standard doubling `(a, b)(c, d) = (ac − d*b, da + bc*)` (split algebras flip the sign of the `d*b` term at the top level). Other conventions give isomorphic algebras with **different tables**, so comparing against another source may show sign differences after relabeling. For example, here `e1·e2 = e3` and `e1·e6 = −e7`.
|
|
1057
|
+
|
|
1058
|
+
## Direct low-level classes
|
|
1059
|
+
|
|
1060
|
+
`FastStandard`, `FastSplit`, `FastDual`, `StandardHolographic`, `SplitHolographic` and `DualHolographic` are exported, but they validate **differently** from each other and from `multiply`. For example, `FastSplit` accepts a zero element while the other three reject it. Their `multiply_indices` methods do only minimal checks. **Prefer `multiply`.** These classes are not a stable API and are expected to become internal.
|
|
1061
|
+
|
|
1062
|
+
## Tables and memory
|
|
1063
|
+
|
|
1064
|
+
Full tables have `4**n` entries. `build_table` refuses requests above a default memory budget (`max_bytes`, 256 MiB):
|
|
1065
|
+
|
|
1066
|
+
- `standard` and `split` are allowed up to `n = 13`.
|
|
1067
|
+
- `dual` and `dual_split` are allowed up to `n = 12`, since they are one doubling larger.
|
|
1068
|
+
|
|
1069
|
+
Use `estimate_table_bytes(kind, n)` to check a size, and pass a larger `max_bytes` (or `None`) if you really mean it. In dual tables, `sign == 0` marks `ε·ε`.
|
|
1070
|
+
|
|
1071
|
+
## Stability and planned changes
|
|
1072
|
+
|
|
1073
|
+
- Pin your dependency, for example `hypercomplex-engine>=0.4.1,<0.5`.
|
|
1074
|
+
- *Planned for 0.5.0, subject to change:* stricter inputs (no zero elements, one dual form), and low-level classes made internal. Breaking changes will be listed in the release notes.
|
|
1075
|
+
- Do not treat the package as 1.0-stable until it has been used by futur a palnned package the vector-and-expression package.
|
|
1076
|
+
|
|
992
1077
|
---
|
|
993
1078
|
|
|
994
1079
|
# Citation
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2/hypercomplex_engine.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hypercomplex-engine
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Fast O(1)/O(n) multiplication engine 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: MIT License
|
|
@@ -50,7 +50,6 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
[](https://opensource.org/licenses/MIT)
|
|
52
52
|
[](https://www.python.org/downloads/)
|
|
53
|
-
[](#)
|
|
54
53
|
[](https://github.com/maher1719/hypercomplex-engine)
|
|
55
54
|
[](https://pypi.org/project/hypercomplex-engine/)
|
|
56
55
|
[](https://pepy.tech/project/hypercomplex-engine)
|
|
@@ -69,6 +68,11 @@ This library provides the computational substrate for high-dimensional hypercomp
|
|
|
69
68
|
|
|
70
69
|
---
|
|
71
70
|
|
|
71
|
+
## Scope and limitations
|
|
72
|
+
|
|
73
|
+
If you build upon this package, please read fully [Go to Scope, Strengths, and Limitations](#scope-strengths-and-limitations) below for more information or check [Scope, Strengths, and Limitations file](README_scope_and_limitations.md#scope-strengths-and-limitations)
|
|
74
|
+
|
|
75
|
+
|
|
72
76
|
## 📄 Publications & Preprints
|
|
73
77
|
|
|
74
78
|
This library serves as the formal verification substrate and computational engine for the following mathematical preprints:
|
|
@@ -1037,6 +1041,87 @@ hypercomplex-engine/
|
|
|
1037
1041
|
└── pyproject.toml
|
|
1038
1042
|
```
|
|
1039
1043
|
|
|
1044
|
+
# Scope, strengths and limitations
|
|
1045
|
+
|
|
1046
|
+
> **Status: 0.4.x, pre-1.0.** The API can still change. Read this section before building on the package.
|
|
1047
|
+
|
|
1048
|
+
## What this package is
|
|
1049
|
+
|
|
1050
|
+
It computes the product of two **signed basis elements** of a Cayley–Dickson algebra: `±e_i × ±e_j → ±e_k` (or zero in dual algebras). It is a low-level component, a sign and index calculator, not a number type. There are no coefficients, no sums, and no vectors.
|
|
1051
|
+
|
|
1052
|
+
## Advantages
|
|
1053
|
+
|
|
1054
|
+
- **One job, small surface.** About 2,000 lines, one dependency (NumPy), and multipliers that keep no per-call state.
|
|
1055
|
+
- **Two interchangeable engines.**
|
|
1056
|
+
- `fast` is a closed-form bitwise evaluator. It does constant work per call for word-sized indices, and cost grows only with bit length for arbitrary-precision indices.
|
|
1057
|
+
- `holographic` is an O(n) recursive descent, useful as a cross-check.
|
|
1058
|
+
- **Works where tables cannot.** Only the two indices are needed, so indices hundreds of bits long are fine. Full tables need 4^n entries.
|
|
1059
|
+
- **Cross-validated.** The test suite checks the table builders, the `fast` engine and the `holographic` engine against each other.
|
|
1060
|
+
- **Strict about types.** `bool`, `float`, `str` and `list` inputs are rejected. Results are plain Python `int`s.
|
|
1061
|
+
- **Tested on Python 3.10–3.14** and with NumPy 1.22 and newer.
|
|
1062
|
+
|
|
1063
|
+
## Input rules (0.4.x behavior)
|
|
1064
|
+
|
|
1065
|
+
| Kind | Element form | `dim` | Index range |
|
|
1066
|
+
|---|---|---|---|
|
|
1067
|
+
| `standard` | `(sign, index)` | not used | any integer ≥ 0 (no upper bound, since there is no `dim` to check against) |
|
|
1068
|
+
| `split` | `(sign, index)` | **required** | `0 ≤ index < 2**dim` |
|
|
1069
|
+
| `dual`, `dual_split` | `(sign, global_index)` or `(sign, local_index, eps)` | **required** | global: `0 ≤ i < 2**(dim+1)`; local: `0 ≤ i < 2**dim` |
|
|
1070
|
+
|
|
1071
|
+
- Elements must be **tuples**. Integers only, and NumPy integers are accepted.
|
|
1072
|
+
- `sign` should be `-1` or `+1`. Note: `multiply` currently also accepts `0` as a formal zero and returns zero. **Do not rely on this**; it may be removed.
|
|
1073
|
+
- Dual elements have two spellings of the same thing. At `dim=3`, `(1, 9)` and `(1, 1, 1)` both mean `+ε·e1` (global index `8 + 1`).
|
|
1074
|
+
- **Known looseness:** at `dim=3`, `(1, 9, 1)` and even `(1, 9, 0)` are also accepted and read as `+ε·e1`. The second one contradicts itself, so don't rely on it.
|
|
1075
|
+
- The dual result is always `(sign, local_index, eps)`, and `ε·ε` gives `(0, 0, 0)`.
|
|
1076
|
+
|
|
1077
|
+
## What the package cannot detect (your responsibility)
|
|
1078
|
+
|
|
1079
|
+
Elements are plain tuples, so they do not remember which algebra produced them.
|
|
1080
|
+
|
|
1081
|
+
- Feeding a result from one `dim` into an algebra of a different `dim` is not detected if the index happens to be in range.
|
|
1082
|
+
- Mixing `standard` and `split` elements is not detected. The same tuple means different things: `e2·e2` is `-1` in the standard algebra, `+1` in `split` with `dim=2`, and `-1` in `split` with `dim>=3`.
|
|
1083
|
+
- For `standard`, nothing tells you an index is "too big for the octonions".
|
|
1084
|
+
|
|
1085
|
+
## Not supported
|
|
1086
|
+
|
|
1087
|
+
- **No chain multiplication and no expressions.** `multiply` is strictly binary. You can pass a result into the next call yourself, but you choose the bracketing. From `n=3` (octonions) upward multiplication is **not associative**, so `(ab)c` and `a(bc)` can differ in sign.
|
|
1088
|
+
- **No coefficients, sums, vectors, arrays, or parsing** of expressions like `e1+e2+e12`. This is planned for a separate package built on top of this one.
|
|
1089
|
+
- **No addition, conjugation, norm, inverse, or division.**
|
|
1090
|
+
- **`split` means one split doubling on top of a standard parent.** Other sign patterns are not offered.
|
|
1091
|
+
- **`dual` and `dual_split`** extend a standard or split parent with a central `ε`, where `ε² = 0`.
|
|
1092
|
+
|
|
1093
|
+
## Algebra facts to keep in mind
|
|
1094
|
+
|
|
1095
|
+
| n | Standard | Split |
|
|
1096
|
+
|---|---|---|
|
|
1097
|
+
| 1 | complex, commutative | split-complex, commutative, has zero divisors |
|
|
1098
|
+
| 2 | quaternions, associative, **not commutative** | split-quaternions, associative, not commutative |
|
|
1099
|
+
| 3 | octonions, alternative, **not associative** | split-octonions, alternative, not associative, has zero divisors |
|
|
1100
|
+
| ≥ 4 | sedenions and beyond: **zero divisors**, no longer alternative | no longer alternative |
|
|
1101
|
+
|
|
1102
|
+
## Convention
|
|
1103
|
+
|
|
1104
|
+
Products follow the standard doubling `(a, b)(c, d) = (ac − d*b, da + bc*)` (split algebras flip the sign of the `d*b` term at the top level). Other conventions give isomorphic algebras with **different tables**, so comparing against another source may show sign differences after relabeling. For example, here `e1·e2 = e3` and `e1·e6 = −e7`.
|
|
1105
|
+
|
|
1106
|
+
## Direct low-level classes
|
|
1107
|
+
|
|
1108
|
+
`FastStandard`, `FastSplit`, `FastDual`, `StandardHolographic`, `SplitHolographic` and `DualHolographic` are exported, but they validate **differently** from each other and from `multiply`. For example, `FastSplit` accepts a zero element while the other three reject it. Their `multiply_indices` methods do only minimal checks. **Prefer `multiply`.** These classes are not a stable API and are expected to become internal.
|
|
1109
|
+
|
|
1110
|
+
## Tables and memory
|
|
1111
|
+
|
|
1112
|
+
Full tables have `4**n` entries. `build_table` refuses requests above a default memory budget (`max_bytes`, 256 MiB):
|
|
1113
|
+
|
|
1114
|
+
- `standard` and `split` are allowed up to `n = 13`.
|
|
1115
|
+
- `dual` and `dual_split` are allowed up to `n = 12`, since they are one doubling larger.
|
|
1116
|
+
|
|
1117
|
+
Use `estimate_table_bytes(kind, n)` to check a size, and pass a larger `max_bytes` (or `None`) if you really mean it. In dual tables, `sign == 0` marks `ε·ε`.
|
|
1118
|
+
|
|
1119
|
+
## Stability and planned changes
|
|
1120
|
+
|
|
1121
|
+
- Pin your dependency, for example `hypercomplex-engine>=0.4.1,<0.5`.
|
|
1122
|
+
- *Planned for 0.5.0, subject to change:* stricter inputs (no zero elements, one dual form), and low-level classes made internal. Breaking changes will be listed in the release notes.
|
|
1123
|
+
- Do not treat the package as 1.0-stable until it has been used by futur a palnned package the vector-and-expression package.
|
|
1124
|
+
|
|
1040
1125
|
---
|
|
1041
1126
|
|
|
1042
1127
|
# Citation
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/fast_split.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/fast/fast_standard.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/__init__.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/dual.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/split.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/holographic/standard.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/__init__.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/common.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/dual.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/split.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/core/table_builder/standard.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex/printer/cd_table_printer.py
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/requires.txt
RENAMED
|
File without changes
|
{hypercomplex_engine-0.4.1 → hypercomplex_engine-0.4.2}/hypercomplex_engine.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|