Friday, October 19, 2012

Install Lyx in my local account

These 4 steps will compile, test and install LyX:

    0) Linux users beware: You need qt4 and qt4-devel packages
       of the same version to compile LyX.

    1) ./configure
         if you want to install LyX at your own local account, you should then use
       ./configure --prefix=$HOME

    2) make
       compiles the program.

    3) src/lyx
       runs the program so you can check it out.

    4) make install
       will install it. You can use "make install-strip" instead
           if you want a smaller binary.


Last point, when you first start LyX, you do the '/Tools/Reconfigure'  in order to make many template available.

Wednesday, September 5, 2012

Bandstructure and DoS calculation

Some basic understanding that deserved to be mentioned here:

1. Bandstructure calculation requires the system has translational invariance, which means the system should be a infinite system with certain lattice symmetry, otherwise there is now meaning for the definition of momentum .  So basically, we should calculate the bandstructure of the studied system in a 'lead' or at least should treat it as a lead.

2 DoS is by the same argument should be calculate inside a lead. And the system should not be 'finalize()' before your calculation of DoS or bandstructure.

Tuesday, September 4, 2012

Collection of Questions for Poster section for the windsor summer

Q1: Why gap closing does not observed in your dI/dV curve as those observed in the LDOS?

A1: As the paper"T. Stanescu et al, arXiv:1206.0013v1(2012)", the LDOS cannot fully represent the whole information of the system. And as you see the joining of the peak in the LDOS in the paper mentioned about is parameters dependent. So if we can find the good parameter, we believe we can also see the process of joining of the peaks.


Q2: Disorder open SC gap, and make SC proximity effect large, why?

A2: According to the paper "P. G. de Gennes and D. Saint-James, Phys. Letter 4, 151(1963)" and "C. W. J. Bennakker, Lect. Notes. Phys. 667, 131(2005)", the formula showed in the poster. When there are disorder impurities in the system, they will make the scattering more intense and thus the long rang scattering which has large parallel momentum is suppressed. Only left the scattering that are nearly perpendicular to the SC-NW interfaces. Thus leading to the small T(p||), and thus large E_gap.


 Q3: What could it be if we add a SC term directly in H_1D instead of writing a BdG Hamiltonian?
A3: For the SC Hamiltonian, it is always has the form of BdG.


Q4: What makes the Rashba double parabolic band splited?
A4: The Zeemam terms


Q5: Change chemical potential will bring what change?
A5: Chemical potential is always in the gap. However, you can always change chemical potential in your numerical calculation and those change gate voltage in the experiment. If the system has multi-subband, you can tune your chemical potential within each subband (which is formed due to the confinement).


Q6: What are the many other peaks? Why they form? And what does disorder do with them?

A6: The other peaks are due to multi-band, or modes, or channels which will essentially bring to different Andreev-reflections. We conclude that weak disorder will kill the other modes(peaks), and open the gap.

Q7: What is the difference between V_bias, and V_gate?
A7: V_bias are the voltage difference between Normal lead and SC lead. However, V_gate is the applied electric field control the chemical potential in the NW system. They are quiet different concepts.


Thursday, July 26, 2012

《幽兰操》 韩愈

一个君子是能处于不利的环境而保持他的志向和德行操守的
韩愈《幽兰操》:


兰之猗猗,扬扬其香。
不采而佩,于兰何伤。
今天之旋,其曷为然。
我行四方,以日以年。
雪霜贸贸,荠麦之茂。
子如不伤,我不尔觏。
荠麦之茂,荠麦之有。
君子之伤,君子之守。

Wednesday, July 25, 2012

Python print in the same line successively

The question is like in python code:
for i inrange(1,100):
    print i

And the output is like:
1
2
3
.
.
99

I want it to print in the same line like: 1 2 3 . . . 99
Solution: use ',' to prevent starting from a new line:
for i in range(1,100):
    print i,
Another thing is that if you want to start something from a new line, you should use '\n' in either 'print '\n' ' or '.write('\n')'

git basic

Normally, there is a classification of bare (empty) repository and non-bare repository. The bare repository is serving as a central media to connect any information to the other repositories. And there is always your working repository where you make change and improvment to your files inside.  Whenever you have made some change in your working repository, you should push it to the bare repository. And from your other computers other where or your account on cluster, you should 'git fectch' or 'git reset --hard' to the bare repository on your server.

