circuits-mat
Safe HaskellNone
LanguageGHC2024

Circuit.Mat.Complex

Description

Complex multiplication as a structure-constant contraction in Circuit.Mat.

A complex number is a vector (F 2 -> s): slot 0 is real, slot 1 is imaginary. The product is the contraction of the outer product against the structure-constant tensor of R[x]/(x² + 1).

Synopsis

Documentation

complexSMul :: (Additive s, Multiplicative s, Subtractive s, Eq (F 2), Eq (F 2, F 2), Finite (F 2, F 2)) => (F 2 -> s) -> (F 2 -> s) -> F 2 -> s Source #

Complex multiplication as a Mat contraction.

complexSMul a b k returns component k of the product of the two complex numbers a and b.

structureConst :: (Additive s, Multiplicative s, Subtractive s) => F 2 -> F 2 -> F 2 -> s Source #

Structure-constant tensor for ℂ = R[x]/(x² + 1).

c k i j is the coefficient of a[i] * b[j] in output component k.