Skip to content

bloqade.cirq_utils.parallelize.moment_similarity

← Module overview

functionmoment_similaritysource

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

NameTypeDescription
circuitcirq.Circuit
weightfloat

Returns

tuple[cirq.Circuit, dict[Hashable, float]]

source