Sunday, September 29, 2013

As a Chinese, how to write good English papers

I think if, as a Chinese scholar, you are not very confident to think in English, you should think in Chinese first. After you have clear logic and ideas to know how to organize contents of your papers, you can write your English versions.

The following Chinese contents is from CCTHERE. Thanks for the author's sharing.
英语学习的另一视角:写和说的关系   

如何提高写作,特别是学术文章的写作呢。建议由以下几点入手,一步一步。
1. 彻底忘掉所谓的技巧和速成。这不是去参加语言考试,你的目的是要把你自己的观点优雅大方地和别人交流,不是去增加几个得分点。
2. 学习。学习什么呢?通过阅读别人的文章来学习。现在有互联网了,方便的很,去经常浏览一下诸如经济学家,卫报(社论和读者来信)等部分。新闻网站就免了。河里也有很好的介绍。注意其中的复杂的句子的运用。
3. 开始写。开始写的时候要使用平实而详细的语言把事实说清楚,先不要考虑什么优美词语之类的(我至今还有印象小学三四年级写作文的时候,每每从小册子里翻一些所谓“优美词语”给自己空洞的文章润色,而最遗憾的是一直没有机会在我的作文里嵌入我曾经最欣赏的一句“东方露出了鱼肚白…”)。注意学术文章的目的是把事实和你的理论说清楚,不是要显得故做高深(题外话:个人感觉国内很多文章和教科书的主要目的就是要让人看不懂,本人感觉而已,看了不要太认真)。这个状态要注意的是语法的时态和冠词。还有,千万千万不要直接翻译你脑海中的中文句子(如果有的话),用简单清晰的英文表达就行了。
4. 提高。你可以开始试着用一些你看到和学到的复杂的句式了。除非特别需要,短句子能说清楚的就用短句子,长了大家都头痛。另外,多次阅读学术类文章后你会发现其中也有一些“八股”的成分在里头,也讲究一些“起承转合”的。你写的文章也要尽量使用类似的结构,这样同行阅读起来就顺畅一些。
5. 反馈。这时,你的师友恐成受害者了。但要有信心,经过如此这般的交流后,他们会乐此不疲,你文章的水平也就相当可以。
如果你慢慢地写作水平能到了上面的第4步,你会发现你再也不会为写Email花费多余的一点时间了,当然个别情况还有例外(比如写给你的老板或那个她/他)。你应该能描述复杂的现象,做幻灯片报告的时候也应该不会满屏文字,照章宣读,而是游刃有余,滔滔不绝了。


In the writing, the most often common mistakes by Chinese scholars are the usage of articles. For example, I realized that 67% of my mistakes are due to the usage of articles.

The following is copied from following link:
https://owl.english.purdue.edu/owl/resource/540/01/

What is an article? Basically, an article is an adjective. Like adjectives, articles modify nouns.
English has two articles: the and a/an. The is used to refer to specific or particular nouns; a/an is used to modify non-specific or non-particular nouns. We call the the definite article and a/an the indefinite article.
the = definite article
a/an = indefinite article
For example, if I say, "Let's read the book," I mean a specific book. If I say, "Let's read a book," I mean any book rather than a specific book.
Here's another way to explain it: The is used to refer to a specific or particular member of a group. For example, "I just saw the most popular movie of the year." There are many movies, but only one particular movie is the most popular. Therefore, we use the.
"A/an" is used to refer to a non-specific or non-particular member of the group. For example, "I would like to go see a movie." Here, we're not talking about a specific movie. We're talking about any movie. There are many movies, and I want to see any movie. I don't have a specific one in mind.
Let's look at each kind of article a little more closely.

Indefinite Articles: a and an

"A" and "an" signal that the noun modified is indefinite, referring to any member of a group. For example:
  • "My daughter really wants a dog for Christmas." This refers to any dog. We don't know which dog because we haven't found the dog yet.
  • "Somebody call a policeman!" This refers to any policeman. We don't need a specific policeman; we need any policeman who is available.
  • "When I was at the zoo, I saw an elephant!" Here, we're talking about a single, non-specific thing, in this case an elephant. There are probably several elephants at the zoo, but there's only one we're talking about here.

