Pages

Superconductivity at 250 K in LaH10 170 GPa

Recently, Nature published a paper titled "Superconductivity at 250 K in lanthanum hydride under high pressures" authored by Drozdov et al 2019 [Nature 569, 528–531 (2019)]


Special characters and symbols from MS Word

We might have come across some situation where we need some specific symbol and we don't now where it is in the symbol section that is provided by the Microsoft Office.

Here, is a way to get your special chearacter.

chi - this is a Greek letter and can be obtained using
Alt + 967   (press Alt key + 967)

insert - equation -
insert - object - get the best symbol.

List of Questions in DFT and answers (for some Qs)


The questions span a wide topics in Physics or sometimes other subjects also. Whenever possible, I try to answer in a separate post and give links to related materials to these question. To see the answer page, click the link ANSWER given at the end of the question.
  1. A multi-electron wave function should obey Anti-symmetric priciple, i.e. the sign of the wave function should change sign if two electrons are interchanged (or swapped). Does Kohn-Sham orbitals obey this principle? Is there any description related to this? ANSWER

Peer-review: What it is like?

How is peer-review like?

Most of the time peer-review improves the manuscript. Here is an illustration (credit:redpenblackpen.jasonya.com) of how peer-review improves your manuscript. Originally, you submit a decent paper and if the manuscript is reviewed properly, surely it will transform your decent manuscript to a luxury car.



While peer-review some times gives so much pain for the authors, peer-review methodology works well.
"Yes. Exceptions too. There are so many research works which at the end got Nobel prize where initially rejected by peer-reviewers (as well as editors). A most recent example would be the first report on the atomically thick, 2D material cleaved from graphite known as Graphene. Firstly, the authors submitted the paper to Nature and it was rejected. Then, the authors made a minor revision in the paper and submitted to Science and it was published. Within 5 years after the publication of this paper, Nobel prize was awarded." This kind of rejections will be covered in another post.

But, here we are going to see so many examples where peer-review system is not that bad.




Challenge and Fun: Free your mind!

Fortran Workflow

Fortran Specification Statements

