tqecd.utils.has_only_measurement_or_is_virtual#

has_only_measurement_or_is_virtual(moment: Circuit) bool[source]#

Check if a stim.Circuit moment contains only measurement instructions or is a virtual moment.

Note

Annotations are ignored by this function.

Parameters:

moment – The moment to check.

Returns:

True if the provided moment has a measurement, else False. Note that this function returns True on a moment that only contains annotations and noisy-gates (measurements excluded).