This is part III of a series of three posts about optimizing python code. The particular example given is the computation of pair-wise distances under periodic boundary condition which is an essential part of molecular dynamics simulations. In this post, I show how to use Numpy to do the computation.
This is part II of a series of three posts about optimizing python code. The particular example given is the computation of pair-wise distances under periodic boundary condition which is an essential part of molecular dynamics simulations. In this post, I show how to use Numpy to do the computation.
In this series of posts, using calculation of pair-wise distances under periodic boundary condition as an example, I show several different methods to optimize Python codes. The performances from different methods are benchmarked for comparison.
Ever wondering is it possible embed scientiﬁc python codes and let user interact with it directly in your website? In this post, I demonstrate how to use Pyodide to execute python code inside the browser using an example of 2D random walker.
A long time ago, I came upon hyper.js. Before then I was using the native terminal shipped with mac OS and iTerm for a long time. The aesthetics of the design of hyper.js immediately hook me. I downloaded it and started using it for my daily research tasks. I immediately ﬁnd it slow. It very frequently gives no response to my input and even using
ls to list a directory sometimes can cause it to freeze for a few seconds. I tried to use it for probably a month and eventually gave up. I resorted back to iTerm and appreciated its speed which I never thought about before. Although I still couldn’t appreciate its design at that time, its speed is fast enough to not hinder my work in any way.
In this post, I will show how to use the API provided by Netlify CMS to give the preview pane the ability to render math expression and highlighting syntax. The post has three parts 1) How to write a simple React component 2) How to use markdown-it and prism.js in the template, and 3) How to pre-compile the template and use it
In this note, I will accumulate some VMD tips I ﬁnd useful. The main purpose of this note is for self convenience but I hope it can be useful for anyone who wander on this page
This note is about an extreme simple exercise of using express.js and axios. The purpose of this exercise is to learn the basic concept of express.js and axios.First, I create a simple express server, and secondly, I use axios to make http call to the server created.
Simple python code for solving integral equation. In this article, I wrote about how to solve for fredholm integral equation using tikhonov regularization. The algorithm is also provided in python code.
How to map from one matrix to another using deep learning? This note is about the effectiveness of using multidimensional LSTM network to learn matrix operations, such as linear mapping as well as non-linear mapping. Recently I am trying to solve a research problem related to mapping between two matrices. And came up the idea of applying neural network to the problem. The Recurrent Neural Network (RNN) came to my sight not long after I started searching
Random walks generated in an alternative way and understanding Rouse model. Long time ago, I wrote about how to use Pivot algorithm to generate equilibrium conformations of a random walk, either self-avoiding or not. The volume exclusion of a self-avoiding chain make it non-trivial to generate conformations. Gaussian chain, on the other hand, is very easy and trivial to generate. In addition to the efﬁcient pivot algorithm, in this article, I will show another interesting but non-straightforward method to generate gaussian chain conformations
Writing a overdamped Brownian Dynamics ﬁx for LAMMPS. LAMMPS is a very powerful Molecular Dynamics simulation software I use in my daily research. In our research group, we mainly run Langevin Dynamics (LD) or Brownian Dynamics (BD) simulation. However, for some reason, LAMMPS doesn’t provide a way to do Brownian Dynamics (BD) simulation. Both the LD and BD can be used to sample correct canonical ensemble, which sometimes also be called NVT ensemble
大湾国家公园游记. 5月不是最适合去Big Bend露营的季节, 沙漠在每天最热的时候温度会高达40度, 再加上缺水, 所以很少人会选择夏季来Big Bend. 来Austin之后, 偶然看到一张South rim落日后的照片, 紫色的天空, 脚下是一眼望不到头的Chiwawa沙漠, 看到这张照片后就下定决心一定要去一趟. 无奈一直没有合适的时间, 再加上去Big Bend最适宜的季节 (冬季) 很难订到campsite, 一年多了也没有去成. 5月份学期结束, 我们决定干脆说走就走, 现在来看我俩很庆幸有了这次稍显准备仓促的旅行, 要不然真不知道什么时候能去成了
Ever wondering how to run a ipython notebook on a remote machine? Here is how to do it in a simple way. My research work involves a lot of using of IPython Notebook. I usually do it on an ofﬁce MAC. However I also very often need to access it from home. After a brief searching, I found these three wonderful articles on this topic
Learn how to hack your LAMMPS codes. Lessons from studying source codes. This is a note about learning LAMMPS source codes. This note focuses on compute style of Lammps which is used to compute certain quantity during the simulation run. Of course you can as well compute these quantities in post-process, however it’s usually faster to do it in the simulation since you can take advantage of the all the distance, forces, et al generated during the simulation instead of computing them again in post-process
Pivot algorithm is best Monte Carlo algorithm known so far used for generating canonical ensemble of self-avoiding random walks (ﬁxed number of steps). Originally it is for the random walk on a lattice, but it also can be modiﬁed for continuous random walk. Recently I encountered a problem where I need to generate self-avoiding chain conﬁgurations.