1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
use num_complex::ComplexFloat;
use crate::{matrix_init, Matrix};
pub trait Herm: Matrix
where
Self::Output: Matrix
{
type Output;
fn herm(&self) -> Self::Output;
}
impl<F: ComplexFloat, const L: usize, const H: usize> Herm for [[F; L]; H]
where
Self: Matrix,
[[F; H]; L]: Matrix
{
type Output = [[F; H]; L];
fn herm(&self) -> Self::Output
{
matrix_init(|r, c| self[c][r].conj())
}
}