Remember, using a or an depends on the sound that begins the next word. So...

  • a + singular noun beginning with a consonant: a boy; a car; a bike; a zoo; a dog
  • an + singular noun beginning with a vowel: an elephant; an egg; an apple; an idiot; an orphan
  • a + singular noun beginning with a consonant sound: a user (sounds like 'yoo-zer,' i.e. begins with a consonant 'y' sound, so 'a' is used); a university; a unicycle
  • an + nouns starting with silent "h": an hour
  • a + nouns starting with a pronounced "h": a horse
    • In some cases where "h" is pronounced, such as "historical," you can use an. However, a is more commonly used and preferred.
      A historical event is worth recording.
Remember that these rules also apply when you use acronyms:
Introductory Composition at Purdue (ICaP) handles first-year writing at the University. Therefore, an ICaP memo generally discusses issues concerning English 106 instructors.
Another case where this rule applies is when acronyms start with consonant letters but have vowel sounds:
An MSDS (material safety data sheet) was used to record the data. An SPCC plan (Spill Prevention Control and Countermeasures plan) will help us prepare for the worst.
If the noun is modified by an adjective, the choice between a and an depends on the initial sound of the adjective that immediately follows the article:
  • a broken egg
  • an unusual problem
  • a European country (sounds like 'yer-o-pi-an,' i.e. begins with consonant 'y' sound)
Remember, too, that in English, the indefinite articles are used to indicate membership in a group:
  • I am a teacher. (I am a member of a large group known as teachers.)
  • Brian is an Irishman. (Brian is a member of the people known as Irish.)
  • Seiko is a practicing Buddhist. (Seiko is a member of the group of people known as Buddhists.)

Definite Article: the

The definite article is used before singular and plural nouns when the noun is specific or particular. The signals that the noun is definite, that it refers to a particular member of a group. For example:
"The dog that bit me ran away." Here, we're talking about a specific dog, the dog that bit me.
"I was happy to see the policeman who saved my cat!" Here, we're talking about a particular policeman. Even if we don't know the policeman's name, it's still a particular policeman because it is the one who saved the cat.
"I saw the elephant at the zoo." Here, we're talking about a specific noun. Probably there is only one elephant at the zoo.

Count and Noncount Nouns

The can be used with noncount nouns, or the article can be omitted entirely.
  • "I love to sail over the water" (some specific body of water) or "I love to sail over water" (any water).
  • "He spilled the milk all over the floor" (some specific milk, perhaps the milk you bought earlier that day) or "He spilled milk all over the floor" (any milk).
"A/an" can be used only with count nouns.
  • "I need a bottle of water."
  • "I need a new glass of milk."
Most of the time, you can't say, "She wants a water," unless you're implying, say, a bottle of water.

Geographical use of the

There are some specific rules for using the with geographical nouns.
Do not use the before:
  • names of most countries/territories: Italy, Mexico, Bolivia; however, the Netherlands, the Dominican Republic, the Philippines, the United States
  • names of cities, towns, or states: Seoul, Manitoba, Miami
  • names of streets: Washington Blvd., Main St.
  • names of lakes and bays: Lake Titicaca, Lake Erie except with a group of lakes like the Great Lakes
  • names of mountains: Mount Everest, Mount Fuji except with ranges of mountains like the Andes or the Rockies or unusual names like the Matterhorn
  • names of continents (Asia, Europe)
  • names of islands (Easter Island, Maui, Key West) except with island chains like the Aleutians, the Hebrides, or the Canary Islands
Do use the before:
  • names of rivers, oceans and seas: the Nile, the Pacific
  • points on the globe: the Equator, the North Pole
  • geographical areas: the Middle East, the West
  • deserts, forests, gulfs, and peninsulas: the Sahara, the Persian Gulf, the Black Forest, the Iberian Peninsula

Omission of Articles

Some common types of nouns that don't take an article are:
  • Names of languages and nationalities: Chinese, English, Spanish, Russian (unless you are referring to the population of the nation: "The Spanish are known for their warm hospitality.")
  • Names of sports: volleyball, hockey, baseball
  • Names of academic subjects: mathematics, biology, history, computer science

Wednesday, September 25, 2013

umbrella sampling learning

Q1: what is umbrella sampling?
The umbrella sampling applies bias energy to an interested system on some CVs. It is similar to heating a system. The motion of particles starts accelerating. The bare events, i.e. the some un-accessible near ground states, could be explored. The benefits of umbrella sampling is that US can obtain the relative free energy profiles.

Q2: what is free energy in simulation? Why free energy is used in MD simulations?

The thermodynamic free energy is the amount of work that a thermodynamic system can perform. The concept is useful in the thermodynamics of chemical or thermal processes in engineering and science. The free energy is the internal energy of a system minus the amount of energy that cannot be used to perform work. This unusable energy is given by the entropy of a system multiplied by the temperature of the system.

