Working on a general algebra library for Swift

Hello! I've been working on a lot of projects having to do with general algebra in Swift dealing with groups, rings, fields, etc, as well as a library for fast matrix computations that allows for parametrization of any type whose values can be thought of as elements of a ring. I was wondering if the Swift Numerics library would have any use for this? Currently I've been trying to just work on it to implement different lattice cryptography schemes, but as I've been working on it, I've found myself adding more functionality to my BigNumber and MatrixKit libraries, and it's developing into more of a general algebra library. I've been working on making it so that the matrix operations are automatically optimized depending on the parametrized type.

For example, Matrix<Double> uses Accelerate to compute its computations, and I'm working on other optimizations for Matrix<Int> and Matrix<BigNumber>, etcetera.

Is this the kind of thing that would be useful to the Swift Numerics library? Or is this better fit elsewhere?

6 Likes

4 years ago I asked a related question: Pitch: Abstract Algebra (linked to tiny SPM package) · Issue #38 · apple/swift-numerics · GitHub

No reply

2 Likes

I have found this in README:

Future expansion may assume the availability of other standard interfaces, such as BLAS (Basic Linear Algebra Subprograms) and LAPACK (Linear Algebra Package), but modules with more specialized dependencies (or dependencies that are not available on all platforms supported by Swift) belong in a separate package.

AFAIK Accelerate is not available on Windows nor Linux.

I have also found some Algebra related packages in the Index.

Also, some cryptography is already covered by swift-crypto and swift-certificates.

1 Like

Ah I see, looks like we had the same idea. Is there a formal process for proposing changes to the numerics library? Like forking the repository?

1 Like

Surge might also be of interest, I’ve been using it in a project and have enjoyed it so far.

1 Like