NVIDIA/cuda-quantum

`MidCircuitMeasurementAnalyzer` doesn't handle all cases of measurement assigned variables

1tnguyen opened this issue · 0 comments

There is an oversight in this line:

if 'id' in condition.__dict__ and condition.id in self.measureResultsVars:

There are two cases:

  • For simple variable comparison (var == True/False): the id field is actually in the left node, i.e., we need to look for condition.left.id.

  • For subscript variables, e.g., results[0], the left is an ast.Subscript object, hence we need to look for the value field to find the variable name.