Here is some basic procedures that one can build your repositories:
  • Making a local "non-bare" working repository, add a folder and files inside under git version control:
    1. We start from mkdir an empty folder
    2. mkdir wire
      cd wire
      git init
    3. And then copy the files to wire
    4. Add all the files inside folder 'wire', and git commit them all

    5. git add *
      git commit -a
      # Note, it is very important not to include .pyc, .py~ files otherwise your will get much unnecessary and unexpected trouble in the future
    6. Edit git comment to provide some information about the version and descripiton comment. And also you can add user name and email information about it:
      git config --global user.name "Voornaam Achternaam"
      git config --global user.email "aaa@bbb.com"
      git config --global core.editor "my favorate editor" #e.g. vim, nano, less
  • Make a bare repository, a remote copy of your local working reposiotry:
    1. making a remote bare repository using ssh to our server: ssh name@ssh.lorentz.leidenuniv.nl
      mkdir repo/wire.git
      cd repo/wire.git
      git init --bare
      exit
    2. Go back to your local working repository, and make remote add, and push your local repository to the remote bare repository wire.git at the server:

    3. git remote add origin name@ssh.lorentz.leidenuniv.nl:repo/wire.git
      git push origin master
    4. Note here "origin" is a name you can choose for the remote bare repository, you can name it for whatever you want, and you can check the all the remote repositories name or choose to delete them by using the command below
    5. git remote # check all the name of remote repository
      git remote rm aaa # remove the remote repository whose name is aaa
    6. After your git push from you local non-bare repository to the bare repository, you can go to your server and using "gitk --all" (if you have that) to check out the status, or using "git status". You can always use these command to check the status and branch.
  • Get a copy of a remote bare repository:
    1. If it is from your own computer or server account

    2. git clone /repo/wire.git
      git clone name:ssh.lorent.leidenuniv.nl:repo/wire.git
    3. If it is from other computer or server account

    4. git clone ~/otheruser/repo/hie_or_her_project.git
      git clone name:ssh.lorent.leidenuniv.nl:~otheruser/repo/his_or_her_project.git

      Note, unless you want to make some change in this repository (but usually people do not make change here), do not first make this folder 'git init'. Here you just copy or fetch it from a remote repository. You will always working and make file changes in you local non-bare working repository, i.e. wire here, and then push the changed files to ~repo/wire.git. You will always keep up changes from wire.git by using 'git fetch'. Make sure you understand this information flow direction once you made some change.
  • Keep up with changes from remote repositories:

    1. Once you make some change in your local non-bare working repository, you git push it to the bare repository, and to keep up the change at other places from this non-repository you need to:
    2. git fetch origin (or --all)
      git reset --hard origin
      Or you can delete the folder and make git clone, see above section
    3. In order to make sure you have the same version, you go to your copied repository and check

    4. git describe --always

      This will return a series number which identify the version of your repository, which is made after each time you made change in your working repository and git commit them. Each version has a unique version series number. So this number here should be coincides with the same number you using 'git describe --always' at your local non-bare working repository.

Tuesday, July 24, 2012

How to install Numpy and Scipy in Ubuntu without root right

During my research working, I need to install 'matplot' in Ipython; however, the newest version of matplot requires latest version of Numpy and Scipy. Since I am using the university computer, Ubuntu 10.10, and Numpy and Scipy is very old. So I try to manage to update the later version of Numpy and Scipy.

  1. Numpy install:

  2. Here we basically follow the instruction of the instruction on the webpage"http://www.hongliangjie.com/2012/04/01/install-numpy-and-scipy-on-centos-without-root-privilege/"

    Notice that here you have to install LAPAC and BLAS correctly before you install NUmpy. You can find some instruction about LAPAC and BLAS installation also from the link above.
  1. Scipy install:
       Installation of Scipy is a little bit tricky. First, I failed because I cannot manage to change the installation directory. Then with the help of Michael yesterday, he did it.
  • Copy the 'site.cfg' to the untared directory file folder of scipy, say in my case 'scipy-0.10.1'. 
  • You have to make sure in which directory installed your python library. This is why I failed before. Michael somehow is experienced to that, and he find it out. So open the site.cfg and change the lines under '[Default]':
        [DEFAULT]
      library_dirs = /usr/lib
      include_dirs = /usr/include
      src_dirs = [BLAS]:[LAPACK]
  •  Under the folder of 'scipy-0.10.1' in your terminal, you have to make sure to build with either gfortran or g77 complier, in my case I use gfortran, so you type:
       python setup.py build --fcomplier=gfortran
  •  Then you can install scipy in your local computer:
        python setup.py install --home=~

Monday, July 23, 2012

Python: multiple sorted with keys

Today I encounter a problem of sorting an array or a list twice, first by index key1, then by index key2.

More specificlly:

ththings  = [("animal", "bear"), ("vehicle", "school bus"),("animal", "duck"), ("plant", "cactus"), ("vehicle", "speed boat")]

And I want it first be arranged by the first index alphabetically, and then within each class, i.e. 'animal', 'vehicle', 'plant', the second index also should be arranged alphabetically like:
[('animal', 'bear'),
 ('animal', 'duck'),
 ('plant', 'cactus'),
 ('vehicle', 'school bus'),
 ('vehicle', 'speed boat')]

