Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseclectic committed Oct 4, 2019
1 parent 6db1efc commit c9d5db5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions qiskit/providers/aer/extensions/snapshot_probabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ def __init__(self, label, num_qubits, variance=False):
Raises:
ExtensionError: if snapshot is invalid.
"""
if variance:
snapshot_type = 'probabilities_with_variance'
else:
snapshot_type = 'probabilities'

snapshot_type = 'probabilities_with_variance' if variance else 'probabilities'
super().__init__(label, snapshot_type=snapshot_type,
num_qubits=num_qubits)

Expand Down
7 changes: 2 additions & 5 deletions test/terra/backends/qasm_simulator/qasm_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,8 @@ def probabilitiy_snapshots(data, labels):
output = {}
for label in labels:
snaps = data.get("snapshots", {}).get("probabilities", {}).get(label, [])
# Convert list into dict
inner = {}
for snap_dict in snaps:
inner[snap_dict['memory']] = snap_dict['value']
output[label] = inner
output[label] = {snap_dict['memory']: snap_dict['value']
for snap_dict in snaps}
return output

def test_snapshot_probabilities_pre_measure(self):
Expand Down

0 comments on commit c9d5db5

Please sign in to comment.