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

How to define sampler_states in real system(in parallel tempering) #632

Open
xlimke opened this issue Nov 25, 2022 · 0 comments
Open

Comments

@xlimke
Copy link

xlimke commented Nov 25, 2022

I'm doing parallel tempering with openMM-plumed.

According to #547 the key method is:
def create(self, thermodynamic_state, sampler_states: list, storage, min_temperature=None, max_temperature=None, n_temperatures=None, temperatures=None, **kwargs):

sampler_states is referred to :

sampler_states : openmmtools.states.SamplerState or list. One or more sets of initial sampler states. If a list of SamplerStates, they will be assigned to replicas in a round-robin fashion.

In the example, sampler_states is defined as states.SamplerState(testsystem.positions).

However, I have trouble in defining sampler_states in real system instead of testsystem. I tried to define it as simulation.context.getState(). Then there is an error message:

File "/envs/openmm/lib/python3.9/site-packages/openmmtools/multistate/replicaexchange.py", line 244, in _pre_write_create

if len(sampler_states) > n_states:

TypeError: object of type 'State' has no len()

Is there any help in defining sampler_states in real system?

Thanks in advance,
Meng

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

No branches or pull requests

1 participant