13
13
# limitations under the License.
14
14
15
15
from typing import TYPE_CHECKING , Any , Dict , Tuple , Type , Union
16
- import warnings
17
16
import numpy as np
18
17
19
18
from cirq import ops , protocols , value
@@ -47,9 +46,6 @@ def qubits(self) -> Tuple['cirq.Qid', ...]:
47
46
def _predicate (self , * args , ** kwargs ):
48
47
return self ._gate_family ._predicate (* args , ** kwargs )
49
48
50
- def swapped (self ):
51
- return OpIdentifier (self .gate_type , * self .qubits [::- 1 ])
52
-
53
49
def is_proper_subtype_of (self , op_id : 'OpIdentifier' ):
54
50
"""Returns true if this is contained within op_id, but not equal to it.
55
51
@@ -175,29 +171,6 @@ def pauli_error_from_t1(t_ns: float, t1_ns: float) -> float:
175
171
return (1 - np .exp (- t_ns / t2 )) / 2 + (1 - np .exp (- t_ns / t1_ns )) / 4
176
172
177
173
178
- def pauli_error_from_depolarization (t_ns : float , t1_ns : float , pauli_error : float = 0 ) -> float :
179
- """Calculates the amount of pauli error from depolarization.
180
-
181
- This computes non-T1 error for a specific duration, `t`. If pauli error
182
- from T1 decay is more than total pauli error, this returns zero; otherwise,
183
- it returns the portion of pauli error not attributable to T1 error.
184
-
185
- Args:
186
- t_ns: The duration of the gate in ns.
187
- t1_ns: The T1 decay constant in ns.
188
- pauli_error: The total pauli error.
189
-
190
- Returns:
191
- Calculated Pauli error resulting from depolarization.
192
- """
193
- t1_pauli_error = pauli_error_from_t1 (t_ns , t1_ns )
194
- if pauli_error >= t1_pauli_error :
195
- return pauli_error - t1_pauli_error
196
-
197
- warnings .warn ("Pauli error from T1 decay is greater than total Pauli error" , RuntimeWarning )
198
- return 0
199
-
200
-
201
174
def average_error (decay_constant : float , num_qubits : int = 1 ) -> float :
202
175
"""Calculates the average error from the depolarization decay constant.
203
176
@@ -213,7 +186,7 @@ def average_error(decay_constant: float, num_qubits: int = 1) -> float:
213
186
214
187
215
188
def decoherence_pauli_error (t1_ns : float , tphi_ns : float , gate_time_ns : float ) -> float :
216
- """The component of Pauli error caused by decoherence.
189
+ """The component of Pauli error caused by decoherence on a single qubit .
217
190
218
191
Args:
219
192
t1_ns: T1 time in nanoseconds.
0 commit comments