Skip to content

Model

GeminiNoiseModelABC dataclass

GeminiNoiseModelABC(
    check_input_circuit: bool = True,
    cz_paired_correlated_rates: ndarray | None = None,
    cz_paired_error_probabilities: dict | None = None,
    *,
    local_px: float = 0.0004102,
    local_py: float = 0.0004102,
    local_pz: float = 0.0004112,
    local_loss_prob: float = 0.0,
    local_unaddressed_px: float = 2e-07,
    local_unaddressed_py: float = 2e-07,
    local_unaddressed_pz: float = 1.2e-06,
    local_unaddressed_loss_prob: float = 0.0,
    global_px: float = 6.5e-05,
    global_py: float = 6.5e-05,
    global_pz: float = 6.5e-05,
    global_loss_prob: float = 0.0,
    cz_paired_gate_px: float = 0.0006549,
    cz_paired_gate_py: float = 0.0006549,
    cz_paired_gate_pz: float = 0.003184,
    cz_gate_loss_prob: float = 0.0,
    cz_unpaired_gate_px: float = 0.0005149,
    cz_unpaired_gate_py: float = 0.0005149,
    cz_unpaired_gate_pz: float = 0.002185,
    cz_unpaired_loss_prob: float = 0.0,
    mover_px: float = 0.000806,
    mover_py: float = 0.000806,
    mover_pz: float = 0.002458,
    move_loss_prob: float = 0.0,
    sitter_px: float = 0.0003066,
    sitter_py: float = 0.0003066,
    sitter_pz: float = 0.0004639,
    sit_loss_prob: float = 0.0
)

Bases: NoiseModel, MoveNoiseModelABC

Abstract base class for all Gemini noise models.

check_input_circuit class-attribute instance-attribute

check_input_circuit: bool = True

Determine whether or not to verify that the circuit only contains native gates.

Caution: Disabling this for circuits containing non-native gates may lead to incorrect results!

cz_paired_correlated_rates class-attribute instance-attribute

cz_paired_correlated_rates: ndarray | None = None

The correlated CZ error rates as a 4x4 array.

cz_paired_error_probabilities class-attribute instance-attribute

cz_paired_error_probabilities: dict | None = None

The correlated CZ error rates as a dictionary

parallel_cz_errors

parallel_cz_errors(
    ctrls: list[int], qargs: list[int], rest: list[int]
) -> dict[tuple[float, float, float, float], list[int]]

Takes a set of ctrls and qargs and returns a noise model for all qubits.

Source code in .venv/lib/python3.12/site-packages/bloqade/cirq_utils/noise/model.py
113
114
115
116
117
118
def parallel_cz_errors(
    self, ctrls: list[int], qargs: list[int], rest: list[int]
) -> dict[tuple[float, float, float, float], list[int]]:
    raise NotImplementedError(
        "This noise model doesn't support rewrites on bloqade kernels, but should be used with cirq."
    )

GeminiOneZoneNoiseModel dataclass

GeminiOneZoneNoiseModel(
    check_input_circuit: bool = True,
    cz_paired_correlated_rates: ndarray | None = None,
    cz_paired_error_probabilities: dict | None = None,
    parallelize_circuit: bool = False,
    *,
    local_px: float = 0.0004102,
    local_py: float = 0.0004102,
    local_pz: float = 0.0004112,
    local_loss_prob: float = 0.0,
    local_unaddressed_px: float = 2e-07,
    local_unaddressed_py: float = 2e-07,
    local_unaddressed_pz: float = 1.2e-06,
    local_unaddressed_loss_prob: float = 0.0,
    global_px: float = 6.5e-05,
    global_py: float = 6.5e-05,
    global_pz: float = 6.5e-05,
    global_loss_prob: float = 0.0,
    cz_paired_gate_px: float = 0.0006549,
    cz_paired_gate_py: float = 0.0006549,
    cz_paired_gate_pz: float = 0.003184,
    cz_gate_loss_prob: float = 0.0,
    cz_unpaired_gate_px: float = 0.0005149,
    cz_unpaired_gate_py: float = 0.0005149,
    cz_unpaired_gate_pz: float = 0.002185,
    cz_unpaired_loss_prob: float = 0.0,
    mover_px: float = 0.000806,
    mover_py: float = 0.000806,
    mover_pz: float = 0.002458,
    move_loss_prob: float = 0.0,
    sitter_px: float = 0.0003066,
    sitter_py: float = 0.0003066,
    sitter_pz: float = 0.0004639,
    sit_loss_prob: float = 0.0
)

