aboutsummaryrefslogtreecommitdiff
path: root/libpsi/src/maths/matrix.rs
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2024-09-22 14:24:27 +0200
committerhachem <im@hachem.wtf>2024-09-22 14:24:27 +0200
commitae8abfa8335edf856f423e7a60c5bb830a79d5a7 (patch)
tree621e34eef728b971428c20e7bf946289c7dedc67 /libpsi/src/maths/matrix.rs
parent1a9ef4a7f0cbd4ed848ccf0903ebbbd4fdab6adf (diff)
Refactor and implement other gates
Diffstat (limited to 'libpsi/src/maths/matrix.rs')
-rw-r--r--libpsi/src/maths/matrix.rs60
1 files changed, 0 insertions, 60 deletions
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<T: Float + fmt::Display> fmt::Display for Matrix<T> {
Ok(())
}
}
-
-impl<T: Float> ops::Add<&Matrix<T>> for Matrix<T> {
- type Output = Option<Matrix<T>>;
-
- fn add(self, other: &Matrix<T>) -> Self::Output {
- self.add_to(other)
- }
-}
-
-impl<T: Float> ops::Sub<&Matrix<T>> for Matrix<T> {
- type Output = Option<Matrix<T>>;
-
- fn sub(self, other: &Matrix<T>) -> Self::Output {
- self.subtract(other)
- }
-}
-
-impl<T: Float> ops::Mul<T> for Matrix<T> {
- type Output = Matrix<T>;
-
- fn mul(self, scalar: T) -> Self::Output {
- self.scale(scalar)
- }
-}
-
-impl<T: Float> ops::Div<T> for Matrix<T> {
- type Output = Matrix<T>;
-
- fn div(self, scalar: T) -> Self::Output {
- self.scale(T::one() / scalar)
- }
-}
-
-impl<T: Float> ops::AddAssign<&Matrix<T>> for Matrix<T> {
- fn add_assign(&mut self, other: &Matrix<T>) {
- if let Some(result) = self.add_to(other) {
- *self = result;
- }
- }
-}
-
-impl<T: Float> ops::SubAssign<&Matrix<T>> for Matrix<T> {
- fn sub_assign(&mut self, other: &Matrix<T>) {
- if let Some(result) = self.subtract(other) {
- *self = result;
- }
- }
-}
-
-impl<T: Float> ops::MulAssign<T> for Matrix<T> {
- fn mul_assign(&mut self, scalar: T) {
- *self = self.scale(scalar);
- }
-}
-
-impl<T: Float> ops::DivAssign<T> for Matrix<T> {
- fn div_assign(&mut self, scalar: T) {
- *self = self.scale(T::one() / scalar);
- }
-}