diff options
| author | hachem <im@hachem.wtf> | 2024-09-28 23:58:13 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2024-09-28 23:58:13 +0200 |
| commit | 2770097e25e7fb5090efe0f85340f0c638f9dd71 (patch) | |
| tree | 591323ea709e14c0b6d8e5d0c396d51b59db5659 /libpsi-core/src/core/component.rs | |
| parent | ce0a2aa7fe9fe3a6b638c39078c8b77ac912b860 (diff) | |
Prep for first CLI visualizer
Diffstat (limited to 'libpsi-core/src/core/component.rs')
| -rw-r--r-- | libpsi-core/src/core/component.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Complex<f64>>; -pub type QuantumGate = Matrix<Complex<f64>>; +pub type QuantumGate = (&'static str, Matrix<Complex<f64>>); #[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() } } |
