Installation
Run this in your terminal
OR add this to your Cargo.toml
:
[]
= "0.1.0"
Features
Complex Numbers
Comprehensive support for complex arithmetic, mathematical functions, and polar form conversions
Example
use Complex;
// Create complex numbers
let z1 = new;
let z2 = from_polar;
// Basic arithmetic
let sum = z1 + z2;
let product = z1 * z2;
// Advanced operations
let magnitude = z1.magnitude;
let argument = z1.argument;
let conjugate = z1.conjugate;
Complex Vectors
Powerful vector operations for complex numbers, including inner products, norms, and normalization
use ;
// Create complex vectors
let v1 = new;
let v2 = new;
// Vector operations
let sum = v1.clone + v2.clone;
let scaled = v1.clone * 2.0;
// Inner product and norm
let inner_prod = v1.inner_product;
let norm = v1.norm;
// Normalize a vector
let normalized = v1.normalize;
Matrices
Flexible matrix operations supporting both real and complex numbers, with comprehensive linear algebra functionality
use Matrix;
use Complex;
// Create real matrices
let a = new;
let b = new;
// Matrix operations
let sum = a.clone + b.clone;
let scaled = a.clone * 2.0;
// Create complex matrices
let c = new;
// Advanced operations
let identity = identity;
let is_unitary = c.is_unitary;
let conjugate_transpose = c.conjugate_transpose;
// Accessing elements
let element = c.get; // Gets element at row 0, column 0
License
This project is licensed under the MIT License - see the LICENSE file for details.