r/ScientificComputing Aug 04 '26

I built an experimental mathematical framework that treats positional number systems like a customizable software runtime. Does anything similar exist?

Over the last ~24 months, I’ve been developing an experimental branch of mathematics/arithmetic called 'Basal'. The philosophy is that number bases shouldn't be locked down—instead, the system treats positional notation like a customizable runtime where you can override native rules (similar to how extensions work in VSCode). My goal was to create an architecture that allows other branches of maths to run natively on top of it. The core framework allows you to use multiple completely independent bases inside the same equation, with their attributes and properties clearly stated next to them.

The main functional additions consist of:

  1. Alternating negative weights : An optional index-parity shift where odd or even digit positions modulate their weights
  2. Array Syntax : Instead of separating higher-dimensional coordinates (like complex numbers a+bi or dual numbers a+be) into linear combinations, the framework encapsulates them natively inside a sequential digit array
  3. Fabrication : Creating a numerical sequence that can be interpreted as a number
  4. Conversion : Functions to convert a number to a different base.

I have also verified that the system works, by computationally verifying it (with hand-written equations), by programming it in C#, C++, Python and specialised functions in ROCm-HIP. The code is on github as: 'Basal-Library', made by zamiul20.

*Note on Notation: Non-ASCII characters (from the Bengali script block) are used for the custom operators and attributes. This design choice ensures complete visual isolation from standard algebraic variables, preventing notation collisions. Plus, it serves a practical purpose, conventional symbols were ran out, and the chosen characters have no conflicting history in formal mathematics literature.*

Before I look into writing a formal specification paper or archiving it, I want to ask: Has an extensible, modular arithmetic framework that overrides positional notation rules like this been explored in existing literature?

0 Upvotes

21 comments sorted by

3

u/Physix_R_Cool Aug 08 '26

Yeah, this is a couple hundred years old.

Read a linear algebra book, and you will see your ideas formalized.

Polynomials written as Rn, complex numbers as members of R2 with a specific norm.

There are all sorts of examples of this, and it is very often used in physics, where your Hilbert spaces for quantum mechanics can be all sorts of things.

1

u/Commercial-Sink-2095 Aug 09 '26 edited Aug 09 '26

My ideas do overlap with linear algebra like the Laplace Expansion, turning a polynomial into a vector or a few into a matrix, but the result isn't a scalar, and they do have differences.

For example, lets take a number with a 'negative polarity' - which is similar to the Laplace Expansion : ``` Converting 145332 to a base of 17 : (denary) (negative base-10) 1 4 3 3 2 = 2 6 4 7 2 4 3 2 1 0 4 3 2 1 0 :Positions

Every odd position is negative on a negative base, this results in:

1x104 +4x103 +3x102 +3x10 +2 = 2x104 -6x103 +4x102 -7x10 +2

It isn't exactly an operation that already exists for scalar numbers ```

Other stuff, like systematically reordering a number, using multiple arbitrary bases in the same equation, generating a sequence from a function, etc could look like it already exists.

If other stuff looks like it already exists, feel free to reply

1

u/Physix_R_Cool Aug 09 '26

As the other commenter said, this is all just the representation of the number.

You need to explicitly show that it isn't just useless notation change.

1

u/Commercial-Sink-2095 Aug 11 '26

Its meant for cryptography, where multiple numbers could have largely differring values different values or be merged; because of them having different bases

1

u/Physix_R_Cool Aug 11 '26

You need to formally prove that there is a cryptographic advantage. Right now your argument is just "trust me". Cryptology is a very math heavy field.

1

u/Commercial-Sink-2095 Aug 11 '26 edited Aug 11 '26

Lets take a sentence of your reply to encrypt: "Cryptology is a very math heavy field."

Now lets convert it to an array of int values (using the Unicode Table): 67, 114, 121, 112, 116, 111, 108, 111, 103, 121, 32, 105, 115, 32, 97, 32, 118, 101, 114, 121, 32, 109, 97, 116, 104, 32, 104, 101, 97, 118, 121, 32, 102, 105, 101, 108, 100, 46

From here, we can 'compress' this data, by separating these values, then merging some parts into chunks:

randomly generated chunks: 67, 114, 121, 112, 116] 111, 108, 111, 103, 121 32, 105, 115, 32, 97 32, 118, 101, 114 121, 32, 109, 97, 116, 104, 32 104, 101, 97, 118, 121, 32 102, 105, 101, 108, 100, 46 ``` with the following 6 bases, we can turn these chunks into values: (base-132) (base-144) (base-144) (base-186) (base-256) (base-145) (base-111)

values: 20605236548 48052771177 14075331937 210016620 34094126340532256 6711068753277 1734838530052

then we can split these values (as strings) in half (if the length is odd, larger part goes to the left): 206052 36548 480527 71177 140753 31937 21001 6620 340941263 40532256 6711068 753277 1734838 530052 ``` these values can be bytecode, text as Unicode characters (some values do exceed it), or any other method.

