Permalink
Browse files

Kite qchackers init

  • Loading branch information...
vtomole committed Sep 4, 2018
1 parent 5c496cb commit 41c62c32af60f00b355bb076f726f40ca643a60a
Showing with 82 additions and 0 deletions.
  1. +5 −0 kite/epr.eg
  2. +69 −0 kite/quantum_programs.py
  3. +8 −0 kite/run_file.py
View
@@ -0,0 +1,5 @@
QUBITS 2
H 0
CNOT 0 1
MEASURE 0
MEASURE 1
View
@@ -0,0 +1,69 @@
from eagle import api
from eagle.api import *
x_prog = api.Program(
QREG(2),
X(0),
MEASURE(0))
deutch_balance = api.Program(
QREG(2),
X(1),
H(0),
H(1),
H(0),
H(1),
MEASURE(0),
)
deutch_balance.eval()
deutch_constant = api.Program(
QREG(2),
X(1),
H(0),
H(1),
# oracle
CNOT(0, 1),
H(0),
H(1),
MEASURE(0)
)
deutch_constant.eval()
deutch_constant = api.Program(
QREG(2),
X(1),
H(0),
H(1),
# oracle
X(1),
H(0),
H(1),
MEASURE(0)
)
deutch_constant.eval()
deutch_balanced = api.Program(
QREG(2),
X(1),
H(0),
H(1),
# oracle
CNOT(0, 1),
X(1),
H(0),
H(1),
MEASURE(0)
)
deutch_balanced.eval()
View
@@ -0,0 +1,8 @@
from kite import vm
import sys
if len(sys.argv) == 2:
a, b = vm.evaluate(sys.argv[1], "file")
print(b)
else:
raise Exception("Add a file to run")

0 comments on commit 41c62c3

Please sign in to comment.