Internal energy has two major components, kinetic energy and potential energy. The kinetic energy is due to the motion of the system's particles (translations, rotations, vibrations), and the potential energy is associated with the static rest mass energy of the constituents of matter, static electric energy of atoms within molecules or crystals, and the static energy of chemical bonds. 
Enthalpy:  It includes the system's internal energy or thermodynamic potential (a state function), as well as its volume and pressure (the energy required to "make room for it" by displacing its environment, which is an extensive quantity).

Entropy: Entropy is a measure of the number of specific ways in which a system may be arranged, often taken to be a measure of disorder, or a measure of progressing towards thermodynamic equilibrium. The entropy of an isolated system never decreases, because isolated systems spontaneously evolve towards thermodynamic equilibrium, which is the state of maximum entropy.  Entropy is a logarithmic measure of the number of states with significant probability of being occupied. If all microstates have equal probability, the entropy is k_b*ln(the number of micro states)

In MD simulations, there are several common free energy types.
Common Free Energy Type
● Solvation Free Energy / Transfer Free Energy
● Binding Free energy
● Confomational Free Energy 


Ergodic hypothesis
time average = ensemble average

free energy difference:
ΔG = -RT ln (P1/P0)

Accurate calculations of absolute free energy is nearly impossible due to insufficient sampling in a
finite length and time scale simulation.  Need different methods to estimate free energy.
● Common method
- Thermodynamical integration
- Free energy perturbation
- Umbrella sampling
- Potential of mean force

Running US simulation
● Choose the reaction coordinate
● Choose the number of windows and the biasing potential
● Run the simulations
● Compute time series for the value of the reaction coordinate (histograms)
● Apply the WHAM equations






Monday, September 23, 2013

Compile a parallel version of VASP in a Linux Intel clusters

some basic concepts:
The most often used MPI (message passing interface), which are portable software to distribute and share memory in parallel clusters, and exchange data/information between different nodes, are
1. OPENMPI
2. MPICH

file types:
*.o file: objective file
*.a: a combination of multiple *.o files
*.so: shared object, similar to dynamic link library.

linking a *.so file
-L: list the file path.
-lmkl: link libmkl.so file.

two often used environmental variables in Linux.
LD_LIBRARY_PATH:  In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories.

PATH: PATH is an environmental variable in Linux and other Unix-like operating systems that tells the shell which directories to search for executable files (i.e., ready-to-run programs) in response to commands issued by a user. It increases both the convenience and the safety of such operating systems and is widely considered to be the single most important environmental variable.

"env" command will show all the current environmental variables and their values for the current user.
For PATH only, we can use 'env | grep PATH'.

Adding a path:
PATH="/usr/sbin:$PATH"
or
export PATH=$PATH:/usr/sbin
or 
An addition to a user's PATH variable can be made permanent by adding it to that user's .bash_profile file.

