-
Notifications
You must be signed in to change notification settings - Fork 677
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
Docs warning for charge in DielectricConstant #4263
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,10 @@ class DielectricConstant(AnalysisBase): | |
the usual case if electrostatics are handled with a Ewald summation | ||
technique. See [Neumann1983]_ for details on the derivation. | ||
|
||
.. warning:: | ||
Applying this class requires that no free charges, such as ions or | ||
charged fragments, are present in the simulation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @PicoCentauri perhaps I am misunderstanding but you can have no charged anything or is it that you need overall neutrality. Apologoies if silly q. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nono it is fine. This is really a bit tricky. There are even publications where people do this wrong. As we do it in the assertion in the class' prepare function you need charge neutral molecules. In a classical MD world they can have of course have partial charges. In fact, they have to because otherwise the system's total dipole moment would be zero and with it the dielectric constant. What you can not have are ions such as Na+ Cl- or other charged fragments i.e negative carboxylic acid groups COO- or positive amine groups H3N+. |
||
|
||
Parameters | ||
---------- | ||
atomgroup : MDAnalysis.core.groups.AtomGroup | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a stupid question, if this is relying on an Ewald style summation, how well does it handle a system with a net charge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, totally valid question. The answer will be a bit longer. sorry.
Ewald can handle systems with a net charge. You introduce a homogenous background charge that neutralizes the system, which will lead to an additional force an all atoms. This is unproblematic for homogenous systems but lead to severe artifacts in inhomogenous systems like membranes etc.
The equation we use here is derived for an Ewald boundary condition, meaning that the dielectric constant of sorrounding medium is a metal ($\varepsilon=\infty$ ). If you have other boundary conditions like when using reaction field or cutoff electrostatics the equation will change as described in the paper we cite. We use eq 26.4.3D because the derivation for an Ewald electrostatic leads to the same results as a reaction field with an dielectric constant of $\infty$ .
Now, why are charges a problem? The issue is that in the derivation you demand that Maxwell's equation for electric field
where$\rho$ is the charge density is equal to zero: $\nabla \vec E = 0$ . This means that no free charges are present. If you do not do this you will not end up with the equation we use.
Does this answer your question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you could transfer this very insightful piece of writing to an issue for future reference. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we sure. If people find it there.