Skip to main content

HilbertState

Struct HilbertState 

Source
pub struct HilbertState<R: RealField> { /* private fields */ }
Expand description

A strong type representing a Quantum State Vector (Ket) |ψ>.

This represents a Minimal Left Ideal of the algebra Cl(10) (or others), acting as the Hilbert Space.

§Invariants

  • The coefficients are Complex<R> for any R: RealField chosen by the caller (f32, f64, Float106, …). The type parameter has no default — call sites must spell the precision explicitly (e.g. HilbertState::<f64>::new(...)).
  • The Metric is fixed at construction time (preventing mixed-algebra operations).

Implementations§

Source§

impl<R: RealField> HilbertState<R>

Source

pub fn new_spin10(data: Vec<Complex<R>>) -> Result<Self, CausalMultiVectorError>

Creates a new Hilbert State for the Grand Unified Algebra (Spin(10)). This enforces the metric Cl(10) (NonEuclidean, 10D).

Source

pub fn new( data: Vec<Complex<R>>, metric: Metric, ) -> Result<Self, CausalMultiVectorError>

Generic constructor for other quantum systems (e.g. Qubits / Cl(2)).

Source

pub fn new_unchecked(data: Vec<Complex<R>>, metric: Metric) -> Self

Source

pub fn from_multivector(mv: CausalMultiVector<Complex<R>>) -> Self

Source

pub fn into_inner(self) -> CausalMultiVector<Complex<R>>

Unwraps the state to access the underlying algebraic object. Useful when you need to perform raw geometric operations.

Source

pub fn as_inner(&self) -> &CausalMultiVector<Complex<R>>

Borrows the underlying algebraic object.

Source

pub fn mv(&self) -> &CausalMultiVector<Complex<R>>

Source§

impl<R: RealField + Default> HilbertState<R>

Source

pub fn to_ket(&self) -> Result<CausalTensor<Complex<R>>, CausalMultiVectorError>

The d-dimensional complex column of this ket in the matrix representation: column KET_COLUMN of to_matrix(), scaled by 1/√D so that the raw column inner product k(φ)ᴴ · k(ψ) equals the metric-correct Dirac product ⟨φ|ψ⟩ on the minimal left ideal (and a Dirac-normalized ket yields a unit-trace ρ = k·kᴴ).

Defined only for even-dimensional metrics, where to_matrix() is a bijection (D² = 2ⁿ) — including Cl(0,10) (D = 32).

§Errors

Returns a DimensionMismatch for an odd-dimensional metric (the expected field carries the next even dimension).

Source

pub fn from_ket( ket: &CausalTensor<Complex<R>>, metric: Metric, ) -> Result<Self, CausalMultiVectorError>

Embeds a d-dimensional complex column as a minimal-left-ideal ket: the column is placed (scaled by √D, the inverse of the Self::to_ket gain) at column KET_COLUMN of a D×D matrix and mapped back via from_matrix, so to_ket(from_ket(v)) == v exactly.

Accepts a ket of shape [D] or [D, 1] with D = 2^(n/2); defined only for even-dimensional metrics.

§Errors

Returns a DimensionMismatch for an odd-dimensional metric, or a DataLengthMismatch if the ket is not a D-vector / D×1 column.

Trait Implementations§

Source§

impl<R: RealField> Add for HilbertState<R>

Source§

type Output = HilbertState<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Clone + RealField> Clone for HilbertState<R>

Source§

fn clone(&self) -> HilbertState<R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug + RealField> Debug for HilbertState<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: RealField> Default for HilbertState<R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<R: RealField + Debug> Display for HilbertState<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: RealField> Mul<Complex<R>> for HilbertState<R>

Source§

type Output = HilbertState<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: PartialEq + RealField> PartialEq for HilbertState<R>

Source§

fn eq(&self, other: &HilbertState<R>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R: PartialEq + RealField> StructuralPartialEq for HilbertState<R>

Source§

impl<R: RealField> TryFrom<&HilbertState<R>> for HopfState<R>

Conversion: Quantum State (Spinor) -> Topological Rotor (Hopf).

Source§

type Error = CausalMultiVectorError

The type returned in the event of a conversion error.
Source§

fn try_from(quantum_state: &HilbertState<R>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<R: RealField> TryFrom<HopfState<R>> for HilbertState<R>

Conversion: Topological Rotor (Hopf) -> Quantum State (Spinor).

Source§

type Error = CausalMultiVectorError

The type returned in the event of a conversion error.
Source§

fn try_from(hopf: HopfState<R>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<R> Freeze for HilbertState<R>

§

impl<R> RefUnwindSafe for HilbertState<R>
where R: RefUnwindSafe,

§

impl<R> Send for HilbertState<R>
where R: Send,

§

impl<R> Sync for HilbertState<R>
where R: Sync,

§

impl<R> Unpin for HilbertState<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for HilbertState<R>

§

impl<R> UnwindSafe for HilbertState<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Satisfies<NoConstraint> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.