-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_surface_code.py
More file actions
89 lines (81 loc) · 2.84 KB
/
test_surface_code.py
File metadata and controls
89 lines (81 loc) · 2.84 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import qsharp
import pytest
def test_2() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_AllZero()")
assert correct
def test_3() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_AllOne()")
assert correct
def test_4() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_OneOneOne()")
assert correct
def test_5() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_TwoOnes()")
assert correct
def test_6() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_OneOneZero()")
assert correct
def test_7() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_OnlyMiddleOne()")
assert correct
def test_8() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_EmptyGrid()")
assert correct
def test_9() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.TestMeasureLogicalZ_Superposition()")
assert correct
def test_10() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_MeasureLogicalZTopDown_AllFourFlipped()")
assert correct
def test_11() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_MeasureLogicalZTopDown_AllFiveFlipped()")
assert correct
def test_12() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_MeasureLogicalZTopDown_SingleQubitGrid()")
assert correct
def test_12() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_MeasureLogicalZTopDown_LargeGrid_ZeroParity()")
assert correct
def test_13() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_MeasureLogicalZTopDown_ThreeFlipped_OddParity()")
assert correct
def test_14() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_MeasureLogicalZTopDown_IgnoreNonColumnQubits()")
assert correct
def test_15() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_ZStabilizerApplyLater()")
assert correct
def test_16() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_ZStabilizer_ShouldNotActivate()")
assert correct
def test_17() -> None:
qsharp.init(project_root=".")
correct = qsharp.eval("Test.Test_ZStabilizerShouldResetAncillaBeforeUse()")
assert correct
@pytest.mark.parametrize("functionName", [
"Test_XStabilizer_EvenParity",
"Test_XStabilizer_OddParity",
"Test_XStabilizer_SingleQubit",
"Test_XStabilizer_ZeroParity"
])
def test_runner(functionName):
print(functionName)
qsharp.init(project_root=".")
correct = qsharp.eval(f"Test.{functionName}()")
assert correct