1
- function simulate_QuantumClifford (L,n= 10 ;shots= 10 ,depth= 10 )
1
+ function simulate_QuantumClifford (L,n= 10 ;shots= 10 ,depth= 10 ,type = :Kitaev )
2
2
g = HoneycombGeometry (Periodic, L, L)
3
- ps = generateProbs (;n)
4
- backend = QuantumClifford . TableauSimulator ( nQubits (g); mixed = true )
3
+ ps = generateProbs (;n, offset = 0.01 )
4
+
5
5
6
6
partitionsX = subsystems (g, 4 ; cutType= :X )
7
7
partitionsY = subsystems (g, 4 ; cutType= :Y )
8
8
partitionsZ = subsystems (g, 4 ; cutType= :Z )
9
9
10
10
tmi = zeros (Float64, length (ps))
11
- for (i, (px,py,pz)) in enumerate (ps)
11
+ Threads. @threads for i in eachindex (ps)
12
+ px,py,pz = ps[i]
13
+ backend = QuantumClifford. TableauSimulator (nQubits (g); mixed= true )
12
14
post = (s) -> begin
13
15
tmi[i] += QuantumClifford. tmi (backend. state, partitionsX)
14
16
tmi[i] += QuantumClifford. tmi (backend. state, partitionsY)
15
17
tmi[i] += QuantumClifford. tmi (backend. state, partitionsZ)
16
18
end
17
- execute! (()-> measurementOnlyKitaev! (backend, g, px,py,pz; depth), backend, post; shots= shots)
19
+ if type == :Kitaev
20
+ execute! (()-> measurementOnlyKitaev! (backend, g, px,py,pz; depth), backend, post; shots= shots)
21
+ elseif type == :Kekule
22
+ execute! (()-> measurementOnlyKekule! (backend, g, px,py,pz; depth), backend, post; shots= shots)
23
+ else
24
+ throw (ArgumentError (" Unsupported type $type . Choose one of :Kitaev, :Kekule" ))
25
+ end
18
26
end
19
27
return tmi ./= 3 shots
20
28
end
21
29
22
- function generateProbs (; n= 45 )
30
+ function generateProbs (; n= 45 ,offset = 0.0 )
23
31
points = Vector {NTuple{3,Float64}} (undef, n* (n + 1 ) ÷ 2 )
24
32
m = 1
25
33
for (k, i) in enumerate (range (0 , 1 , n))
@@ -32,5 +40,5 @@ function generateProbs(; n=45)
32
40
end
33
41
end
34
42
35
- return points
43
+ return [p .- offset .* (p .- ( 1 / 3 , 1 / 3 , 1 / 3 )) for p in points]
36
44
end
0 commit comments