Skip to content

bloqade.cirq_utils.noise.transform.transform_circuit

← Module overview

functiontransform_circuitsource

bloqade.cirq_utils.noise.transform.transform_circuit

Signature
def transform_circuit(circuit: cirq.Circuit, to_native_gateset: bool = True, model: cirq.NoiseModel | None = None, parallelize_circuit: bool = False) -> cirq.Circuit

Transform an input circuit into one with the native gateset with noise operations added.

Noise operations will be added to all qubits in circuit.all_qubits(), regardless of whether the output of the circuit optimizers contain all the qubits.

Parameters

NameTypeDefaultDescription
circuitcirq.CircuitrequiredThe input circuit.
to_native_gatesetboolTrue
modelcirq.NoiseModel | NoneNone
parallelize_circuitboolFalse

Other Parameters

NameTypeDescription
to_native_gatesetboolWhether or not to convert the input circuit to one using the native set of gates (`cirq.CZTargetGateset`) only. Defaults to `True`. Note, that if you use an input circuit that has gates different from this gateset and don't convert it, may lead to incorrect results and errors.
modelcirq.NoiseModelThe cirq noise model to apply to the circuit. Usually, you want to use one of the ones supplied in this submodule, such as `GeminiOneZoneNoiseModel`.
parallelize_circuitboolWhether or not to parallelize the circuit as much as possible after it's been converted to the native gateset. Defaults to `False`.

Returns

cirq.CircuitThe resulting noisy circuit.

source