Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::linear_algebra::one_hot< T, D > Struct Template Referenceexport

The one-hot / basis vector e_k : j ↦ δ(j,k) = [j=k] (T{1} on its own index k, T{0} elsewhere) — a 1-arg IsArrow, the k-th COLUMN of the identity Identity (the Kronecker δ with one leg fixed; Diagonal 's entry is δ_ij·F). More...

Public Types

using Domain = D
using Codomain = T

Public Member Functions

constexpr T operator() (D j) const

Public Attributes

D k

Detailed Description

template<typename T, typename D = std::size_t>
struct dedekind::linear_algebra::one_hot< T, D >

The one-hot / basis vector e_k : j ↦ δ(j,k) = [j=k] (T{1} on its own index k, T{0} elsewhere) — a 1-arg IsArrow, the k-th COLUMN of the identity Identity (the Kronecker δ with one leg fixed; Diagonal 's entry is δ_ij·F).

The symbolic basis Ket. An inner_product of two one-hots FOLDS to δ(m,n) = [m=n] (only the k=m=n term survives), but δ is that value without the fold — the equality is the whole content. So e_k is the shared Form behind the one-hot vector, the orthonormal ⟨·|·⟩ ( \(\langle e_m|e_n\rangle = \delta_{mn}\), an equality, no sum), and the identity matrix ( \(I=\sum_k |e_k\rangle\langle e_k|\)); on the predicate side it is the diagonal relation Δ (graph of the identity). Returns T{1} / T{0} — the unit / zero of a ring or field codomain (where they coincide with the ⊗ / ⊕ identities); a sibling of identity_rule (i↦1) and zero_rule (i↦0).

Note
NOT the units of a general rig whose identities differ from 1/0 (e.g. the tropical dioid, ⊕-id = −∞); such a carrier would take unit<T>(Mult{}) / unit<T>(Add{}) instead — not needed at the ℂ use sites here.

The documentation for this struct was generated from the following file: