-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatecount.hs
43 lines (38 loc) · 1.51 KB
/
gatecount.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- Generate upper bounds used in the paper
import Data.List
import Quipper
import MQGrover
import Grover
main = do
putStrLn "-----------------------------------------------------------"
putStrLn "First oracle"
putStrLn "-----------------------------------------------------------"
print_simple GateCount $ grover (oracle1 sqe) n 1
putStrLn ""
putStrLn ""
putStrLn ""
putStrLn ""
putStrLn "-----------------------------------------------------------"
putStrLn "Second oracle"
putStrLn "-----------------------------------------------------------"
print_simple GateCount $ grover (oracle2 sqe) n 1
where
n = 81
m = 85
sqe = replicate m $ reverse $ tail $ inits $ replicate n True
-- print_generic Preview (oracle1
-- [[[True, True, False],
-- [False, True],
-- [False]],
-- [[False, False, False],
-- [True, True],
-- [False]]]
-- ) [qubit, qubit, qubit]
-- print_generic Preview (oracle2
-- [[[True, True, False],
-- [False, True],
-- [False]],
-- [[False, False, False],
-- [True, True],
-- [False]]]
-- ) [qubit, qubit, qubit]