Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stochastic solvers small bugfix #2423

Merged
merged 3 commits into from
May 9, 2024
Merged

Conversation

pmenczel
Copy link
Member

@pmenczel pmenczel commented May 9, 2024

When calling ssesolve or smesolve without any stochastic collapse operators but store_measurement set to True, there is an IndexError. This PR fixes the error and adds a test for this situation.

Example code:

import qutip as qt
r = qt.ssesolve(qt.sigmaz(), qt.basis(2, 1), [0, 1, 2], options={'store_measurement': True}, ntraj=15)

@pmenczel pmenczel changed the title Stochastic fixes Stochastic solvers small bugfix May 9, 2024
@coveralls
Copy link

Coverage Status

coverage: 86.094%. first build
when pulling 9e628b3 on pmenczel:stochastic-fixes
into d8c6584 on qutip:master.

Copy link
Member

@Ericgig Ericgig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.

Without sc_ops the stochastic solver is simply me/sesolve, maybe we should also add a fallback like mcsolve.

@pmenczel pmenczel merged commit 9dd572e into qutip:master May 9, 2024
11 of 12 checks passed
@pmenczel pmenczel deleted the stochastic-fixes branch May 9, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants