aboutsummaryrefslogtreecommitdiff
path: root/examples/simple_gates
diff options
context:
space:
mode:
Diffstat (limited to 'examples/simple_gates')
-rw-r--r--examples/simple_gates/Cargo.toml8
-rw-r--r--examples/simple_gates/src/main.rs10
2 files changed, 18 insertions, 0 deletions
diff --git a/examples/simple_gates/Cargo.toml b/examples/simple_gates/Cargo.toml
new file mode 100644
index 0000000..503d31c
--- /dev/null
+++ b/examples/simple_gates/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "simple_gates"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
+libpsi-core = { path = "../../libpsi-core" }
+libpsi-visualizer = { path = "../../libpsi-visualizer" } \ No newline at end of file
diff --git a/examples/simple_gates/src/main.rs b/examples/simple_gates/src/main.rs
new file mode 100644
index 0000000..5c529a6
--- /dev/null
+++ b/examples/simple_gates/src/main.rs
@@ -0,0 +1,10 @@
+use libpsi_core::*;
+
+fn main() {
+ let mut circuit = QuantumCircuit::new(2, 2);
+ circuit.apply(&gates::HADAMARD, &[], &[0]);
+ circuit.apply(&gates::CNOT, &[0], &[1]);
+
+ let runtime = BasicRT::new(&circuit);
+ runtime.execute(1024);
+}