25
25
import numpy as np
26
26
import torch
27
27
import torchquantum as tq
28
+ from __future__ import annotations
28
29
29
30
30
31
class QuantumError (object ):
31
32
"""
32
33
A class for describing quantum error
33
34
34
- Methods:
35
+ """
35
36
37
+ def __init__ (self ):
38
+ pass
36
39
37
- """
38
- def __init__ (self ,
39
- wires ):
40
+ def compose (self , other : QuantumError ) -> QuantumError :
40
41
pass
41
42
43
+ def tensor (self , other : QuantumError ) -> QuantumError :
44
+ pass
42
45
46
+ def expand (self , other : QuantumError ) -> QuantumError :
47
+ pass
43
48
44
- class KrausError (QuantumError ):
45
- """
46
- A class for describing quantum error
47
49
48
- Methods:
50
+ class krausError (QuantumError ):
51
+ """
52
+ A general CPTP quantum error given a list of kraus matrices
49
53
54
+ Params:
50
55
51
56
"""
57
+
52
58
def __init__ (self ,
53
59
wires ):
54
60
pass
55
61
56
62
57
-
58
63
class mixed_unitary_error (QuantumError ):
59
64
"""
60
- A class for describing quantum error
61
-
62
- Methods:
65
+ An n-qubit mixed unitary error
63
66
67
+ Params:
64
68
65
69
"""
70
+
66
71
def __init__ (self ,
67
72
wires ):
68
73
pass
69
74
70
75
71
76
class coherent_unitary_error (QuantumError ):
72
77
"""
73
- A class for describing quantum error
74
-
75
- Methods:
76
-
78
+ An n qubit coheren error given a a single unitary
77
79
80
+ Params:
78
81
"""
79
82
80
83
def __init__ (self ,
81
84
wires ):
82
85
pass
83
86
84
87
85
-
86
-
87
88
class pauli_error (QuantumError ):
88
89
"""
89
- A class for describing quantum error
90
+ An n qubit pauli error channel
91
+ Initialized from a list of paulis and probability.
90
92
91
- Methods :
93
+ Params :
92
94
95
+ [(P0,p0),(P1,p1),...]
93
96
94
97
"""
95
98
96
99
def __init__ (self ,
97
- wires ):
100
+ oplist ):
98
101
pass
99
102
100
103
101
-
102
104
class depolarizing_error (QuantumError ):
103
105
"""
104
- A class for describing quantum error
106
+ An n qubit depolarizing error channel
105
107
106
- Methods :
108
+ Params :
107
109
110
+ Depolarization probability p
108
111
109
112
"""
110
113
111
114
def __init__ (self ,
112
- wires ):
115
+ p ):
113
116
pass
114
117
115
118
116
-
117
119
class reset_error (QuantumError ):
118
120
"""
119
- A class for describing quantum error
120
-
121
- Methods:
121
+ A single qubit reset error
122
122
123
+ Params:
124
+ p0: Resetting of |0> state
125
+ p1: Resetting of |1> state
123
126
124
127
"""
125
128
126
129
def __init__ (self ,
127
- wires ):
130
+ p0 ,
131
+ p1 ):
128
132
pass
129
133
130
134
131
-
132
135
class thermal_relaxation_error (QuantumError ):
133
136
"""
134
- A class for describing quantum error
135
-
136
- Methods:
137
-
138
-
137
+ A single qubit thermal relaxation channel.
138
+ The relaxation process is determined by T1 and T2, gate time t,
139
+ and excited state thermal population p1
140
+ Params:
141
+ T1: Depolarization time
142
+ T2: Dephasing time
143
+ t: gate time
144
+ p1: excited state thermal population p1
139
145
"""
140
146
141
147
def __init__ (self ,
142
- wires ):
148
+ T1 ,
149
+ T2 ,
150
+ t ,
151
+ p1 ):
143
152
pass
144
153
145
154
146
-
147
155
class phase_amplitude_damping_error (QuantumError ):
148
156
"""
149
- A class for describing quantum error
157
+ A single qubit generalized combined phase and
158
+ amplitude damping.
150
159
151
- Methods :
160
+ Params :
152
161
162
+ lambda: Amplitude damping parameter
163
+ gamma: Phase damping parameter
164
+ p1: excited state thermal population p1
153
165
154
166
"""
155
167
@@ -160,10 +172,12 @@ def __init__(self,
160
172
161
173
class amplitude_damping_error (QuantumError ):
162
174
"""
163
- A class for describing quantum error
175
+ A class for describing amplitude damping
164
176
165
- Methods :
177
+ Params :
166
178
179
+ lambda: Amplitude damping parameter
180
+ p1: excited state thermal population p1
167
181
168
182
"""
169
183
@@ -172,27 +186,17 @@ def __init__(self,
172
186
pass
173
187
174
188
175
-
176
189
class phase_damping_error (QuantumError ):
177
190
"""
178
191
A class for describing quantum error
179
192
180
- Methods :
193
+ Params :
181
194
195
+ gamma: Phase damping parameter
196
+ p1: excited state thermal population p1
182
197
183
198
"""
184
199
185
200
def __init__ (self ,
186
201
wires ):
187
202
pass
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
-
198
-
0 commit comments