ppvm-traits 0.1.1

Core traits, the `Config` bundle and the single-qubit Pauli alphabet shared by the ppvm crates.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// SPDX-FileCopyrightText: 2026 The PPVM Authors
// SPDX-License-Identifier: Apache-2.0

/// Trait for computing `trace(self * RHS)`.
///
/// If a type implements `Trace`, a corresponding `TraceBy` implementation
/// is also provided automatically.
pub trait Trace<'a, RHS: 'a> {
    /// Numeric output of the trace.
    type Output;
    /// Compute `tr(self ยท value)`.
    fn trace(&'a self, value: &'a RHS) -> Self::Output;
}