Skip to content

Commit

Permalink
Use enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
swernli committed Dec 11, 2024
1 parent 20fa43a commit e3eeafe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pip/qsharp/_qsharp.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def check_eq(
phase = None
# Convert a dense list of real amplitudes to a dictionary of state indices to complex amplitudes
if isinstance(state, list):
state = {i: state[i] for i in range(len(state))}
state = {i: val for i, val in enumerate(state)}
# Filter out zero states from the state dump and the given state based on tolerance
state = {k: v for k, v in state.items() if abs(v) > tolerance}
inner_state = {k: v for k, v in self.__inner.items() if abs(v) > tolerance}
Expand Down

0 comments on commit e3eeafe

Please sign in to comment.