.bashrc and .bashprofile
.bash_profile is executed when you login. Stuff you put in there might be your PATH and other important environment variables.
.bashrc is used for non login shells. I'm not sure what that means. I know that RedHat executes it everytime you start another shell (su to this user or simply calling bash again) You might want to put aliases in there but again I am not sure what that means. I simply ignore it myself.
.profile is the equivalent of .bash_profile for the root. I think the name is changed to let other shells (csh, sh, tcsh) use it as well. (you don't need one as a user)
icc: intel c compiler
impi: intel mpi.

Module: The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles.

Modules can be loaded and unloaded dynamically and atomically, in an clean fashion. All popular shells are supported, including bashkshzshshcshtcsh, as well as some scripting languages such as perl andpython.
Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications.

"ldd yourprogram" will show a list of the libraries that are needed for myprogram.

Now let's start to compile a parallel version of VASP.
The system information is following.
OS: "uname -rms", show Linux 2.6.18-348.6.1.el5 x86_64.
Hardware: grep "model name" /proc/cpuinfo, Intel(R) Xeon(R)
Compiler: ifort -v, mpif90 -v, icc -v. I used intel compiler.











Friday, September 20, 2013

Compile a VASP version 5.3 in a linux intel cluster

s1. Download  vasp.5.lib.tar and  VASP.tgz files from VASP website with permission and license.
s2. Make a diretory: vasp-paralell. Command: mkdir vasp-paralell
s3. copy vasp.5.lib.tar and  VASP.tgz into this directory. Command: cp vasp.5.lib.tar VASP.tgz vasp-paralell
s4.  cd vasp-paralell, tar -xzvf VASP.tgz, tar -xvf vasp.5.lib.tar
s5.  mkdir potpaw_LDA, mkdir potpaw_PBE, mkdir src
s6. mv potpaw_LDA.52.tar potpaw_LDA
s7. cd potpaw_LDA, tar -xvf potpaw_LDA.52.tar
s8. cd .. ,  mv  potpaw_PBE.52.tar potpaw_PBE
s9. cd potpaw_PBE, tar -xvf potpaw_PBE.52.tar
s10. mv vasp.5.3.3.tar src, mv vasp.5.lib src
s11. cd src, tar -xvf vasp.5.3.3.tar
s12. cd /vasp.5.lib
s13.cp makefile.linux_efc_itanium Makefile,
s14. make, you will see following information:
gcc -E -P -C preclib.F >preclib.f
ifort -O1 -FI -FR  -c preclib.f
mpicc -O -c timing_.c
mpicc -O -c derrf_.c
mpicc -O -c dclock_.c
gcc -E -P -C diolib.F >diolib.f
ifort -O1 -FI -FR  -c diolib.f
gcc -E -P -C dlexlib.F >dlexlib.f
ifort -O1 -FI -FR  -c dlexlib.f
gcc -E -P -C drdatab.F >drdatab.f
ifort -O1 -FI -FR  -c drdatab.f
ifort -O1 -FI  -c lapack_double.f
lapack_double.f(10179): remark #5140: Unrecognized directive
CDIR$          NEXTSCALAR
-------------------------^
lapack_double.f(10181): remark #5140: Unrecognized directive
CDIR$          NEXT SCALAR
--------------------------^
lapack_double.f(20692): remark #5140: Unrecognized directive
CDIR$          NEXTSCALAR
-------------------------^
lapack_double.f(20694): remark #5140: Unrecognized directive
CDIR$          NEXT SCALAR
--------------------------^
lapack_double.f(20706): remark #5140: Unrecognized directive
CDIR$             NEXTSCALAR
----------------------------^
lapack_double.f(20708): remark #5140: Unrecognized directive
CDIR$             NEXT SCALAR
-----------------------------^
lapack_double.f(20733): remark #5140: Unrecognized directive
CDIR$          NEXTSCALAR
-------------------------^
lapack_double.f(20735): remark #5140: Unrecognized directive
CDIR$          NEXT SCALAR
--------------------------^
ifort -O1 -FI  -c linpack_double.f
ifort -O1 -FI  -c lapack_atlas.f
lapack_atlas.f(12864): remark #5140: Unrecognized directive
CDIR$          NEXTSCALAR
-------------------------^
lapack_atlas.f(12866): remark #5140: Unrecognized directive
CDIR$          NEXT SCALAR
--------------------------^
lapack_atlas.f(18861): remark #5140: Unrecognized directive
CDIR$          NEXTSCALAR
-------------------------^
lapack_atlas.f(18863): remark #5140: Unrecognized directive
CDIR$          NEXT SCALAR
--------------------------^
lapack_atlas.f(18875): remark #5140: Unrecognized directive
CDIR$             NEXTSCALAR
----------------------------^
lapack_atlas.f(18877): remark #5140: Unrecognized directive
CDIR$             NEXT SCALAR
-----------------------------^
lapack_atlas.f(18902): remark #5140: Unrecognized directive
CDIR$          NEXTSCALAR
-------------------------^
lapack_atlas.f(18904): remark #5140: Unrecognized directive
CDIR$          NEXT SCALAR
--------------------------^
rm libdmy.a
rm: cannot remove `libdmy.a': No such file or directory
make: [libdmy.a] Error 1 (ignored)
ar vq libdmy.a preclib.o timing_.o derrf_.o dclock_.o  diolib.o dlexlib.o drdatab.o
ar: creating libdmy.a
a - preclib.o
a - timing_.o
a - derrf_.o
a - dclock_.o
a - diolib.o
a - dlexlib.o
a - drdatab.o
s15. cd VASP/vasp.5.3/src
s16. cp makefile.linux_ifc_P4 Makefile
s17. vi Makefile
s18. MKL_PATH=YOURPATH/mkl/lib/intel64
s19. MKL_FFTW_PATH=/YOURPATH/mkl//interfaces/fftw3xf/
s20. LAPACK= YOURPATH/mkl/lib/intel64/libmkl_intel_lp64.a
s21. make
Finally, you should be able to see vasp exe file generated.