From 2770097e25e7fb5090efe0f85340f0c638f9dd71 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 28 Sep 2024 23:58:13 +0200 Subject: Prep for first CLI visualizer --- libpsi-core/src/core/component.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libpsi-core/src/core/component.rs') diff --git a/libpsi-core/src/core/component.rs b/libpsi-core/src/core/component.rs index 09095ec..be5fbca 100644 --- a/libpsi-core/src/core/component.rs +++ b/libpsi-core/src/core/component.rs @@ -4,7 +4,7 @@ use crate::{complex, ColumnVector, Complex, Matrix, Vector, VectorMatrix}; use core::ops; pub type QuantumBit = ColumnVector>; -pub type QuantumGate = Matrix>; +pub type QuantumGate = (&'static str, Matrix>); #[macro_export] macro_rules! count { @@ -124,7 +124,7 @@ impl QuantumRegister { } pub fn apply(&self, gate: &QuantumGate) -> QuantumBit { - self.state.mul_matrix(gate).unwrap() + self.state.mul_matrix(&gate.1).unwrap() } } -- cgit v1.3