From affb34897a4761197df78bdccdb2da599ceb537a Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 17 Sep 2024 17:03:26 +0200 Subject: Prepare for quantum stuff --- libmu/src/core/bit.rs | 10 ++++++++++ libmu/src/core/gate.rs | 3 +++ libmu/src/core/mod.rs | 2 ++ libmu/src/lib.rs | 4 ++++ 4 files changed, 19 insertions(+) create mode 100644 libmu/src/core/bit.rs create mode 100644 libmu/src/core/gate.rs create mode 100644 libmu/src/core/mod.rs (limited to 'libmu') diff --git a/libmu/src/core/bit.rs b/libmu/src/core/bit.rs new file mode 100644 index 0000000..a5bce51 --- /dev/null +++ b/libmu/src/core/bit.rs @@ -0,0 +1,10 @@ +use crate::{ColumnVector, Complex, QuantumGate}; + +pub type QuantumBit = ColumnVector>; +pub type ClassicalBit = bool; + +impl QuantumBit { + pub fn apply_gate(&mut self, _gate: &QuantumGate) { + todo!(); + } +} diff --git a/libmu/src/core/gate.rs b/libmu/src/core/gate.rs new file mode 100644 index 0000000..b2e18c0 --- /dev/null +++ b/libmu/src/core/gate.rs @@ -0,0 +1,3 @@ +use crate::{Complex, Matrix}; + +pub type QuantumGate = Matrix>; diff --git a/libmu/src/core/mod.rs b/libmu/src/core/mod.rs new file mode 100644 index 0000000..63ee71b --- /dev/null +++ b/libmu/src/core/mod.rs @@ -0,0 +1,2 @@ +pub mod bit; +pub mod gate; diff --git a/libmu/src/lib.rs b/libmu/src/lib.rs index 00ac5b6..ad64816 100644 --- a/libmu/src/lib.rs +++ b/libmu/src/lib.rs @@ -1,6 +1,10 @@ +mod core; mod maths; pub use maths::complex::*; pub use maths::matrix::*; pub use maths::numeric_types::*; pub use maths::vector::*; + +pub use core::gate::*; +pub use core::bit::*; -- cgit v1.3