Swiftpack.co - WowbaggersLiquidLunch/Quantum as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by WowbaggersLiquidLunch.
WowbaggersLiquidLunch/Quantum 0.0.2
A library that enables quantum mechanical behaviours for variables; no complex vector space involved.
⭐️ 5
🕓 3 years ago
.package(url: "https://github.com/WowbaggersLiquidLunch/Quantum.git", from: "0.0.2")

Quantum

This package allows variables to behave in a quantum mechanical way.

A quantum mechanical variable can be created in 2 ways:

  1. Via Quantum's initialiser directly.

    var quantumText = Quantum("Schrödinger")
    
  2. Via the @Quantum annotation.

    @Quantum
    var quantumNumber = 0
    

Variables governed by quantum mechanics behave differently from those governed by classical mechanics. For a classical mechanical system, it is possible to predict the present state if its past states and movements are known (determinism), and vice versa (reversibility). On the contrary, for a quantum mechanical system, it is impossible to predict its state at any point in time; its present state is unknown until observed.

quantumNumber = 1
quantumNumber = 2
quantumNumber = 3

print($quantumNumber.outcomeProbabilities)
//	Prints "[0: 0.125, 1: 0.125, 2: 0.25, 3: 0.5]".

print(quantumNumber)
//	Prints "0", "1", "2", or "3".
//	All for values are possible.

Please see the project's wiki for detailed documentation.


This library, and everything included in this directory is released both to the public domain (through the Unlicense license) and under the MIT license. The user is free to choose either license. In general, public domain is preferred, unless the circumstance dictates otherwise. For more information, see LICENSE.

Unlicense icon

GitHub

link
Stars: 5
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.0.2
3 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics