From ae8abfa8335edf856f423e7a60c5bb830a79d5a7 Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 22 Sep 2024 14:24:27 +0200 Subject: Refactor and implement other gates --- libpsi/src/maths/matrix.rs | 60 ---------------------------------------------- 1 file changed, 60 deletions(-) (limited to 'libpsi/src/maths/matrix.rs') diff --git a/libpsi/src/maths/matrix.rs b/libpsi/src/maths/matrix.rs index 388f858..795b37f 100644 --- a/libpsi/src/maths/matrix.rs +++ b/libpsi/src/maths/matrix.rs @@ -183,63 +183,3 @@ impl fmt::Display for Matrix { Ok(()) } } - -impl ops::Add<&Matrix> for Matrix { - type Output = Option>; - - fn add(self, other: &Matrix) -> Self::Output { - self.add_to(other) - } -} - -impl ops::Sub<&Matrix> for Matrix { - type Output = Option>; - - fn sub(self, other: &Matrix) -> Self::Output { - self.subtract(other) - } -} - -impl ops::Mul for Matrix { - type Output = Matrix; - - fn mul(self, scalar: T) -> Self::Output { - self.scale(scalar) - } -} - -impl ops::Div for Matrix { - type Output = Matrix; - - fn div(self, scalar: T) -> Self::Output { - self.scale(T::one() / scalar) - } -} - -impl ops::AddAssign<&Matrix> for Matrix { - fn add_assign(&mut self, other: &Matrix) { - if let Some(result) = self.add_to(other) { - *self = result; - } - } -} - -impl ops::SubAssign<&Matrix> for Matrix { - fn sub_assign(&mut self, other: &Matrix) { - if let Some(result) = self.subtract(other) { - *self = result; - } - } -} - -impl ops::MulAssign for Matrix { - fn mul_assign(&mut self, scalar: T) { - *self = self.scale(scalar); - } -} - -impl ops::DivAssign for Matrix { - fn div_assign(&mut self, scalar: T) { - *self = self.scale(T::one() / scalar); - } -} -- cgit v1.3