Skip to content

Commit b30d8cc

Browse files
committed
Removing move noise joining
1 parent 77519e8 commit b30d8cc

File tree

1 file changed

+2
-53
lines changed

1 file changed

+2
-53
lines changed

src/bloqade/noise/native/model.py

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import abc
2-
from itertools import product
32
from dataclasses import field, dataclass
43

54

@@ -211,45 +210,6 @@ def join_binary_probs(cls, p1: float, *args: float) -> float:
211210
p2 = cls.join_binary_probs(*args)
212211
return p1 * (1 - p2) + p2 * (1 - p1)
213212

214-
@classmethod
215-
def join_channels(
216-
cls,
217-
tuple_1: tuple[float, float, float, float],
218-
tuple_2: tuple[float, float, float, float],
219-
) -> tuple[float, float, float, float]:
220-
"""Join two channels together by taking the maximum of each channel.
221-
222-
Assumes that -X, -Y, and -Z are the same as X, Y, and Z respectively.
223-
224-
Args:
225-
tuple_1 (tuple[float, float, float, float]): The first channel. contains the following:
226-
(px_1, py_1, pz_1, p_loss_1)
227-
tuple_2 (tuple[float, float, float, float]): The second channel. contains the following:
228-
(px_2, py_2, pz_2, p_loss_2)
229-
Returns:
230-
tuple[float, float, float, float]: The joined probabilities for each channel.
231-
232-
"""
233-
px_1, py_1, pz_1, p_loss_1 = tuple_1
234-
px_2, py_2, pz_2, p_loss_2 = tuple_2
235-
236-
p1_dict = {"I": 1 - (px_1 + py_1 + pz_1), "X": px_1, "Y": py_1, "Z": pz_1}
237-
p2_dict = {"I": 1 - (px_2 + py_2 + pz_2), "X": px_2, "Y": py_2, "Z": pz_2}
238-
p_out = {}
239-
240-
for key1, key2 in product(p1_dict.keys(), p2_dict.keys()):
241-
key = cls.PAULI_RULE[key1 + key2]
242-
if key == "I":
243-
continue
244-
p_out[key] = p_out.setdefault(key, 0.0) + p1_dict[key1] * p2_dict[key2]
245-
246-
return (
247-
p_out["X"],
248-
p_out["Y"],
249-
p_out["Z"],
250-
cls.join_binary_probs(p_loss_1, p_loss_2),
251-
)
252-
253213

254214
@dataclass(frozen=True)
255215
class TwoRowZoneModel(MoveNoiseModelABC):
@@ -316,19 +276,8 @@ def parallel_cz_errors(
316276
) -> dict[tuple[float, float, float, float], list[int]]:
317277
"""Apply parallel gates by moving ctrl qubits to qarg qubits."""
318278
groups = self.deconflict(ctrls, qargs)
319-
320-
num_groups = len(groups)
321-
322-
mover_noise = self.join_channels(self.move_errors, self.cz_paired_errors)
323-
sitter_noise = self.sitter_errors
324-
325-
for _ in range(num_groups - 1):
326-
mover_noise = self.join_channels(mover_noise, self.sitter_errors)
327-
sitter_noise = self.join_channels(sitter_noise, self.sitter_errors)
328-
329279
movers = sum((c + q for c, q in groups), ())
330-
331280
return {
332-
mover_noise: sorted(movers),
333-
sitter_noise: sorted(rest),
281+
self.move_errors: sorted(movers),
282+
self.sitter_errors: sorted(rest),
334283
}

0 commit comments

Comments
 (0)