bloqade.cirq_utils.parallelize.block_similarity
← Module overview
function
source
functionblock_similarity¶source
bloqade.cirq_utils.parallelize.block_similarity
Signature
def block_similarity(circuit: cirq.Circuit, weight: float, block_id: int) -> tuple[cirq.Circuit, dict[Hashable, float]]Associate every gate in a circuit with a similarity group.
Inputs: circuit - a cirq.Circuit to be analyzed. weight: float - the weight to assign to each block of 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 | float | |
block_id | int |
Returns
tuple[cirq.Circuit, dict[Hashable, float]]