QuditSystem

Trait QuditSystem 

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

    // Provided methods
    fn num_qudits(&self) -> usize { ... }
    fn dimension(&self) -> usize { ... }
    fn is_qubit_only(&self) -> bool { ... }
    fn is_qutrit_only(&self) -> bool { ... }
    fn is_qudit_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 finite-dimensional qudits.

This trait assumes that each qudit in the system has a well-defined radix, the number of basis states or dimensions, and these radices are represented collectively by the crate::Radices object. Mixed-radix or heterogeneous quantum systems where different qudits may have differing dimensions are allowed.

Required Methods§

Source

fn radices(&self) -> Radices

Returns the radices of the qudits in the system.

§Returns

A [crate::Radices] instance representing the radices of the qudits.

Provided Methods§

Source

fn num_qudits(&self) -> usize

Returns the number of qudits in the system.

§Returns

A usize representing the number of qudits.

Source

fn dimension(&self) -> usize

Returns the total dimension of the quantum system.

§Returns

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

Source

fn is_qubit_only(&self) -> bool

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

§Returns

true if all qudits are qubits, otherwise false.

Source

fn is_qutrit_only(&self) -> bool

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

§Returns

true if all qudits are qutrits, otherwise false.

Source

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

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

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

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

Source

fn is_homogenous(&self) -> bool

Checks if the system is homogenous, i.e., all qudits 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§

Source§

impl QuditSystem for QuditPermutation

QuditPermutations permute a qudit system.

Source§

impl QuditSystem for Radices

Source§

impl<C: ComplexScalar> QuditSystem for UnitaryMatrix<C>

Source§

impl<R: RealScalar> QuditSystem for Ket<R>