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/vector.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'libmu/src/maths/vector.rs') diff --git a/libmu/src/maths/vector.rs b/libmu/src/maths/vector.rs index c97b415..0c13e4c 100644 --- a/libmu/src/maths/vector.rs +++ b/libmu/src/maths/vector.rs @@ -362,14 +362,13 @@ impl fmt::Display for RowVector { impl fmt::Display for ColumnVector { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!( - f, - "[{}]", - self.0 - .iter() - .map(|x| x.to_string()) - .collect::>() - .join(", ") - ) + write!(f, "[")?; + for (i, x) in self.0.iter().enumerate() { + if i > 0 { + write!(f, ",\n ")?; + } + write!(f, "{}", x)?; + } + write!(f, "]") } } -- cgit v1.3