@@ -151,6 +151,9 @@ class BitMaskKeyCondition(Condition):
151151 - BitMaskKeyCondition.create_equal_mask('a', 13) -> (a & 13) == 13
152152 - BitMaskKeyCondition.create_not_equal_mask('a', 13) -> (a & 13) != 13
153153
154+ The bits in the bitmask have the same order as the qubits passed to `cirq.measure(...)`. That's the
155+ most significant bit corresponds to the the first (left most) qubit.
156+
154157 Attributes:
155158 - key: Measurement key.
156159 - index: integer index (same as KeyCondition.index).
@@ -179,6 +182,7 @@ def keys(self):
179182 def create_equal_mask (
180183 key : 'cirq.MeasurementKey' , bitmask : int , * , index : int = - 1
181184 ) -> 'BitMaskKeyCondition' :
185+ """Creates a condition that evaluates (meas & bitmask) == bitmask."""
182186 return BitMaskKeyCondition (
183187 key , index , target_value = bitmask , equal_target = True , bitmask = bitmask
184188 )
@@ -187,6 +191,7 @@ def create_equal_mask(
187191 def create_not_equal_mask (
188192 key : 'cirq.MeasurementKey' , bitmask : int , * , index : int = - 1
189193 ) -> 'BitMaskKeyCondition' :
194+ """Creates a condition that evaluates (meas & bitmask) != bitmask."""
190195 return BitMaskKeyCondition (
191196 key , index , target_value = bitmask , equal_target = False , bitmask = bitmask
192197 )
0 commit comments