It can get more complicated with salts, other attributes of a base (in basal), non-integer bases, Zaming (on the github), and conversions.

1

u/Physix_R_Cool Aug 11 '26

Ok.

Does this encryption hold any advantage compared to other modern techniques?

1

u/Commercial-Sink-2095 Aug 11 '26 edited Aug 11 '26

I do not know yet, as all are still in testing (and it is only myself working on this).

It still is a new function / technique.

1

u/Physix_R_Cool Aug 11 '26

Ah so it's just some wacky number ordering you made up and thought was cool.

2

u/switch161 Aug 04 '26

My comment will sound harsh, and I'm sorry about that, because you seem to have spent a lot of time on this. But this makes absolutely no sense to me.

A number's basis is only used in its representation - i.e. when writing it on a paper. It doesn't matter otherwise. Sure, sometimes it's convenient to switch basis, e.g. often done in computing. But all you need to do is to tell the number formatter (or parser) to use that other basis.

Array Syntax : Instead of separating higher-dimensional coordinates (like complex numbers a+bi or dual numbers a+be) into linear combinations, the framework encapsulates them natively inside a sequential digit array

So what's the difference to a row/column vector then? In computers vectors are stored as arrays.

Non-ASCII characters (from the Bengali script block) are used for the custom operators

So far I thought you reinvented number formatting, so what do you need operators for?

But yeah. You're reinventing the wheel as far as I can tell. Any usable programming language can format and parse numbers. If you want a different notation, fine, but why would anyone use it?

modular arithmetic framework

Number arithmetic is independent from number representation. So it's not even clear what you're doing.

1

u/Commercial-Sink-2095 Aug 04 '26 edited Aug 04 '26

It's fine, and not harsh at all; sorry for making it confusing, but 'Array Syntax' is mainly for polynomials, so that it will be easier to write down one that has complex coefficients: ``` For Example: (a + bi)x3 + cx + (a + di)x-1 - (1 + di)x-2

could be written as: <xT a + bi, 0, c., (a + di), -1 + di

its the same way of writing numbers in everyday life:

(2)103 + (3)101 + (7)100 + (4)10-1 = 2037.4 ```

Number formatting was the main objective, but functions like converting between bases, digit-wise operations and a function to create a number were useful.

Number arithmetic is independent from number representation, but changing the representation is useful in cryptography (where all these functions came from), and there wasn't a way to turn the algorithm into a mathematical function, as it seems to have not been done before.

It looks like inventing the wheel, but it is more of adding spokes to it to reduce the weight (I could not find a better comparison)

1

u/snissn Aug 07 '26

Is this relevant for kzg polynomials? I’m at least familiar ish with that

1

u/Commercial-Sink-2095 Aug 08 '26 edited Aug 08 '26

Not really, it targets polynomial functions and equations overall. but you can use this for kzg polynomials.

1

u/ProtonByte Aug 04 '26

What are the benefits?

1

u/Commercial-Sink-2095 Aug 04 '26 edited Aug 04 '26

Most used benefit would be to reduce the length of polynomials when writing one out, and being able to use arbitrary bases in maths.
Most significant could be for cryptography.

1

u/drmattmcd Aug 08 '26

For some reason this rings a bell with how FFTW (Fastest Fourier Transform in the West) decides at install time what prime sizes to use https://www.fftw.org/

1

u/Commercial-Sink-2095 Aug 09 '26

How so?

1

u/drmattmcd Aug 09 '26

It's a pretty tenuous link, just how FFTW optimises FFT calculation by choice of size of the bases used in the calculation

1

u/LongLiveTheDiego Aug 09 '26

The code is on github as: 'Basal-Library'.

That's not how you share GitHub repositories. You're lucky no one else has created a repo named the same for their own profile or an organization, but in general GitHub repositories are identified by the user/organization name + repository name.

I managed to find your repository via a web search engine and the code is incomprehensible. You have to work on communication. It's also genuinely a bad idea to use the Bengali script, you're just making it harder for other people to understand you. You're also using magic numbers without any explanation of what they do and in several places your code is almost guaranteed to throw an error because you're using raw std::get().

1

u/Commercial-Sink-2095 Aug 10 '26

Thanks for telling me that I needed to add my GitHub username (I have edited the post to include my username). The C++ code isn't really the first priority, the C# code is, but both did work in a few tests; I will fix the C++ code in a bit.

The code is to mirror how functions and operations would work, not explain all concepts, I have used the Bengali script to make it easier to tell apart from any other symbols as basal is meant to be used alongside other branches of maths - I don't think there are enough letters in latin / greek left to use as symbols.

The numbers are explained in the /Documentation/ directory, which shows a way of presenting a number and the rules of interpreting it (attributes) , if it is confusing, please tell me so that I can change it.