Skip to content

Conversation

@jngrad
Copy link
Member

@jngrad jngrad commented Jul 28, 2023

Fixes #4617

@jngrad jngrad changed the title Monte carlo Monte Carlo prototype Jul 28, 2023
jngrad and others added 2 commits July 29, 2023 00:25
Provide an alternative implementation of SingleReaction,
ReactionAlgorithm and ConstantpHEnsemble in pure Python
for rapid prototyping of new Monte Carlo methods.

Co-authored-by: Pablo Miguel Blanco Andrés <[email protected]>
If the exclusion radius of one particle type is not defined, the value of the parameter provided in ``exclusion_range`` is used by default.
If the value in ``exclusion_radius_per_type`` is equal to 0, then the exclusion range of that particle type with any other particle is 0.
This integration instabilities can be avoided by defining a distance around
the particles which already exist in the system where new particles will not
Copy link
Member

@jonaslandsgesell jonaslandsgesell Jul 29, 2023

Choose a reason for hiding this comment

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

Could you improve this sentence here please:
"... where new particles will not be inserted and old particles will not be removed (to maintain detailed balance)."

acceptance_rate = reaction.get_acceptance_rate()
print(f"acceptance rate = {100. * acceptance_rate:.0f}%")
print(f"alpha = {alpha_avg:.2f} +/- {alpha_err:.2f}")
print(f"runtime = {tock - tick:.2f}s")
Copy link
Member

@jonaslandsgesell jonaslandsgesell Jul 29, 2023

Choose a reason for hiding this comment

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

What do you think about splitting this file into yet another python module to separate the example and the mc functionality?

Did you already consider using just in time compilation in some of the functions to cut down the factor 4 difference?

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.

Prototype reaction method in Python

2 participants