Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
inner_product.cppm File Reference

Pre-Hilbert (inner-product) spaces over ℝ or ℂ. More...

#include <cmath>
#include <concepts>
#include <cstddef>
#include <functional>
import dedekind.algebra;
import dedekind.geometry:linear_map;
Include dependency graph for inner_product.cppm:

Concepts

concept  dedekind::geometry::HasInnerProduct
 Carrier exposing a scalar-valued inner-product form, its exact squared norm abs2, and the (√-induced) norm.
concept  dedekind::geometry::IsInnerProductSemimodule
 A semimodule equipped with an inner-product-like scalar form.
concept  dedekind::geometry::IsInnerProductModule
 A module equipped with an inner-product-like scalar form.
concept  dedekind::geometry::IsInnerProductSpace
 A field-like vector carrier equipped with an inner product morphism.

Functions

template<std::floating_point F, std::size_t N>
constexpr F dedekind::geometry::dot (const Vector< F, N > &u, const Vector< F, N > &v)
template<typename V>
requires requires(const V& v) { dot(v, v); }
constexpr auto dedekind::geometry::abs2 (const V &v)
 The inner-product squared norm abs2(v) = <v, v> — the canonical name for the squared magnitude, and the primitive the HasInnerProduct surface requires.
template<typename V>
requires requires(const V& v) { dot(v, v); }
constexpr auto dedekind::geometry::euclidean_norm_squared (const V &v)
 Squared Euclidean norm: a synonym for abs2, retained for the Euclidean-metric / escape-test consumers (IsEuclideanSpace, compare_euclidean_norm_squared).
template<std::floating_point F, std::size_t N>
constexpr F dedekind::geometry::norm (const Vector< F, N > &v)
 Induced Norm for Real Species.
template<typename F, std::size_t N>
requires dedekind::category::IsField<F, std::plus<F>, std::multiplies<F>>
constexpr F dedekind::geometry::operator* (const Covector< F, N > &phi, const Vector< F, N > &v)

Detailed Description

Pre-Hilbert (inner-product) spaces over ℝ or ℂ.

@partition :inner_product

Note
"The principal aim of mathematical education is to develop certain faculties of the mind, and among these intuition is not the least precious." – Henri Poincare, Science and Method (1908)

Function Documentation

◆ abs2()

template<typename V>
requires requires(const V& v) { dot(v, v); }
auto dedekind::geometry::abs2 ( const V & v)
constexprexport

The inner-product squared norm abs2(v) = <v, v> — the canonical name for the squared magnitude, and the primitive the HasInnerProduct surface requires.

Unlike norm it introduces no square root, so it is exact and is defined even on carriers whose scalar field is not closed under √ (e.g. the coat-hanger ℂ = ℂ(ℚ(√2)), which has abs2 but no norm). Any carrier with a dot is covered generically; Complex<R> supplies its own dot (ℝ²-real Hermitian form) and so rides this definition.

◆ dot()

template<std::floating_point F, std::size_t N>
F dedekind::geometry::dot ( const Vector< F, N > & u,
const Vector< F, N > & v )
constexprexport

inner_product__The_Standard_Dot_Product

◆ operator*()

template<typename F, std::size_t N>
requires dedekind::category::IsField<F, std::plus<F>, std::multiplies<F>>
F dedekind::geometry::operator* ( const Covector< F, N > & phi,
const Vector< F, N > & v )
constexprexport

inner_product__Operator_Surface

Standard linear-algebra notation: a covector applied to a vector contracts the inner index, giving a scalar. Equivalently the dual pairing ⟨φ, v⟩ written multiplicatively.

Covector<F, N> × Vector<F, N> → F

This is the inner-product / contraction face of operator*; the dual outer-product face Vector × Covector → LinearMap lives in :outer_product. Strict-IsField gate on the scalar F: double is not a strict field (rounding-non-associativity) and is rejected at this surface. Rational<long> / strict-field carriers will become admissible once Vector / LinearMap broaden their IsMatrixScalar gate (#535).