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

NonMarkovianMCSolver does not support improved sampling #2235

Open
pmenczel opened this issue Sep 29, 2023 · 0 comments
Open

NonMarkovianMCSolver does not support improved sampling #2235

pmenczel opened this issue Sep 29, 2023 · 0 comments
Assignees
Labels

Comments

@pmenczel
Copy link
Member

pmenczel commented Sep 29, 2023

Problem Description

The improved_sampling option was recently added to mcsolve. It might also be useful to have in nm_mcsolve, but adaptations to the code are required to make it work. Currently, we have disabled this option for the NonMarkovianMCSolver, see PR 2234.

Since NonMarkovianMCSolver inherits from MCSolver, one might expect this option to work "out of the box". The technical reason why it does not is that nm_mcsolve calculates the value of an influence martingale, which is factored into the calculation of expectation values in the custom result class NmmcResult. If improved_sampling is enabled, the result class McResultImprovedSampling is used instead, which is not aware of the martingale.

Proposed Solution

Both the improved sampling algorithm and nm_mcsolve give trajectories a weight. In the former case, the weight is related to the probability of the trajectory without jumps; in the latter case it is the influence martingale. I imagine it might be useful to give McResult itself the capability to handle weighted trajectories.
This capability would be useful for one additional purpose: if we want to allow mixed initial conditions for mcsolve in the future. In this case, the trajectories would need to be weighted with a correction factor, because the fraction $f_i$ of trajectories starting in a state $i$ will generally not be equal to the corresponding eigenvalue $p_i$ of the density matrix $\rho = \sum p_i |i \rangle\langle i|$. (Hence, the correction factor would be $p_i / f_i$.)

If people think this would be useful (including the mixed initial states), I will try to implement this proposal once I can find some time to do so.

Alternate Solutions

Alternatively, we could leave things as they are now and not support the improved sampling for nm_mcsolve. Another less invasive option would be copying the improved sampling algorithm to nm_mcsolve (adding a NmmcResultImprovedSampling class).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant