Skip to main content

Field

Trait Field 

Source
pub trait Field:
    DivRing
    + Copy
    + PartialEq
    + Debug {
    type Fixed: CField<Fixed = Self::Fixed>;
    type Characteristic: Nat;

Show 18 methods // Required methods fn conj(&self) -> Self; fn to_fixed(self) -> Self::Fixed; fn from_fixed(x: Self::Fixed) -> Self; // Provided methods fn powi(&self, s: usize) -> Self { ... } fn from_nat(n: usize) -> Self { ... } fn norm_squared(self) -> Self::Fixed { ... } fn check_conj_additive(a: Self, b: Self) -> bool { ... } fn check_conj_multiplicative(a: Self, b: Self) -> bool { ... } fn check_conj_unit() -> bool { ... } fn check_conj_involution(a: Self) -> bool { ... } fn check_from_fixed_additive(x: Self::Fixed, y: Self::Fixed) -> bool { ... } fn check_from_fixed_multiplicative(x: Self::Fixed, y: Self::Fixed) -> bool { ... } fn check_descent(x: Self) -> bool { ... } fn check_norm_squared_self_adjoint(x: Self) -> bool { ... } fn check_from_fixed_is_fixed(x: Self::Fixed) -> bool { ... } fn check_fixed_field_is_central(x: Self::Fixed, y: Self) -> bool { ... } fn check_from_fixed_unit() -> bool { ... } fn check_characteristic_up_to(bound: usize) -> bool { ... }
}
Expand description

A field.

A division ring equipped with the scalar structure used by the library: an elected central involution, fixed field, characteristic, etc.

“Field” here includes skew/noncommutative fields.

Required Associated Types§

Source

type Fixed: CField<Fixed = Self::Fixed>

A distinguished central subfield fixed pointwise by Self::conj.

Its embedding through Self::from_fixed must preserve the field operations, commute with every element of Self, and satisfy Self::from_fixed(r).conj() == Self::from_fixed(r).

Source

type Characteristic: Nat

The field’s characteristic, as a type-level Nat. NatZero means characteristic zero (ℚ embeds). Callers that need 1/k — the matrix exponential, from_nat — bound on Characteristic = NatZero so that finite-characteristic fields are rejected at compile time rather than dividing by a zero that only appears at runtime.

Required Methods§

Source

fn conj(&self) -> Self

The conjugation operation.

Source

fn to_fixed(self) -> Self::Fixed

Source

fn from_fixed(x: Self::Fixed) -> Self

Provided Methods§

Source

fn powi(&self, s: usize) -> Self

Source

fn from_nat(n: usize) -> Self

Source

fn norm_squared(self) -> Self::Fixed

Source

fn check_conj_additive(a: Self, b: Self) -> bool

Source

fn check_conj_multiplicative(a: Self, b: Self) -> bool

Source

fn check_conj_unit() -> bool

Source

fn check_conj_involution(a: Self) -> bool

Source

fn check_from_fixed_additive(x: Self::Fixed, y: Self::Fixed) -> bool

Source

fn check_from_fixed_multiplicative(x: Self::Fixed, y: Self::Fixed) -> bool

Source

fn check_descent(x: Self) -> bool

Source

fn check_norm_squared_self_adjoint(x: Self) -> bool

Source

fn check_from_fixed_is_fixed(x: Self::Fixed) -> bool

Source

fn check_fixed_field_is_central(x: Self::Fixed, y: Self) -> bool

Source

fn check_from_fixed_unit() -> bool

Checks that Self::from_fixed preserves the multiplicative identity whenever Self::Fixed is nondegenerate.

A field of characteristic one has zero() == one(), so its unique map into a nondegenerate field cannot preserve both identities: preservation of zero forces its sole element to map to Self::zero(). Such a degenerate fixed field is intentionally permitted, so the unit law is waived in that case.

For every nondegenerate fixed field, preserving the unit ensures that from_fixed is nonzero and hence, together with its homomorphism laws, injective.

Source

fn check_characteristic_up_to(bound: usize) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§