Arithmetica 0.7.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Arithmetica --version 0.7.5                
NuGet\Install-Package Arithmetica -Version 0.7.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Arithmetica" Version="0.7.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Arithmetica --version 0.7.5                
#r "nuget: Arithmetica, 0.7.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Arithmetica as a Cake Addin
#addin nuget:?package=Arithmetica&version=0.7.5

// Install Arithmetica as a Cake Tool
#tool nuget:?package=Arithmetica&version=0.7.5                

Arithmetic

To summarise, arithmetica is developed to help students, professional or scientists to learn or prototype work related to applied mathematics and quantum physics.

Following are the features:

  • Full-featured implementation of mathematical data types including complex numbers’ quaternion and various sizes of matrices and vectors.
  • Support for most of the math functions for basic maths, linear algebra, rounding, comparison, log, exp, powering etc.
  • Support single-precision and double-precision floating point types.
  • Covers most of the functions required to use Complex vectors and matrix.
  • Geometric data types and algorithms for 2D and 3D — distance and intersection methods, bounding volumes etc.
  • Random number and noise generation with around 10 algorithms
  • Strong-Typed collections for the library’s data types.
  • Support for Multi-Dimensional array in case 2D, 3D are not sufficient.

How to use the library

  • Create a new .NET core or Windows console project.
  • Right-Click on the solution and select Managed NuGet References.
  • Search for “Arithmetica”, select and install the latest version
  • Open the class file and import namespace “using Arithmetica” to start using the library and its functions.

Vector Example

//Point A in the 2D space
Vector2 A = new Vector2(10, 20);

//Point B in the 2D space
Vector2 B = new Vector2(70, 80);

//Find the Euclidean distance
var distance = DistanceMethods.Distance(A, B);

Complex Matrix Example

//Define a 2x2 complex matrix
ComplexMatrix matrix = new ComplexMatrix(2, 2);
matrix[0, 0] = new Complex(2, 2);
matrix[0, 1] = new Complex(1, 2);
matrix[1, 0] = new Complex(3, 1);
matrix[1, 1] = new Complex(2, 3);
Console.WriteLine("First Matrix");
Console.WriteLine(matrix.ToString());

//Define a comple vector of length 2
ComplexVector vector = new ComplexVector(2);
vector[0] = new Complex(2, 1);
vector[1] = new Complex(1, 3);
Console.WriteLine("Second Vector");
Console.WriteLine(vector.ToString());

// Multiplying a 2x2 matrix with a vector will result a vector
var result = matrix * vector;

Console.WriteLine("Result Vector");
Console.WriteLine(result.ToString());

Quantum Teleportation

//Create a register with 2 Qubits
QuantumRegister register = new QuantumRegister(2);

//Create a blank circuit with the regiter initialised
QuantumCircuit circuit = new QuantumCircuit(register);

//Initialize the tranported counter
int transported = 0;

//Let try to teleport 25 quantum information
for (int i = 0; i < 25; i++)
{
	var send = GetRandom();

	//Initial the first Qubit with the particle to be teleported
	circuit.INIT(0, send);

	//Hadamard gate to apply superposition to the first quantum bit which means the first qubit will have both 0 and 1
	circuit.H(0);

	//Controlled not gate to entangle the two qubit
	circuit.CNOT(0, 1);

	//Measure the first will collapse the quantum state and bring it to reality whic will be either one or zero
	circuit.Measure(0);

	//Store the first state
	var res1 = register[0].QState;

	//Now measue the second particle and store the value
	circuit.Measure(1);
	var res2 = register[1].QState;

	Console.WriteLine("Send: {0}, Received: {1}", res1, res2);

	//If you compare the result the two result will be same which states that the information is teleported.
	if (res1 == res2)
		transported++;

	register.Reset();
}

//var result = circuit.Execute(1000);
Console.WriteLine("Teleported count: " + transported);

Nuget package available, search with name Arithmetica

API Documentation: https://deepakkumar1984.github.io/Arithmetica/api/Arithmetica.html

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1,045 4/23/2020
0.8.4 1,218 6/28/2019
0.8.0 1,147 6/9/2019
0.7.5 1,040 5/29/2019
0.7.0 1,071 5/23/2019
0.6.1 1,175 5/20/2019
0.6.0 1,090 5/20/2019
0.4.1 1,084 5/12/2019