Skip to content

Commit

Permalink
Fix marginal counts for pulse jobs. Fixes Qiskit#6430. Code fix check…
Browse files Browse the repository at this point in the history
…s if creg_sizes is an attribute in the object and executes related code, only if it is.
  • Loading branch information
rithikaadiga committed May 30, 2021
1 parent 59272f1 commit f01273c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qiskit/result/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def marginal_counts(result, indices=None, inplace=False, format_marginal=False):
new_counts_hex[_bin_to_hex(k)] = v
experiment_result.data.counts = new_counts_hex
experiment_result.header.memory_slots = len(indices)
csize = experiment_result.header.creg_sizes
experiment_result.header.creg_sizes = _adjust_creg_sizes(csize, indices)
if hasattr(experiment_result.header, 'creg_sizes'):
csize = experiment_result.header.creg_sizes
experiment_result.header.creg_sizes = _adjust_creg_sizes(csize, indices)
return result
else:
marg_counts = _marginalize(result, indices)
Expand Down

0 comments on commit f01273c

Please sign in to comment.