-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
45 lines (35 loc) · 1.81 KB
/
Copy pathmain.py
File metadata and controls
45 lines (35 loc) · 1.81 KB
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
44
45
from simulation_code import problem_1, problem_2, problem_3
# ==================================================================
# Problem 1
# ==================================================================
# Majority Voting
threshold_mv = problem_1.simulate_threshold_mv(n_runs=10**6)
print(f"Estimated threshold (Majority Voting): {threshold_mv}")
# Minimum Weight Perfect Matching
threshold_mwpm = problem_1.simulate_threshold_mwpm(n_runs=10**6)
print(f"Estimated threshold (MWPM): {threshold_mwpm}")
# ==================================================================
# Problem 2
# ==================================================================
# Minimum Weight Perfect Matching for Multiple Ancilla Measurements
threshold_w_ancilla = problem_2.simulate_threshold(n_runs=10**6)
print(f"Estimated threshold (with Ancillas): {threshold_w_ancilla}")
# ==================================================================
# Problem 3
# ==================================================================
# Minimum Weight Perfect Matching for Biased Noise and Constant Weight Graph
threshold_w_bias = problem_3.simulate_threshold_bias(n_runs=10**6)
print(f"Estimated threshold (with biased noise, constant weight): {threshold_w_bias}")
# Minimum Weight Perfect Matching for Biased Noise and Correct Graph
threshold_w_correct_graph = problem_3.simulate_threshold_bias_correct_graph(
n_runs=10**6
)
print(
f"Estimated threshold (with biased noise, correct graph): {threshold_w_correct_graph}"
)
# ==================================================================
# Bonus
# ==================================================================
# Minimum Weight Perfect Matching for no ancilla error
threshold_bonus = problem_3.simulate_threshold_bias_bonus(n_runs=10**6)
print(f"Estimated threshold (no ancilla error): {threshold_bonus}")