by Michael Metcalf / CERN CN-AS
(taken from https://w3.pppl.gov/~hammett/comp/f90tut/f90.tut7.html
For a complete list of Fortran tutorial link and other useful links, look at
https://w3.pppl.gov/~hammett/

Implicit typing

The imlicit typing rules of FORTRAN 77 still hold. However, it is good practice to explicitly type all variables, and this can be forced by inserting the statement
        IMPLICIT NONE
at the beginning of each prorgam unit.

PARAMETER attribute

A named constant can be specified directly by adding the PARAMETER attribute and the constant values to a type statement:
     REAL, DIMENSION(3), PARAMETER :: field = (/ 0., 1., 2. /)
     TYPE(triplet), PARAMETER :: t =                           &
                                triplet( 0., (/ 0., 0., 0. /) )

DATA statement

The DATA statement can be used also for arrays and variables of derived type. It is also the only way to initialise just parts of such objects, as well as to initialise to binary, octal or hexadecimal values:
       TYPE(triplet) :: t1, t2
       DATA t1/triplet( 0., (/ 0., 1., 2. /) )/, t2%u/0./
       DATA array(1:64) / 64*0/
       DATA i, j, k/ B'01010101', O'77', Z'ff'/

Characters

There are many variations on the way character arrays may be specified. The shortest and longest are
CHARACTER name(4, 5)*20
CHARACTER (KIND = kanji, LEN = 20), DIMENSION (4, 5) :: name

Initialization expressions

The values used in DATA and PARAMETER statements, or with these attributes, are constant expressions that may include references to: array and structure constructors, elemental intrinsic functions with integer or character arguments and results, and the six transformational functions REPEAT, SELECTED_INT_KIND, TRIM, SELECTED_REAL_KIND, RESHAPE and TRANSFER:
     INTEGER, PARAMETER :: long = SELECTED_REAL_KIND(12),   &
                       array(3) = (/ 1, 2, 3 /)

Specification expressions

It is possible to specify details of variables using any non-constant, scalar, integer expression that may also include inquiry function references:
     SUBROUTINE s(b, m, c)
        USE mod                                 ! contains a
        REAL, DIMENSION(:, :)             :: b
        REAL, DIMENSION(UBOUND(b, 1) + 5) :: x
        INTEGER                              m
        CHARACTER(LEN=*)                     c
        CHARACTER(LEN= m + LEN(c))           cc
        REAL (SELECTED_REAL_KIND(2*PRECISION(a))) z

PUBLIC and PRIVATE

These attributes are used in specifications in modules to limit the scope of entities. The attribute form is
     REAL, PUBLIC     :: x, y, z           ! default
     INTEGER, PRIVATE :: u, v, w
and the statement form is
     PUBLIC  :: x, y, z, OPERATOR(.add.)
     PRIVATE :: u, v, w, ASSIGNMENT(=), OPERATOR(*)
The statement form has to be used to limit access to operators, and can also be used to change the overall default:
     PRIVATE                        ! sets default for module
     PUBLIC  :: only_this
For derived types there are three possibilities: the type and its components are all PUBLIC, the type is PUBLIC and its components PRIVATE (the type only is visible and one can change its details easily), or all of it is PRIVATE (for internal use in the module only):
     MODULE mine
        PRIVATE
        TYPE, PUBLIC :: list
           REAL x, y
           TYPE(list), POINTER :: next
        END TYPE list
        TYPE(list) :: tree
        :
     END MODULE mine

USE statement

To gain access to entities in a module, we use the USE statement. It has options to resolve name clashes if an imported name is the same as a local one:
     USE mine, local_list => list
or to restrict the used entities to a specified set:
     USE mine, ONLY : list

Compiling C, C++ and Fortran code using gnu/intel compilers

In general, compiling is done in three steps.

./configure --prefix=/home/userName/DirName
make or make all

Sometimes, the compiling error in a large code will be huge and may not be displayed in a single screen. It may be better to save the compiling error in a text file. This can be done using

make &> file.txt
or
make all &> file.txt


Notes on Linear Algebra

I have been taking Linear Algebra LAFF course from edX and Applications of Linear Algebra (Part 1) also from edX.

This page is for discussing what I learn, links to videos, books, web pages, articles related to linear algebra.

Useful resources for learning linear algebra:
Essence of Linear Algebra (Video playlist from 3Blue1Brown YouTube Channel)
What is the point of linear algebra? (from Reddit)
Coding the Matrix Resources (contains python scripts)
Auto-grading for Coding the Matrix (contains python scripts)
Mathematics for Machine Learning: Linear Algebra (from Coursera)
LAFF - Linear Algebra: Foundations to Frontiers (course from Edx)

Before reading anything related to linear algebra or taking courses, I would recommend you to watch all the videos from 3Blue1Brown channel on the essence of linear algebra. Again, after taking the Coursera and edX courses, if you watch the YouTube videos, you can understand linear algebra completely. 

Now I try to explain what is a simple use (or motivation for LA) of linear algebra.

Suppose, you are going to a shop on some day and by 5 apples and 10 mangoes and you pay 20 dollars and return to home. But you don't know how much each apple and mango costs. On another day (assuming the price is same) and buy 30 apples and 2 mangoes. Now you pay 15 dollars. Now also you don't know the value.  Now, using the number apples and mangoes you bought each time, and knowing how much those costed, you can calculated the cost of each apple and each mango.

You may ask "How"?

The answer is "Using Linear Algebra".

What you have to do is that you consider apple as x (or any alphabet you want) and mango as y you can construct an equation as follow.

"\begin{pmatrix} x & y \\ z & v \end{pmatrix}"

In math mode:
(5 10) (x)
                  =  (20, 15)
(30 2) (y) 

If you solve this linear equation, you will get the price of apple and mango.



How to understand an existing complete (open source) code

Here are some of the good discussions on this topic. See at the end of the tips for more links.
  • If the code is written in a language you are not familiar with, then take a crash course on that particular language. If you are good at any programming language, you can easily learn most of the programming languages easily.
  • Use mind map to learn about the different modules used in main program, where each module is defined, different call functions in each modules, where they are called, where they are defined, what each modules, functions do, what are the external (used defined) functions, what are the user defined data types in this code etc.
  • You should also have a general idea about what the code does actually. What are the inputs, what are the outputs, what the code does, what are the algorithms used, etc.
  • If you think that some portion in the open source may be shortened (for more readability or more efficiency), you may try it and ask for pull request. This will improve the code as well as you have contributed to the code. In some cases, if you are not sure what to do, but you are sure that something can be done, use Code Review (for improvement of the working code). 
  • For a give module, understand what it does. Then, understand what are the inputs for that module. Then, test that module by giving different inputs.
  • Now, do that for functions. What are the functions used in a given module, what are the uses of those functions, what are arguments, what is calculated, what is returned, how it is calculated etc.
SE Software Engineering site has a good collection of questions and fantastic answers. Here are some of the links for answering the question:
Best practices for understanding/resurrecting old technical code?
What is the most effective way to add functionality to unfamiliar, structurally unsound code?
How do you dive into large code bases?
I've inherited 200K lines of spaghetti code — what now?


Working with BLAS library


To install the BLAS and LAPACK library, you can try:

sudo apt-get install libblas-dev liblapack-dev

This will install both BLAS and LAPACK.

Also you should understand that LAPACK uses BLAS libraries in the backend.

Here is the main page of BLAS.

The BLAS (Basic Linear Algebra Subprograms) are routines that provide standard building blocks for performing basic vector and matrix operations. 

  • Level 1 BLAS perform scalar, vector and vector-vector operations
  • Level 2 BLAS perform matrix-vector operations
  • Level 3 BLAS perform matrix-matrix operations. 

Because the BLAS are efficient, portable, and widely available, they are commonly used in the development of high quality linear algebra software, LAPACK for example.





Now, 
How to know whether BLAS library is installed or not?
OR
How to find the location of BLAS library in linux?

type (on the terminal):

locate libblas.so 

This will return the locaiton as follow if BLAS is installed.

/home/username/libblas.so
/home/username/../../../lib/libblas.so
/usr/lib64/libblas.so.3

(for many computational codes (PySCF, etc), BLAS libraries are essential).




You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...