The solution to this problem is to use sorted() function twice, but the tricky thing is that, we must sorted the by the second index inside the sorting of the first index:

c = sorted((sorted(things, key=lambda x: x[1])), key=lambda x:x[0])

where x[1] refers to the 2nd column of the array 'things'.

Wednesday, July 18, 2012

How do I install numpy without root right under Ubuntu

Today I tried to install numpy latest version 1.6.2 on my university computer, with Ubuntu 10.10


  • check the version of your numpy using ipython:
     import numpy
     numpy.__version__


  • download the latest numpy install package: tar -xvf numpy-1.6.2.tar.gz

-- to be continue soon

Thursday, July 12, 2012

nanoscale views: Graphene, part II

nanoscale views: Graphene, part II: One reason that graphene has comparatively remarkable conduction properties is its band structure, and in particular the idea that single-pa...

Monday, July 9, 2012

Good Quantum Number

Now we are going to review a basic concept, i.e. 'Good quantum number'.

From "http://theworldofsmall.blogspot.nl/2009/01/what-are-good-coordinates.html", I quote:

In classical mechanics, we can assign any number of variables to specify the state of a system. For example, for a free particle, its position, momentum, etc,. can be known and can be assigned simultaneously to specify the state of the free particle. But the story of quantum mechanics is different. If the position of a particle at some instant is correctly known, its momentum will be highly/maximally uncertain. This means, we can't assign both the position and momentum to specify the quantum mechanical state of the particle simultaneously. In this sense, the quantities (observables) which can be assigned simultaneously to a quantum system at any time to specify its state at that time are called the good quantum mumbers of the system. A set of good quantum numbers is also called a complete set of commuting observables (C.S.C.O.). These coordiantes commute each other, which means that their measurements can be made simultaneously.

From wikipedia:

In quantum mechanics, given a particular Hamiltonian H and an operator O with corresponding eigenvalues and eigenvectors given by O|q_j\rangle=q_j|q_j\rangle then the physical quantities q_j are said to be "good quantum numbers" if every eigenvector |q_j\rangle remains an eigenvector of O with the same eigenvalue as time evolves.
Hence, if: O|q_j\rangle=O\sum_k c_k(0) |e_k\rangle = q_j |q_j\rangle
then we require
O\sum_k c_k(0) \exp(-i e_k t/\hbar)\,|e_k\rangle=q_j\sum_k c_k(0) \exp(-i e_k t/\hbar)\,|e_k\rangle
for all eigenvectors |q_j\rangle in order to call q a good quantum number.
A necessary and sufficient condition for q to be good is that O commute with the Hamiltonian H. Proof:
Assume [O,\,H]=0. If |\psi_0\rangle is an eigenvector of O, then we have (by definition) that O |\psi_0\rangle=q_j | \psi_0\rangle, and so :
O|\psi_t\rangle=O\,T(t)\,|\psi_0\rangle
=O e^{-itH/\hbar}|\psi_0\rangle
= O \sum_{n=0}^{\infty} \frac{1}{n!} (-i H t/\hbar)^{n} |\psi_0\rangle
= \sum_{n=0}^{\infty} \frac{1}{n!} (-i H t/\hbar)^{n}  O |\psi_0\rangle
 =q_j |\psi_t\rangle
It can be said that a good classical analogue is that good quantum numbers are the equivalent of conserved quantities in classical mechanics, as their values do not change over time.In non-relativistic treatment,l and s are good quantum numbers but in relativistic quantum mechanics they are no longer good quantum numbers as L and S do not commute with H(in Dirac theory). J=L+S is a good quantum number in relativistic quantum mechanics as J commutes with H.
 

Thursday, July 5, 2012

This is the first Blog text file in my Google blogger. The aim of this blog is to keep record as much as possible the things that happens during my daily life, research and study, and both rational thinking, argumentation, or emotional feelings.

But among all these, the first import aim is of this blog is to serve as a manuscript of my study and research. I once have a Notebook which I write everything what I have done, what I have learned during the my research and study. However, I find that the paper based the notebook is not continent enough. Some time I need to keep tracking of some information I have written before. Since it is only organized by date, so I find it hard to searching the information. By using the blog here, I wish I can use different labels and classify each blog so that it could be easy for me to search information.

Right now, I have thought about several categories:

Research and study: daily/weekly report (mainly on summarized what I have learned today), tomorrow/next week's plan

Life's thinking: emotional thinking and expressing, rational argument, feeling about life

And on the other hand, these categories can also have different labels, such as: Linux tech, Mathematica tech, Research project Problems and solving, Courses problem set and solutions, Latex learning, Journal paper reading and summarized, Booking reading summarized, etc.