Trigonometric polynomials #
A trigonometric polynomial in k real variables is a finite ℂ-linear combination of the
characters x ↦ exp (i ⟨ω, x⟩), where the frequency vectors ω range over a finite set.
These are exactly the trigonometric polynomials, and they are closed under addition,
scaling, multiplication by a single character, products, and complex conjugation — the
algebraic facts that drive the Fourier representation of the quantum kernel.
This module is quantum-free: it only knows about ℂ, finite sums, the real pairing
⟨ω, x⟩ = ∑ i, ω i * x i, and real one-variable trigonometric identities.
An trigonometric polynomial in k real variables: the function
x ↦ ∑_{ω ∈ freqs} coeff ω · exp(i⟨ω, x⟩). The data is a finite set of
frequency vectors together with a complex coefficient at each.
The finite set of frequency vectors carrying nonzero (or bookkept) coefficients.
The complex coefficient at each frequency.
Instances For
Evaluate an trigonometric polynomial at a data point x.
Equations
- f.eval x = ∑ ω ∈ f.freqs, f.coeff ω * Complex.exp (Complex.I * ↑(QuantumAlg.freqDot ω x))
Instances For
The zero trigonometric polynomial (empty frequency set).
Instances For
Scale an trigonometric polynomial by a complex constant.
Equations
Instances For
Sum of two trigonometric polynomials: union of frequencies, with guarded coefficients added.
Equations
Instances For
Multiply an trigonometric polynomial by the character e^{i⟨a,x⟩}: shifts every frequency
by a and leaves the coefficients (re-indexed) unchanged.
Equations
Instances For
A finite sum of trigonometric polynomials: frequencies union over the index, with coefficients added.
Equations
Instances For
Product of two trigonometric polynomials: realised as the sum, over f's frequencies, of g
shifted by that frequency and scaled by f's coefficient.
Equations
- f.mul g = QuantumAlg.TrigPolynomial.sum f.freqs fun (ω : Fin k → ℝ) => QuantumAlg.TrigPolynomial.smul (f.coeff ω) (QuantumAlg.TrigPolynomial.expMul ω g)
Instances For
Complex conjugate of an trigonometric polynomial: negate frequencies, conjugate coefficients.
Equations
Instances For
The canonical coefficient of an trigonometric polynomial at a frequency: its (guarded)
contribution. Two trigonometric polynomials with the same values have the same canonical
coefficients (coeffAt_eq_of_eval_eq).
Instances For
If t ↦ exp(i t a) and t ↦ exp(i t b) agree for all real t, then a = b.
The character x ↦ exp(i⟨ω,x⟩) as a monoid homomorphism from the additive group of
data points (written multiplicatively) to ℂ.
Equations
- QuantumAlg.chiHom ω = { toFun := fun (y : Multiplicative (Fin k → ℝ)) => Complex.exp (Complex.I * ↑(QuantumAlg.freqDot ω (Multiplicative.toAdd y))), map_one' := ⋯, map_mul' := ⋯ }
Instances For
Distinct frequencies give distinct characters.
Uniqueness of trigonometric-polynomial coefficients. A vanishing finite combination of the distinct characters has all coefficients zero (Dedekind's independence of characters).
The canonical coefficient of a conjugated trigonometric polynomial negates the frequency and conjugates.
Frequency-set characterizations (for tracking which frequencies appear) #
Embedding into more variables (for products of sums in disjoint variable blocks) #
Embed an m-variable trigonometric polynomial into m + n variables on the first block.
Equations
- f.embedL = { freqs := Finset.image (fun (ω : Fin m → ℝ) => Fin.append ω 0) f.freqs, coeff := fun (σ : Fin (m + n) → ℝ) => f.coeff fun (i : Fin m) => σ (Fin.castAdd n i) }
Instances For
Embed an n-variable trigonometric polynomial into m + n variables on the second block.
Equations
- f.embedR = { freqs := Finset.image (fun (ω : Fin n → ℝ) => Fin.append 0 ω) f.freqs, coeff := fun (σ : Fin (m + n) → ℝ) => f.coeff fun (i : Fin n) => σ (Fin.natAdd m i) }
Instances For
One-variable parameter-shift identity #
Parameter-shift identity. The derivative of a + b cos θ + c sin θ
equals the symmetric π/2-shifted finite difference (C(θ+π/2) - C(θ-π/2))/2.