summaryrefslogtreecommitdiff
path: root/src/simulation/hamiltonians.rs
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2019-12-13 14:40:15 +0100
committerDennis Kobert <dennis@kobert.dev>2019-12-13 14:40:15 +0100
commit53f66593bd91cd54a3cc59124ef8db3f27c6b802 (patch)
treee5ef73b45eccb5647218dd02410e3da2a34b5b83 /src/simulation/hamiltonians.rs
parentfc7daf3cb0ab42733a52ce9993570909ed059574 (diff)
Add hamilton function
Diffstat (limited to 'src/simulation/hamiltonians.rs')
-rw-r--r--src/simulation/hamiltonians.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/simulation/hamiltonians.rs b/src/simulation/hamiltonians.rs
new file mode 100644
index 0000000..03d8d1f
--- /dev/null
+++ b/src/simulation/hamiltonians.rs
@@ -0,0 +1,31 @@
+use super::c64;
+use ndarray::prelude::*;
+
+pub fn X0() -> Array2<c64> {
+ array![
+ [
+ c64::new(1.0, 0.0),
+ c64::new(0.0, 0.0),
+ c64::new(0.0, 0.0),
+ c64::new(0.0, 0.0),
+ ],
+ [
+ c64::new(0.0, 0.0),
+ c64::new(1.0, 0.0),
+ c64::new(0.0, 0.0),
+ c64::new(0.0, 0.0),
+ ],
+ [
+ c64::new(0.0, 0.0),
+ c64::new(0.0, 0.0),
+ c64::new(-1.0, 0.0),
+ c64::new(0.0, 0.0),
+ ],
+ [
+ c64::new(0.0, 0.0),
+ c64::new(0.0, 0.0),
+ c64::new(0.0, 0.0),
+ c64::new(-1.0, 0.0),
+ ]
+ ]
+}