Skip to content

Commit f5e1d12

Browse files
david-pllamq317tcochran-quera
authored
Make all GeminiOneZoneModels use correlated noise (#459)
Implements #448. The test on the noisy GHZ fidelity now fails. On the one hand, of course, since the fidelities did change. On the other hand, however, we now somehow get a singular matrix for two qubits which produces a corresponding `np.LinAlg` warning and results in a fidelity > 1. FWIW, checking manually you can see that the matrices are pretty close, so the issue really seems to be with the way the fidelity is calculated. What's also kind of fishy: the fidelity for three qubits increased (slightly). Before, we had: 0.9518, now it's 0.957. @tcochran-quera @lamq317 did you see something similar when comparing the one-zone model with and without correlated noise or is there something wrong here? You can now also pass in the correlated rates either as dictionary or as array ```python model = GeminiOneZoneModel(cz_paired_correlated_rates = np.array(...)) model = GeminiOneZoneModel(cz_paired_error_probabilities = {"II": 0.9, "XX": ...}) ``` Not sure about the naming though. --------- Co-authored-by: Luis Martinez <[email protected]> Co-authored-by: Tyler A Cochran <[email protected]>
1 parent 6b4959e commit f5e1d12

File tree

7 files changed

+159
-214
lines changed

7 files changed

+159
-214
lines changed

src/bloqade/cirq_utils/noise/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from .model import (
44
GeminiOneZoneNoiseModel as GeminiOneZoneNoiseModel,
55
GeminiTwoZoneNoiseModel as GeminiTwoZoneNoiseModel,
6-
GeminiOneZoneNoiseModelABC as GeminiOneZoneNoiseModelABC,
7-
GeminiOneZoneNoiseModelCorrelated as GeminiOneZoneNoiseModelCorrelated,
86
GeminiOneZoneNoiseModelConflictGraphMoves as GeminiOneZoneNoiseModelConflictGraphMoves,
97
)
108
from .transform import transform_circuit as transform_circuit

src/bloqade/cirq_utils/noise/_two_zone_utils.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -264,24 +264,25 @@ def get_gate_error_channel(
264264
moment: cirq.Moment,
265265
sq_loc_rates: np.ndarray,
266266
sq_glob_rates: np.ndarray,
267-
cz_rates: np.ndarray,
267+
two_qubit_pauli: cirq.Gate,
268268
unp_cz_rates: np.ndarray,
269+
nqubs: int,
269270
):
270271
"""Applies gate errors to the circuit
271272
272273
Args:
273274
moment: A cirq.Moment object.
274275
sq_loc_rates: single local qubit rotation Pauli noise channel parameters (px, py, pz)
275276
sq_glob_rates: single global qubit rotation Pauli noise channel parameters (px,py,pz)
276-
cz_rates: two-qubit rotation Pauli noise channel parameters (ctrl_px, ctrl_py,ctrl_pz,tar_px,tar_py,tar_pz)
277+
two_qubit_pauli: correlated two-qubit noise channel (ctrl_px, ctrl_py,ctrl_pz,tar_px,tar_py,tar_pz)
277278
unp_cz_rates: Pauli noise channel parameters for qubits in the gate zone and outside blockade radius
279+
nqubs: total number of qubits
278280
Returns:
279281
A new cirq.Moment object with the gate errors applied.
280282
"""
281283
# Check for the moment (layer) layout: global single qubit gates, or mixture of single qubit gates and two qubit gates
282284

283285
gates_in_layer = extract_u3_and_cz_qargs(moment)
284-
# new_moment = cirq.Moment()
285286
new_moments = cirq.Circuit()
286287

287288
if gates_in_layer["cz"] == []:
@@ -294,7 +295,7 @@ def get_gate_error_channel(
294295
if all(
295296
np.all(np.isclose(element, gates_in_layer["angles"][0]))
296297
for element in gates_in_layer["angles"]
297-
):
298+
) and nqubs == len(gates_in_layer["u3"]):
298299
pauli_channel = cirq.AsymmetricDepolarizingChannel(
299300
p_x=sq_glob_rates[0], p_y=sq_glob_rates[1], p_z=sq_glob_rates[2]
300301
)
@@ -314,31 +315,22 @@ def get_gate_error_channel(
314315

315316
else:
316317
# there is at least one CZ gate...
317-
ctrl_pauli_channel = cirq.AsymmetricDepolarizingChannel(
318-
p_x=cz_rates[0], p_y=cz_rates[1], p_z=cz_rates[2]
319-
)
320-
tar_pauli_channel = cirq.AsymmetricDepolarizingChannel(
321-
p_x=cz_rates[3], p_y=cz_rates[4], p_z=cz_rates[5]
322-
)
323318
loc_rot_pauli_channel = cirq.AsymmetricDepolarizingChannel(
324319
p_x=sq_loc_rates[0], p_y=sq_loc_rates[1], p_z=sq_loc_rates[2]
325320
)
326321
unp_cz_pauli_channel = cirq.AsymmetricDepolarizingChannel(
327322
p_x=unp_cz_rates[0], p_y=unp_cz_rates[1], p_z=unp_cz_rates[2]
328323
)
329324

325+
# apply correlated noise to paired qubits
330326
for qub in gates_in_layer["cz"]:
331-
new_moments.append(ctrl_pauli_channel(qub[0]))
332-
new_moments.append(tar_pauli_channel(qub[1]))
333-
# new_moment=new_moment+ctrl_pauli_channel(qub[0])
334-
# new_moment=new_moment+tar_pauli_channel(qub[1])
327+
new_moments.append(two_qubit_pauli.on(qub[0], qub[1]))
335328

336329
for qub in gates_in_layer["u3"]:
337330
new_moments.append(
338331
unp_cz_pauli_channel(qub[0])
339332
) ###qubits in the gate zone get unpaired_cz error
340333
new_moments.append(loc_rot_pauli_channel(qub[0]))
341-
# new_moment = new_moment + loc_rot_pauli_channel(qub[0])
342334

343335
return new_moments
344336

0 commit comments

Comments
 (0)