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§
Provided Methods§
Sourcefn num_qudits(&self) -> usize
fn num_qudits(&self) -> usize
Sourcefn dimension(&self) -> usize
fn dimension(&self) -> usize
Returns the total dimension of the quantum system.
§Returns
A usize representing the product of the radices of all qudits.
Sourcefn is_qubit_only(&self) -> bool
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.
Sourcefn is_qutrit_only(&self) -> bool
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.
Sourcefn is_qudit_only<T: Into<Radix>>(&self, radix: T) -> bool
fn is_qudit_only<T: Into<Radix>>(&self, radix: T) -> bool
Sourcefn is_homogenous(&self) -> bool
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§
impl QuditSystem for QuditPermutation
QuditPermutations permute a qudit system.