| Crates.io | cpx-coords |
| lib.rs | cpx-coords |
| version | 0.1.4 |
| created_at | 2025-04-24 00:52:54.670293+00 |
| updated_at | 2025-05-28 10:07:07.335511+00 |
| description | To power the rust-quantum project, this library provides a robust `Cpx` type, specifically optimized for the intensive complex number multiplications required for quantum gate applications and tensor product operations. It supports various coordinate representations to maximize performance. |
| homepage | |
| repository | https://github.com/enjuichang123/cpx-coords.git |
| max_upload_size | |
| id | 1646465 |
| size | 52,044 |
To power the rust-quantum project, this library provides a robust Cpx type, specifically optimized for the intensive complex number multiplications required for quantum gate applications and tensor product operations. It supports various coordinate representations to maximize performance.
Add the following to your Cargo.toml:
[dependencies]
cpx-coords = "0.1.4"
regularize() method to normalize complex numbers, ensuring consistent representations and handling numerical edge cases.This library uses the following coordinate representations for complex numbers:
Zero {}: Represents the additive identity (0).One {}: Represents the multiplicative identity (1).NegOne {}: Represents the negation of One (-1).J {}: Represents the imaginary unit (j), a square root of -1.NegJ {}: Represents the negation of J (-j).Real { re: f32 or f64 }: Represents a real number (re).Imag { im: f32 or f64 }: Represents a purely imaginary number (im * j).Phase { ph: f32 or f64 }: Represents a complex number with a radius of 1 and a phase angle (ph) in the interval (-π, π].Ccs { re: f32 or f64, im: f32 or f64 }: Represents a complex number in Cartesian coordinates (re + j * im).Ln { re: f32 or f64, im: f32 or f64 }: Represents a complex number in logarithmic form (exp (re + j * im)).PL { rad: f32 or f64, ph: f32 or f64 }: Represents a complex number in polar coordinates (rad * exp(j * ph)).This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you shall be licensed as above, without any additional terms or conditions.