Thursday, August 28, 2014

How to systematically to master CPMD program?

Like leaning some real skills or having real ability, you have to make a plan first and then finish it.

For me, I have following plans.

First step, you need to learn how to use it. Download it, compile it, test it, and run it (such as a wave function optimization, geometry optimization, CPMD/BOMD for isolated or PBC systems, etc.).

Second step, learn the results of CPMD output, fully understand the meaning.

Third step, learn to change and optimize the CPMD input parameters, and get the meaningful, useful and correct outputs.

Fourth step, learn the code of CPMD, read the related references carefully, if possible, write a module to implement your own program in CPMD, for example, C-DFT in CPMD.

Fifth, if possible, try to combine CPMD and other programs such as GROMACS to run QM/MM simulations.


Wednesday, July 23, 2014

what is a binary tree?

A binary tree is a data structure where a node has the degree of 0 or 1 or at most 2. This may be due to the binary system (only 0 and 1 are recognized) in computer.

It is pretty easy to find desired data using this data structure.

learning method

curiosity is your instinct. So
First learning method is to ask your own questions. The simplest will be 'what is the meaning of XXX?' Do not think about its stupidity.

Second, you have to find your way to learn something. For our human, we need one standing point, i.e. origin. Namely, you have to copy something from your parents, your teachers, your observation, etc. Then try to use the knowledge you have to know other unknown things. Therefore, analog is important.

Third, we have to understand something based on your origin (the basic concepts). You can not just copy others' thoughts. We have to find our own ways to understand the new concept, new method, new principles, new knowledge. Your own way to understand new things or concepts are extremely important because it only works for you. Other peoples' methods may totally do not work for you. Or even they work for you, you may not find the best way for yourself, therefore you waste your time and lose your identity.

Tuesday, July 15, 2014

questions about yourself

1. How to be a good PI?
2. Where is your limitation?
3. How to test your limitation?
4. Why you care about outside if you even can not control yourself?


Monday, June 30, 2014

fortran learning note 6- some easily made mistakes

1. 3n should be 3*n (forget the multiplication)
2. The array index is out of range.
3. Forget to stop reading a file when it ends.
4. When counting the number of lines of a file, do not forget to use "read (unit,'(a120)')" to include the blank line too.
5. Recognize different types of variables and DO NOT use them with mistakes.   

Friday, June 27, 2014

shell script - learning note 2

shell can return value (0: succeed, non-0: fail)
expr 1 + 3 # show 4, because of with space
echo $? $ will show 0

expr 1+ 3 #show syntax error
echo $? $ will show non-0, here 2 in fact.

read: almost same as Fortran.
Example:
echo "Your first name please:"
read fname
echo "Hello $fname, Lets be friend!"


Wildcard (shorthand) 未知数,通配符
* means any string or group of characters.
? means any single character.
[xxx] Matches any one of the enclosed characters.

two command or more in one line
Example: data;who;cal

Some useful command:
tail file # print last 10 lines of the file.

diamond (i.e. <>)symbol
Example: sort < sname > sorted_names

Pipe: a way to connect the output of one program to the input of another program without any temporary file.
Example: who | sort 
                  ls -l | wl -l

Loop
Bash supports: for loop and while loop
Example: 
for ((  i = 0 ;  i <= 5;  i++  )) # WATCH OUT THE DOUBLE PARENTHESIS. There is no reason, you have to use it this way.
do
  echo "Welcome $i times"
done

  

shell script leanring - note1

Because computers only understand the language of 0 and 1, which is called binary language.

What is Shell?
So Shell is a language interpreter that executes commands read from the standard input device (keyboard) or from a file. It reads your command, interpret and transfer your command to kernal in Linux.

What is Kernel?
Kernel decides who will use this resource, for how long and when. It runs your command or programs (or execute binary files).

$ is important in Bash shell.
Example: $HOME, $n. Only $ + variable can work.

User defined variables
Example: n=10
                  atring=hello

Rules for naming variables:
1. Variable name must begin with Alphanumeric character or underscore character (_), followed by one or more Alphanumeric character.
2. DON'T put spaces on either side of the equal sign when assigning value to variable. THIS IS IMPORTANT since you can easily forget it.
3. Variables are case-sensitive, e.g. N /=n
4.  DO NOT use *, or ?

Math operation in Shell
 1. expr op1 math-operator op2## WATCH THE SPACE BETWEEN OPERATOR.
2. echo `expr 5 + 6` # will show 11. Watch the punctuation is not quote.

Double quote, single quote and back quote.
echo "today is date" # output: today is date
echo "today is `date`" #output: today is Fri Jun 27 13:40:19 PDT 2014
echo 'today is `date`' #output: today is `date`