ClassicalSystem

Trait ClassicalSystem 

Source
pub trait ClassicalSystem {
    // Required method
    fn radices(&self) -> Radices;

    // Provided methods
    fn num_dits(&self) -> usize { ... }
    fn dimension(&self) -> usize { ... }
    fn is_bit_only(&self) -> bool { ... }
    fn is_trit_only(&self) -> bool { ... }
    fn is_dit_only<T: Into<Radix>>(&self, radix: T) -> bool { ... }
    fn is_homogenous(&self) -> bool { ... }
}
Expand description

A data structure consisting of or operating on a specified number of dits.

Required Methods§

Source

fn radices(&self) -> Radices

Returns the radices of the dits in the system.

§Returns

A [Radices] instance representing the radices of the dits.

Provided Methods§

Source

fn num_dits(&self) -> usize

Returns the number of classical bits in the system.

§Returns

A usize representing the number of classical bits.

Source

fn dimension(&self) -> usize

Returns the total dimension of the classical system.

§Returns

A usize representing the product of the radices of all dits.

Source

fn is_bit_only(&self) -> bool

Checks if the system consists only of bits (2-level systems).

§Returns

true if all dits are bits, otherwise false.

Source

fn is_trit_only(&self) -> bool

Checks if the system consists only of trits (3-level systems).

§Returns

true if all dits are trits, otherwise false.

Source

fn is_dit_only<T: Into<Radix>>(&self, radix: T) -> bool

Checks if the system consists only of dits with a specified radix.

§Parameters
  • radix: The radix to check against all dits in the system.
§Returns

true if all dits have the specified radix, otherwise false.

Source

fn is_homogenous(&self) -> bool

Checks if the system is homogenous, i.e., all dits have the same radix.

§Returns

true if the system is homogenous, otherwise false.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§