Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
with:
toolchain: stable
- name: run benchmarks
run: cargo bench
run: CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="timeout 600" cargo bench

coverage:
name: code coverage
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# changelog

## 0.6.6 (2025-04-23)

### added
- organized traits into dedicated modules with feature flags
- implemented conditional compilation for optional traits (optics, projection, manifold)
- tensor test suite comparing mathematical representation and performance with geonum

### changed
- refactored codebase for improved maintainability and organization
- moved primary types into separate modules (geonum.rs, multivector.rs, dimensions.rs)
- reduced lib.rs size
- fixed Clippy lints and warnings throughout codebase
- new benchmark numbers in README

## 0.6.5 (2025-04-21)

### changed
Expand Down
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "geonum"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
repository = "https://github.com/mxfactorial/geonum"
description = "geometric number library supporting unlimited dimensions with O(1) complexity"
Expand All @@ -10,10 +10,18 @@ keywords = ["geonum", "geometry", "math", "algebra", "geometric-algebra"]
categories = ["mathematics", "simulation", "algorithms", "data-structures"]
authors = ["mxfactorial"]

[features]
default = []
optics = []
projection = []
manifold = []
all = ["optics", "projection", "manifold"]

[dependencies]

[dev-dependencies]
criterion = "0.5"
geonum = { path = ".", features = ["all"] }

[[bench]]
name = "geonum_benchmarks"
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,40 +51,40 @@ see [tests](https://github.com/mxfactorial/geonum/tree/develop/tests) to learn h

| implementation | size | time |
|----------------|------|------|
| tensor (O(n³)) | 2 | 1.06 µs |
| tensor (O(n³)) | 2 | 1.05 µs |
| tensor (O(n³)) | 3 | 2.25 µs |
| tensor (O(n³)) | 4 | 3.90 µs |
| tensor (O(n³)) | 8 | 7.92 µs |
| tensor (O(n³)) | 16 | 69.54 µs |
| geonum (O(1)) | any | 9.83 ns |
| tensor (O(n³)) | 4 | 4.20 µs |
| tensor (O(n³)) | 8 | 7.83 µs |
| tensor (O(n³)) | 16 | 66.65 µs |
| geonum (O(1)) | any | 15.52 ns |

geonum achieves constant O(1) time complexity regardless of problem size, 400× faster than tensor operations at size 4 and 7000× faster at size 16, eliminating cubic scaling of traditional tensor implementations
geonum achieves constant O(1) time complexity regardless of problem size, 270× faster than tensor operations at size 4 and 4300× faster at size 16, eliminating cubic scaling of traditional tensor implementations

#### extreme dimension comparison

| implementation | dimensions | time | storage complexity |
|----------------|------------|------|-------------------|
| traditional ga | 10 | 543.40 ns (partial) | O(2^n) = 1024 components |
| traditional ga | 10 | 545.69 ns (partial) | O(2^n) = 1024 components |
| traditional ga | 30 | theoretical only | O(2^n) = 1 billion+ components |
| traditional ga | 1000 | impossible | O(2^1000) ≈ 10^301 components |
| traditional ga | 1,000,000 | impossible | O(2^1000000) components |
| geonum (O(1)) | 10 | 134.12 ns | O(1) = 2 components |
| geonum (O(1)) | 30 | 153.64 ns | O(1) = 2 components |
| geonum (O(1)) | 1000 | 2.08 µs | O(1) = 2 components |
| geonum (O(1)) | 1,000,000 | 2.94 ms | O(1) = 2 components |
| geonum (O(1)) | 10 | 78.00 ns | O(1) = 2 components |
| geonum (O(1)) | 30 | 79.64 ns | O(1) = 2 components |
| geonum (O(1)) | 1000 | 77.44 ns | O(1) = 2 components |
| geonum (O(1)) | 1,000,000 | 78.79 ns | O(1) = 2 components |

geonum enables geometric algebra in million-dimensional spaces with constant time operations, achieving whats mathematically impossible with traditional implementations (requires more storage than atoms in the universe)

#### multivector ops

| operation | dimensions | time | traditional ga complexity |
|-----------|------------|------|---------------------------|
| grade extraction | 1,000,000 | 130.69 ns | O(2^n) |
| grade involution | 1,000,000 | 157.18 ns | O(2^n) |
| clifford conjugate | 1,000,000 | 112.90 ns | O(2^n) |
| contractions | 1,000,000 | 266.31 ns | O(2^n) |
| anti-commutator | 1,000,000 | 246.24 ns | O(2^n) |
| all ops combined | 1,000 | 826.57 ns | impossible at high dimensions |
| grade extraction | 1,000,000 | 136.46 ns | O(2^n) |
| grade involution | 1,000,000 | 153.37 ns | O(2^n) |
| clifford conjugate | 1,000,000 | 111.39 ns | O(2^n) |
| contractions | 1,000,000 | 292.56 ns | O(2^n) |
| anti-commutator | 1,000,000 | 264.46 ns | O(2^n) |
| all ops combined | 1,000 | 883.74 ns | impossible at high dimensions |

geonum performs all major multivector operations with exceptional efficiency in million-dimensional spaces, maintaining sub-microsecond performance for grade-specific operations that would require exponential time and memory in traditional geometric algebra implementations

Expand Down
8 changes: 4 additions & 4 deletions benches/geonum_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ fn bench_extreme_dimensions(c: &mut Criterion) {
// we'll do a very limited calculation - just computing a small subset
// of the full 1024×1024 operation
let mut result = vec![0.0; 1024];
for i in 1..20 {
// Doing only 20 components for benchmarking sanity
for j in 1..20 {
if v1[i] != 0.0 && v2[j] != 0.0 {
// Only 20 components for benchmarking sanity
for (i, &v1i) in v1.iter().enumerate().skip(1).take(19) {
for (j, &v2j) in v2.iter().enumerate().skip(1).take(19) {
if v1i != 0.0 && v2j != 0.0 {
// XOR gives the resulting basis element index
let k = i ^ j;

Expand Down
Loading