TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
11.35k stars 349 forks source link

Quantum Superposition Integration #273

Open darinsecurity opened 1 year ago

darinsecurity commented 1 year ago

Classical bits and electronic computing are relics of the modern era. Quantum computing is the future, and we must integrate it into DreamBerd. This starts, simply, with the introduction of Schrodinger variables and 4^n bit simultaneous outcomes.

== Quantum Bits ===

If you mention some code as such a = b//c! The variable 'a' will exist in a simulated quantum superposition between being the value b, being the value c, being both values, and being no values (none.) This will simulate a n-bit quantum computer for every time a variable in a superposition branches. The same mechanics of the language apply, you just get 4^n simultaneous outcomes. Outcomes where errors occur will end. This is similar to the "Many worlds" implementation and will create more navigatable and powerful code.

https://en.wikipedia.org/wiki/Many-worlds_interpretation

For example (psuedocode):

` function calculatePrimeFactors(n) => { const total = []! const var old = -1! while !(total.length === old) { const var div = n//1! (sample factors from div) (break when no more factors can be found (all outcomes exhausted) break!

}

return total! // Totally does not have any numbers in superposition

} `

This is similar to the effects of quantum mechanics, although on a much more parallel scale than actual quantum mechanics. Simultaneous outcomes can be generated which will lead to more intuitive distributed processing and computing. The actual mechanics of quantum effects shall be integrated in a later version. For instance: All quantum-imposed variables are random and will generate a spectrum of random outcomes until the variable is modified or returned in any possible outcome, wherein all other outcomes will collapse.

stohrendorf commented 1 year ago

Related: #117