bloqade.cirq_utils.parallelize.auto_similarity
← Module overview
function
source
functionauto_similarity¶source
bloqade.cirq_utils.parallelize.auto_similarity
Signature
def auto_similarity(circuit: cirq.Circuit, weight_1q: float, weight_2q: float) -> tuple[cirq.Circuit, dict[Hashable, float]]Automatically tag the circuit with topological basis group labels, where each group is a pair of gates that can be executed in parallel.
Inputs: circuit - a cirq.Circuit to be analyzed. This should be CZ + PhaseXZGate, otherwise no annotation will occur. weight_1q: float - the weight to assign to single-qubit gates. weight_2q: float - the weight to assign to two-qubit gates.
Returns: [0] - the cirq.Circuit with each gate annotated with topological similarity tags. [1] - a dictionary mapping each tag to its weight, where the key is the tag and the value is the weight.
Parameters
| Name | Type | Description |
|---|---|---|
circuit | cirq.Circuit | |
weight_1q | float | |
weight_2q | float |
Returns
tuple[cirq.Circuit, dict[Hashable, float]]