aboutsummaryrefslogtreecommitdiff
path: root/tester/src
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2024-10-13 15:13:17 +0200
committerhachem <im@hachem.wtf>2024-10-13 15:13:17 +0200
commit7cc3c78a24b51a58d44e1baff20b86292662390e (patch)
treeea7bcb1c6493287abc75f4df55458ed8f4abc1e5 /tester/src
parent00c4b7c44b1364381c65dccbb190d64b3ff4c1e8 (diff)
Mass refactor
Diffstat (limited to 'tester/src')
-rw-r--r--tester/src/main.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tester/src/main.rs b/tester/src/main.rs
new file mode 100644
index 0000000..3840c23
--- /dev/null
+++ b/tester/src/main.rs
@@ -0,0 +1,15 @@
+use libpsi_core::*;
+use libpsi_visualizer::*;
+
+fn main() {
+ let mut circuit = QuantumCircuit::new(2, 2);
+ circuit.execute(Instruction::ApplyGate(&gates::HADAMARD, &[], 0));
+ circuit.execute(Instruction::ApplyGate(&gates::CNOT, &[0], 1));
+ circuit.execute(Instruction::ApplyGate(&gates::HADAMARD, &[], 0));
+
+ circuit.execute(Instruction::Measure(0));
+ circuit.execute(Instruction::Measure(1));
+
+ HorizontalCLIVisualizer::new(&circuit).render();
+ BasicRT::new(&circuit).execute(1024);
+}