aboutsummaryrefslogtreecommitdiff
path: root/libmu/src/maths/matrix.rs
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2024-09-20 09:25:19 +0200
committerhachem <im@hachem.wtf>2024-09-20 09:25:19 +0200
commita84b6394209e37620e45155a25b3755b38ba8515 (patch)
tree4839f145111fda4086311d8ff1417f698ca30212 /libmu/src/maths/matrix.rs
parentaffb34897a4761197df78bdccdb2da599ceb537a (diff)
basic quantum gate setup and quantum registers
Diffstat (limited to 'libmu/src/maths/matrix.rs')
-rw-r--r--libmu/src/maths/matrix.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmu/src/maths/matrix.rs b/libmu/src/maths/matrix.rs
index 9932895..388f858 100644
--- a/libmu/src/maths/matrix.rs
+++ b/libmu/src/maths/matrix.rs
@@ -24,6 +24,7 @@ macro_rules! matrix {
}};
}
+#[derive(Clone)]
pub struct Matrix<T: Float> {
pub data: Vec<T>,
pub rows: usize,
@@ -78,7 +79,7 @@ impl<T: Float> Matrix<T> {
for l in 0..other.cols {
let result_row = i * other.rows + k;
let result_col = j * other.cols + l;
- result.set(result_row, result_col, self_val * other.get(k, l))
+ result.set(result_row, result_col, self_val.clone() * other.get(k, l));
}
}
}