arm61 / pylj Goto Github PK
View Code? Open in Web Editor NEWTeaching Utility for Classical Atomistic Simulation.
Home Page: https://pythoninchemistry.org/pylj
License: MIT License
Teaching Utility for Classical Atomistic Simulation.
Home Page: https://pythoninchemistry.org/pylj
License: MIT License
Please add the DOI for Jupyter Notebooks reference.
Now that there is support for other forcefields, it would be nice to have a sigma epsilon LJ potential in addition to the A B one there is currently.
How this is done for a Lennard-Jones potential can be found in pylj/forcefields.py
TypeError Traceback (most recent call last) in () ----> 1 system = md_simulation(100, 273.15, 100, 5000, 50) in md_simulation(number_of_particles, temperature, box_length, number_of_steps, sample_frequency) 16 system.cut_off) 17 # Run the equations of motion integrator algorithm ---> 18 system.particles = md.velocity_verlet(system.particles, system.timestep_length, system.box_length) 19 # Sample the thermodynamic and structural parameters of the system 20 system = md.sample(system.particles, system.box_length, system.initial_particles, system) TypeError: velocity_verlet() missing 1 required positional argument: 'cut_off'
Describe the bug
I'm working through the ideal_gas_law example. I have a feeling the plot of atoms should animate them moving around the box, but there's no display until the calculation is over, then it just shows what I think is the last frame.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
From the instructions it seems like it should be animated?.
Desktop (please complete the following information):
Additional context
The readme says all development discussion will take place on gitter. The docs say there is a slack channel. I couldn't sign in to the slack channel because it says I need to "Contact the workspace administrator for an invitation".
Is all communication going to occur via gitter? If so can the read me be changed to make this clearer?
Test coverage has dropped a bit, work be nice to see it go back up
https://pyodide.org/en/stable/
Can we use pyodide for examples that run in the browser?
In title
Improve the forcefield tests such that:
dr
is an arrayconstants
are being usedNow that there is support for other forcefields, it would be nice to have a Square-well potential
In writing tests, I discovered that the Buckingham forcefield functions run into a TypeError if the dr input is not a single float (i.e [dr] or for an array of different values).
Here's the error that comes up:
TypeError: can't multiply sequence by non-int of type 'float'
The documentation is very poor and outdated. At minimum it needs a facelift.
The examples are broken following the move to non-C++ stuff.
In the examples, there are several fields/code boxes which are not running, since they contain broken special characters.
Steps to reproduce the behavior:
Screenshot from the "raw" notebook:
Checked on Ubuntu 20.04.2 LTS with
Can we move to having classes that describe the potential models? Does this mean we can have a mixture of particles?
using the msd plot in the scattering class there is some inconsistency due to the pbc
This file is part of the distribution.
For students, it would be nice if they can run the notebooks online using myBinder (e.g. https://jupyter.org/try). I have not managed to get it running since pylj
is not apparently not in the "default-binder" collection of packages.
I have tried to get it running with adding it in the requirements.txt
or enviroment.yml
(https://mybinder.readthedocs.io/en/latest/using/config_files.html#config-files), but have failed so far...
Currently the marker size for the particles in the mpl plots is deteremined based on the size of the simulation cell. However, with the release 1.1, it is now possible to change the forcefield and the values of A and B, therefore requiring the particle marker size to scale with both the simulation cell size and the nature of the potential model.
I reckon it is best to have the marker size be dependent on the position of the minima on the potential well. e.g. the sigma for a (sigma-epsilon) Lennard Jones.
This would involve working on the mk
variable in the sample.setup_cellview
function. Since it might be forcefield dependent, it might be necessary to define something in the forcefields.py
module.
Ideas welcome.
Include ipywidgets (or similar) to control variables of the simulation such as temperature, number of particles etc.
Now that there is support for other forcefields, it would be nice to have a Buckingham potential
With the ability to write custom forcefields it would be nice for the documentation to have a page dedicated to information about this
Remove the need for a C++ implementation of the pairwise calculation by using numba jit
Can these please be replaced with named constants? Preferably with the formula/units in a comment? I think this code has educational utility beyond what is intended. The project is structured well and the code is written well so it is readable. I could imagine more advanced students reading the source and learning something.
E.g.
// four_ep_sigma (UNITS) = 4 * \epsilon * \sigma**6
four_ep_sigma = 9.273e-78
Instances that I saw:
I liked the additional notebooks. I had a few simple fixes; nothing too difficult. Pending these changes I agree that it is ready for publication. Great job!
When rearranging ln(Q) add some helpful hints for students:
Between eq 1 and 2: "Using Stirling's approximation"
Between eq 2 and 3: "Substituting the de Broglie thermal wavelength"
typos:
"approxmations" -> "approximations"
"intantenous" -> "instantaneous"
"accoprding" -> "according"
"enivornment" -> "environment"
"neglible" -> "negligible"
"implimented" -> "implemented"
typos:
"approxmations" -> "approximations"
"intantenous" -> "instantaneous"
"accoprding" -> "according"
"enivornment" -> "environment"
"deriviative" -> "derivative"
typos:
"approxmations" -> "approximations"
"intantenous" -> "instantaneous"
"accoprding" -> "according"
"showen" -> "shown"
"presssure" -> "pressure"
"disucss" -> "discuss"
The sentence: "The use of computers in chemistry is becoming more and more commonplace with increases computational resource and more efficient and effective algorithms." sounds a bit awkward.
Consider: "The use of computers in chemistry is becoming more common as computers are increasing in power and the algorithms are becoming more accurate and efficient."
Since this is pedagogical code, I don't think the focus should be on making things faster if it becomes unreadable. However I had one change that could make things quicker and if someone is reading the code to learn, it could start them thinking about these things when programming.
In comp.cpp
, change from
f = (1.635e-133 * pow(dr, -13.) - 5.834e-77 * pow(dr, -7.));
force_arr[k] = f;
e = (1.363e-134 * pow(dr, -12.) - 9.273e-78 * pow(dr, -6.));
energy_arr[k] = e;
to
inv_dr_1 = 1.0 / dr;
inv_dr_6 = pow(inv_dr_1, 6);
f = (1.635e-133 * (inv_dr_1*inv_dr_6*inv_dr_6) - 5.834e-77 * (inv_dr_1*inv_dr_6*));
force_arr[k] = f;
e = (1.363e-134 * (inv_dr_6*inv_dr_6)) - 9.273e-78 * (inv_dr_6));
energy_arr[k] = e;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.