Bases: GeminiNoiseModelABC

A Cirq-compatible noise model for a one-zone implementation of the Gemini architecture.

This model introduces custom asymmetric depolarizing noise for both single- and two-qubit gates depending on whether operations are global, local, or part of a CZ interaction. Since the model assumes all atoms are in the entangling zone, errors are applied that stem from application of Rydberg error, even for qubits not actively involved in a gate operation.

Note, that the noise applied to entangling pairs is correlated.

noisy_moments

noisy_moments(
    moments: Iterable[Moment], system_qubits: Sequence[Qid]
) -> Sequence[cirq.OP_TREE]

Adds possibly stateful noise to a series of moments.

Parameters:

Name Type Description Default
moments Iterable[Moment]

The moments to add noise to.

required
system_qubits Sequence[Qid]

A list of all qubits in the system.

required

Returns:

Type Description
Sequence[OP_TREE]

A sequence of OP_TREEEs, with the k'th tree corresponding to the

Sequence[OP_TREE]

noisy operations for the k'th moment.

Source code in .venv/lib/python3.12/site-packages/bloqade/cirq_utils/noise/model.py
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
def noisy_moments(
    self, moments: Iterable[cirq.Moment], system_qubits: Sequence[cirq.Qid]
) -> Sequence[cirq.OP_TREE]:
    """Adds possibly stateful noise to a series of moments.

    Args:
        moments: The moments to add noise to.
        system_qubits: A list of all qubits in the system.

    Returns:
        A sequence of OP_TREEEs, with the k'th tree corresponding to the
        noisy operations for the k'th moment.
    """

    if self.check_input_circuit:
        self.validate_moments(moments)

    # Split into moments with only 1Q and 2Q gates
    moments_1q = [
        cirq.Moment([op for op in moment.operations if len(op.qubits) == 1])
        for moment in moments
    ]
    moments_2q = [
        cirq.Moment([op for op in moment.operations if len(op.qubits) == 2])
        for moment in moments
    ]

    assert len(moments_1q) == len(moments_2q)

    interleaved_moments = []
    for idx, moment in enumerate(moments_1q):
        interleaved_moments.append(moment)
        interleaved_moments.append(moments_2q[idx])

    interleaved_circuit = cirq.Circuit.from_moments(*interleaved_moments)

    # Combine subsequent 1Q gates
    compressed_circuit = cirq.merge_single_qubit_moments_to_phxz(
        interleaved_circuit
    )
    if self.parallelize_circuit:
        compressed_circuit = parallelize(compressed_circuit)

    return self._noisy_moments_impl_moment(
        compressed_circuit.moments, system_qubits
    )

GeminiOneZoneNoiseModelConflictGraphMoves dataclass

GeminiOneZoneNoiseModelConflictGraphMoves(
    check_input_circuit: bool = True,
    cz_paired_correlated_rates: ndarray | None = None,
    cz_paired_error_probabilities: dict | None = None,
    parallelize_circuit: bool = False,
    max_parallel_movers: int = 10000,
    *,
    local_px: float = 0.0004102,
    local_py: float = 0.0004102,
    local_pz: float = 0.0004112,
    local_loss_prob: float = 0.0,
    local_unaddressed_px: float = 2e-07,
    local_unaddressed_py: float = 2e-07,
    local_unaddressed_pz: float = 1.2e-06,
    local_unaddressed_loss_prob: float = 0.0,
    global_px: float = 6.5e-05,
    global_py: float = 6.5e-05,
    global_pz: float = 6.5e-05,
    global_loss_prob: float = 0.0,
    cz_paired_gate_px: float = 0.0006549,
    cz_paired_gate_py: float = 0.0006549,
    cz_paired_gate_pz: float = 0.003184,
    cz_gate_loss_prob: float = 0.0,
    cz_unpaired_gate_px: float = 0.0005149,
    cz_unpaired_gate_py: float = 0.0005149,
    cz_unpaired_gate_pz: float = 0.002185,
    cz_unpaired_loss_prob: float = 0.0,
    mover_px: float = 0.000806,
    mover_py: float = 0.000806,
    mover_pz: float = 0.002458,
    move_loss_prob: float = 0.0,
    sitter_px: float = 0.0003066,
    sitter_py: float = 0.0003066,
    sitter_pz: float = 0.0004639,
    sit_loss_prob: float = 0.0
)

