bloqade.cirq_utils.parallelize.moment_similarity
← Module overview
function
source
functionmoment_similarity¶source
bloqade.cirq_utils.parallelize.moment_similarity
Signature
def moment_similarity(circuit: cirq.Circuit, weight: float) -> tuple[cirq.Circuit, dict[Hashable, float]]Associate every gate in each moment 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 |
Returns
tuple[cirq.Circuit, dict[Hashable, float]]