Skip to content

Commit

Permalink
Only pre-compute density matrix if not stoing individual trajectories
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Ord committed Feb 2, 2024
1 parent a4f132e commit 432f39f
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 142 deletions.
1 change: 1 addition & 0 deletions doc/changes/2303.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only pre-compute density matricies if keep_runs_results is False
5 changes: 3 additions & 2 deletions qutip/solver/mcsolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class _MCSystem(_MTSystem):
"""
Container for the operators of the solver.
"""

def __init__(self, rhs, c_ops, n_ops):
self.rhs = rhs
self.c_ops = c_ops
Expand Down Expand Up @@ -247,8 +248,8 @@ def set_state(self, t, state0, generator,
self.target_norm = 0.0
else:
self.target_norm = (
self._generator.random() * (1 - jump_prob_floor)
+ jump_prob_floor
self._generator.random() * (1 - jump_prob_floor)
+ jump_prob_floor
)
self._integrator.set_state(t, state0)
self._is_set = True
Expand Down

0 comments on commit 432f39f

Please sign in to comment.