Thursday, December 3, 2009

arXiv RSS author name problem in Google Reader

I like google reader a lot. But one thing about it makes me very frustrating - it does not display the author name in arXiv RSS feed correctly. Basically, arXiv provides feeds with linked author name, and google reader decides to use the HTML source code instead of parsing it into nicely formatted text.

Well, I just learned that by adding ?version=2.0 to the end of arXiv feed URL solves this problem, i.e.,
http://export.arxiv.org/rss/cond-mat?version=2.0

Thursday, June 18, 2009

Outer: Construct matrix from lists

In Mathematica, a quick way to construct a matrix from lists is through Outer. Let us consider two lists defined as
a={a1,a2,a3};
b={b1,b2};
Then the following command
Outer[f, a, b]
gives a matrix of the form
f[a1,b1] f[a1,b2]
f[a2,b1] f[a2,b2]
f[a3,b1] f[a3,b2]

A practical example is given below. Consider d-band electrons with spins. There are five d-orbitals and two spin states. Suppose orbital and spin stores the orbital and spin part of the state vector. The complete basis can be obtained by
Flatten[Outer[Join, orbital, spin, 1], 1]