Dear Ahmed, dear Peter
this is a reply to your question on the mailing list.
As you can see for example in
https://aip.scitation.org/doi/10.1063/1.3541824 in equation 5 the acceptance criterion in the MC metropolis selection criterion requires + or minus to be used depending on dissociating or associating a monomer.
"The signs minus and plus are used when the monomers are deprotonated and protonated, respectively"
This plus and minus from the above quote, are implicitly encoded in nu_bar:
Consider a reaction Consider a reaction HA <-> A- +H+. For the dissociation
dissociation HA -> A- +H+ nubar is +1, for the association H+A -> HA nubar is -1.
Please also note the asymmetric proposal probability for the dissociation and association. Dissociations are proposed with a probability proportional to N(HA) while associations are proposed with a probability proportional to N(A), where N(i) is the number of particles of type i.
In the constant pH ensemble back and forward reaction are in general not selected with equal probability.
>pKa=-log10(current_reaction.gamma)
Yes.
> Dear all,
>
> While I am reading the source code reaction_ensemble.cpp for constant pH
> ensemble, there is a function double ConstantpHEnsemble::calculate_acceptance_probability
> . In this function
> there is a line:
> pKa = -current_reaction.nu_bar * log10(current_reaction.gamma);
>
> I am confused why there is a factor current_reaction.nu_bar before (nu_bar
> is the change of the particle). It seems to me pKa is simply defined as
> pKa=-log10(current_reaction.gamma)
>
> Best,
> Jiaxing
>
Regarding Peters answer:
I believe that this has mostly historical reasons. The reaction ensemble
was implemented first, and it was implemented such that forward and reverse
directions had to be specified separately. The constant-pH ensemble was
implemented later, using the same functions. Only then, the redundancy of
specifying the forward and reverse reaction was removed. I think that what
you just found is an artifact of that redundancy that makes the code more
complicated but has no impact on the results or on the performance
I don't see a clear connection here.