From a84b6394209e37620e45155a25b3755b38ba8515 Mon Sep 17 00:00:00 2001 From: hachem Date: Fri, 20 Sep 2024 09:25:19 +0200 Subject: basic quantum gate setup and quantum registers --- libmu/src/maths/matrix.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libmu/src/maths/matrix.rs') 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 { pub data: Vec, pub rows: usize, @@ -78,7 +79,7 @@ impl Matrix { 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)); } } } -- cgit v1.3