Skip to content

Commit

Permalink
minor changes and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnurajendran committed Dec 29, 2024
1 parent 1b4390e commit 1327c7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quantumwalks/discrete_walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def simulate(self, store_states: bool = False) -> Union[
shift_plus, shift_minus = create_sparse_shift_operators(self.P, self.custom_shift)
eye_P = csc_matrix(np.eye(self.P))

# Store states and probabilities if requested
# Store states and probabilities if needed
states = [psi.toarray()] if store_states else None
prob_history = [self.calculate_probabilities(psi)]

Expand Down Expand Up @@ -205,7 +205,7 @@ def analyze_statistics(self, prob: np.ndarray) -> dict:
"variance": variance,
"max_probability": np.max(prob),
"min_probability": np.min(prob),
"entropy": -np.sum(prob * np.log2(prob + 1e-15))
"entropy": 0 - np.sum(prob * np.log2(prob + 1e-15))
}

def plot_results(self, prob: np.ndarray, exec_time: float):
Expand Down

0 comments on commit 1327c7c

Please sign in to comment.