Skip to content

Commit fb645b9

Browse files
author
Zhuoyang Ye
committed
[Class] Add Kraus, noise_channel,quantum_errors class.
1 parent f1c3dfe commit fb645b9

File tree

3 files changed

+283
-0
lines changed

3 files changed

+283
-0
lines changed

torchquantum/noise_model/kraus.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
MIT License
3+
4+
Copyright (c) 2020-present TorchQuantum Authors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
"""
24+
25+
import numpy as np
26+
import torch
27+
import torchquantum as tq
28+
29+
30+
class Kraus:
31+
"""
32+
Kraus operator class
33+
34+
Methods:
35+
add(error): Adds a quantum error
36+
37+
"""
38+
def __init__(self):
39+
pass
40+
41+
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
MIT License
3+
4+
Copyright (c) 2020-present TorchQuantum Authors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
"""
24+
25+
import numpy as np
26+
import torch
27+
import torchquantum as tq
28+
29+
30+
class NoiseChannel:
31+
"""
32+
A class for describing quantum channel
33+
34+
Methods:
35+
add(error): Adds a quantum error
36+
37+
"""
38+
def __init__(self):
39+
pass
40+
41+
42+
def add_all_qubit_error(self):
43+
pass
44+
+198
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
"""
2+
MIT License
3+
4+
Copyright (c) 2020-present TorchQuantum Authors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
"""
24+
25+
import numpy as np
26+
import torch
27+
import torchquantum as tq
28+
29+
30+
class QuantumError(object):
31+
"""
32+
A class for describing quantum error
33+
34+
Methods:
35+
36+
37+
"""
38+
def __init__(self,
39+
wires):
40+
pass
41+
42+
43+
44+
class KrausError(QuantumError):
45+
"""
46+
A class for describing quantum error
47+
48+
Methods:
49+
50+
51+
"""
52+
def __init__(self,
53+
wires):
54+
pass
55+
56+
57+
58+
class mixed_unitary_error(QuantumError):
59+
"""
60+
A class for describing quantum error
61+
62+
Methods:
63+
64+
65+
"""
66+
def __init__(self,
67+
wires):
68+
pass
69+
70+
71+
class coherent_unitary_error(QuantumError):
72+
"""
73+
A class for describing quantum error
74+
75+
Methods:
76+
77+
78+
"""
79+
80+
def __init__(self,
81+
wires):
82+
pass
83+
84+
85+
86+
87+
class pauli_error(QuantumError):
88+
"""
89+
A class for describing quantum error
90+
91+
Methods:
92+
93+
94+
"""
95+
96+
def __init__(self,
97+
wires):
98+
pass
99+
100+
101+
102+
class depolarizing_error(QuantumError):
103+
"""
104+
A class for describing quantum error
105+
106+
Methods:
107+
108+
109+
"""
110+
111+
def __init__(self,
112+
wires):
113+
pass
114+
115+
116+
117+
class reset_error(QuantumError):
118+
"""
119+
A class for describing quantum error
120+
121+
Methods:
122+
123+
124+
"""
125+
126+
def __init__(self,
127+
wires):
128+
pass
129+
130+
131+
132+
class thermal_relaxation_error(QuantumError):
133+
"""
134+
A class for describing quantum error
135+
136+
Methods:
137+
138+
139+
"""
140+
141+
def __init__(self,
142+
wires):
143+
pass
144+
145+
146+
147+
class phase_amplitude_damping_error(QuantumError):
148+
"""
149+
A class for describing quantum error
150+
151+
Methods:
152+
153+
154+
"""
155+
156+
def __init__(self,
157+
wires):
158+
pass
159+
160+
161+
class amplitude_damping_error(QuantumError):
162+
"""
163+
A class for describing quantum error
164+
165+
Methods:
166+
167+
168+
"""
169+
170+
def __init__(self,
171+
wires):
172+
pass
173+
174+
175+
176+
class phase_damping_error(QuantumError):
177+
"""
178+
A class for describing quantum error
179+
180+
Methods:
181+
182+
183+
"""
184+
185+
def __init__(self,
186+
wires):
187+
pass
188+
189+
190+
191+
192+
193+
194+
195+
196+
197+
198+

0 commit comments

Comments
 (0)