Bases: GeminiOneZoneNoiseModel

A Cirq noise model that uses a conflict graph to schedule moves in a one-zone Gemini architecture.

Assumes that the qubits are cirq.GridQubits, such that the assignment of row, column coordinates define the initial geometry. An SLM site at the two qubit interaction distance is also assumed next to each cirq.GridQubit to allow for multiple moves before a single Rydberg pulse is applied for a parallel CZ.

GeminiTwoZoneNoiseModel dataclass

GeminiTwoZoneNoiseModel(
    check_input_circuit: bool = True,
    cz_paired_correlated_rates: ndarray | None = None,
    cz_paired_error_probabilities: dict | None = None,
    *,
    local_px: float = 0.0004102,
    local_py: float = 0.0004102,
    local_pz: float = 0.0004112,
    local_loss_prob: float = 0.0,
    local_unaddressed_px: float = 2e-07,
    local_unaddressed_py: float = 2e-07,
    local_unaddressed_pz: float = 1.2e-06,
    local_unaddressed_loss_prob: float = 0.0,
    global_px: float = 6.5e-05,
    global_py: float = 6.5e-05,
    global_pz: float = 6.5e-05,
    global_loss_prob: float = 0.0,
    cz_paired_gate_px: float = 0.0006549,
    cz_paired_gate_py: float = 0.0006549,
    cz_paired_gate_pz: float = 0.003184,
    cz_gate_loss_prob: float = 0.0,
    cz_unpaired_gate_px: float = 0.0005149,
    cz_unpaired_gate_py: float = 0.0005149,
    cz_unpaired_gate_pz: float = 0.002185,
    cz_unpaired_loss_prob: float = 0.0,
    mover_px: float = 0.000806,
    mover_py: float = 0.000806,
    mover_pz: float = 0.002458,
    move_loss_prob: float = 0.0,
    sitter_px: float = 0.0003066,
    sitter_py: float = 0.0003066,
    sitter_pz: float = 0.0004639,
    sit_loss_prob: float = 0.0
)

Bases: GeminiNoiseModelABC

noisy_moments

noisy_moments(
    moments: Iterable[Moment], system_qubits: Sequence[Qid]
) -> Sequence[cirq.OP_TREE]

Adds possibly stateful noise to a series of moments.

Parameters:

Name Type Description Default
moments Iterable[Moment]

The moments to add noise to.

required
system_qubits Sequence[Qid]

A list of all qubits in the system.

required

Returns:

Type Description
Sequence[OP_TREE]

A sequence of OP_TREEEs, with the k'th tree corresponding to the

Sequence[OP_TREE]

noisy operations for the k'th moment.

Source code in .venv/lib/python3.12/site-packages/bloqade/cirq_utils/noise/model.py
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
def noisy_moments(
    self, moments: Iterable[cirq.Moment], system_qubits: Sequence[cirq.Qid]
) -> Sequence[cirq.OP_TREE]:
    """Adds possibly stateful noise to a series of moments.

    Args:
        moments: The moments to add noise to.
        system_qubits: A list of all qubits in the system.

    Returns:
        A sequence of OP_TREEEs, with the k'th tree corresponding to the
        noisy operations for the k'th moment.
    """

    if self.check_input_circuit:
        self.validate_moments(moments)

    moments = list(moments)

    if len(moments) == 0:
        return []

    nqubs = len(system_qubits)
    noisy_moment_list = []

    prev_moment: cirq.Moment | None = None

    # TODO: clean up error getters so they return a list moments rather than circuits
    for i in range(len(moments)):
        noisy_moment_list.extend(
            [
                moment
                for moment in _two_zone_utils.get_move_error_channel_two_zoned(
                    moments[i],
                    prev_moment,
                    np.array(self.mover_pauli_rates),
                    np.array(self.sitter_pauli_rates),
                    nqubs,
                ).moments
                if len(moment) > 0
            ]
        )

        noisy_moment_list.append(moments[i])

        noisy_moment_list.extend(
            [
                moment
                for moment in _two_zone_utils.get_gate_error_channel(
                    moments[i],
                    np.array(self.local_pauli_rates),
                    np.array(self.global_pauli_rates),
                    self.two_qubit_pauli,
                    np.array(self.cz_unpaired_pauli_rates),
                    nqubs,
                ).moments
                if len(moment) > 0
            ]
        )

        prev_moment = moments[i]

    return noisy_moment_list