Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

equivalent measurements evaluate as unequal

Open richrines1 opened this issue 1 year ago • 2 comments

Description of the issue

the default value of MeasurementGate.invert_mask is (), which should be equivalent to invert_mask=(False, ...). However, specifying the latter results in a gate which evaluates as unequal to the default

it seems like this would be fixed by using self.full_invert_mask() instead of self.invert_mask in MeasurementGate._value_equality_values_

How to reproduce the issue

assert cirq.MeasurementGate(1) == cirq.MeasurementGate(1)  # ok
assert cirq.MeasurementGate(1) == cirq.MeasurementGate(1, invert_mask=())  # ok
assert cirq.MeasurementGate(1) == cirq.MeasurementGate(1, invert_mask=(False,))  # fails, but should be the same

Cirq version

1.2.0.dev20230427183358

richrines1 avatar May 12 '23 19:05 richrines1

Hi @tanujkhattar, I can take this up!

TarunSinghania avatar May 17 '23 06:05 TarunSinghania

Hi @TarunSinghania , Are you working on this or is this fixed already? If not, can I take it up? I'm new to OpenSource and this seems like a good place to start.

nishitkshah avatar Sep 27 '23 17:09 nishitkshah