Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
davibinco committed Dec 11, 2024
1 parent 4a6148d commit fa2db49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tequila/wavefunction/qubit_wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def normalize(self, inplace: bool = False) -> QubitWaveFunction:
# because the __mul__ implementation of the number tries to perform some sort of array
# operation.
def length(self):
return sum(1 for _ in self.raw_items())
return sum(1 for (k, v) in self.raw_items() if abs(v) > 1e-6)

def __repr__(self):
result = str()
Expand Down

0 comments on commit fa2db49

Please sign in to comment.