Monday, July 20, 2009

Confused by bibtex

Can anyone tell the differences between the two bibtex entries?

A.
@article{jiang_prl00,
author={X. Jiang and C. M. Soukoulis},
title={Time dependent theory for random lasers},
journal={Phys. Rev. Lett.},
volume={85},
year={2000},
pages={70-73} }

B.
@article{jiang_prl00,
author={X. Jiang and C. M. Soukoulis},
title={Time dependent theory for random lasers},
jornal={Phys. Rev. Lett.},
volume={85},
year={2000},
pages={70-73} }

Don't hesitate to protest since there is no difference! But when using the second one I miss the jornal name in the output dvi file. Can anyone kindly point out to me what was wrong?

Sunday, July 12, 2009

FT and FFT

I was thinking of using a spectral method to simplify our CF solver. Since the Fourier coefficients of the dielectric function on a ring of a micro-cavity (e.g. quadruple) is just a step function, the integral can be solved analytically (which means FAST!). But when reconstructing the dielectric function, the result is not as good as I expected: it has fast oscillations of small amplitude, which grows towards the edge of the step function. It doesn't improve much even when I increase M to be 1000. On the other hand, FFT seems to do much better job even with N=200. The difference between the original function and the reconstructed one differ by only 10^-15! But I need to think of a way to deal with the FFT of a product (n^2*\phi). If the angular momentum is cut off at M for \phi, the FT of the product needs the Fourier coefficients of (n^2) upto be 2*M. How to translate that into the FFT? Does it mean the spatial grid points for (n^2) needs to be twice as many of the CF state \phi? I will keep you updated in later posts. Now it is soccer time!

Monday, July 6, 2009

Furious over the slaughter in URUMQI by the duped Uyghurs!

When I first heard about this yesterday, only three people were confirmed dead according the media. So I thought it was just a local confrontation and I wished the situation had been under control. But the death toll mounted to more than 150 as the news coverage spread out, and I was shocked by and furious about the crimes the credulous and manipulated Uyghurs did to the rest of the Chinese people! ONE HUNDRED AND FIFTY SIX PEOPLE DIED, and most of which, if not all, were innocent passerby's! If that number doesn't mean much to you, let me tell you that it is MORE than the TOTAL NUMBER OF DEATHS in the 1921 Tulsa riot in OK (39 died), the 1965 Watts riot in LA (34 died), the 1967 Newark riot (26 die) and the 1992 LA riot (53 died) ALL ADDED TOGETHER! One of my friends was still frightened when talking about the riot in his home town after the assassination of Martin Luther King, Jr. in 1967, and that national wide unrest resulted in the deaths of 39 (34 of which were black, the ones who felt they were treated unfairly). Now compare that to the ONE HUNDRED AND FIFTY SIX PEOPLE KILLED by the criminals who felt they were treated unfairly and you can see how cruel the slaughterers were in the Urumqi riot! Imagine yourself with your wife and kids having a walk after dinner, and hundreds of people with bars, knives and guns were marching towards you, with you being their targets! How was it possible for you to protest your loved ones in this situation even by sacrificing yourself? When the fear and fury turned into desperateness and helplessness, those innocent people left us forever. Let's mourn for them, and in the mean while condemn, denounce, objurgate, and punish the terrorists and traitors who plotted the slaughter! Also EDUCATE the misled Uyghurs not to ruin their own country!

Absorption strength in QCLs

Initially I didn't find the experiment result of the optical properties of GaInAs/AlInAs, and I used the result of AlGaAs instead. Since they are also (III-III) semiconductor alloys, I expect their index and absorption to be at least of the same order. In all the data available, the wavelength is either shorter than 1 micron or longer than 25 microns. But at these two edges the absorption corresponds to an imaginary part of the index of ~1E-2, and that's the value based on which I did the estimate for the 5 microns experiment. Yesterday while I was reading a few earlier papers by the Bell lab group, I'm surprised to find out that they claim Im[n] is of the order of 10E-4, which is way smaller than I expected. With this absorption value I doubt the bowties would never turn on. I am doing the tweaking to see whether I can get some other librational modes to turn on with the same directional emission. If that's possible, that may explain why the threshold spacing is of the same order of the value of the first threshold.

Sunday, July 5, 2009

10 Tips of bibtex

This is copied shamely from http://www.math.uiuc.edu/~hildebr/tex/bibliographies0.html.

  1. Mandatory argument to "thebibliography". The "thebibliography" environment has a mandatory argument, representing the width of the widest label.
    Example: \begin{thebibliography}{99} .... \end{thebibliography}.
    Leaving out this argument causes an error with the rather vague error message "Something's wrong--perhaps a missing \item".
  2. Before running bibtex, run the tex file through latex. The bibtex program needs the "auxiliary" file (with extension .aux) that is produced by latex.
  3. The bibtex program must be run on the auxiliary file of the paper, not the bibtex database. This is a common source of confusion for beginners. If tex and bibtex files for a paper have the same names, say paper.tex and paper.bib, things are simple: the command bibtex paper, where the filename paper is specified without extension, will do the right thing. However, it is important to understand that the file that is processed by bibtex is not the bibtex file, paper.bib, but rather the auxiliary file paper.aux that is generated after the first run through latex. Thus, in the above command the short-hand argument paper is expanded to paper.aux. This becomes significant if the bibtex database has a name that is different from the name of the tex file. For example, if the bibtex database is mybibliography.bib, the appropriate bibtex command is bibtex paper, not bibtex mybibliography, since bibtex needs the file paper.aux, not the (probably non-existing) file mybibliography.aux.
  4. Capitalized words in titles. Words in titles that are to be capitalized (such as proper names) must be protected by placing the first (upper case) letter in braces.
    Example: On {B}anach spaces.
    Note that this applies only to title fields (title and booktitle). In other fields, such as journal names, no lower case conversion is done, so there is no need to protect capitalized words.
  5. Multiple authors. Separate the names of the authors by the conjunction "and", without additional punctuation marks.
  6. Nonstandard author names. For names of authors not in the standard "first last" or first middle last" format, the part representing the last name has to be explicitly marked by surrounding it with braces to ensure that the entry gets correctly alphabetized.
    Example: Jose {Dos Santos}.
  7. Accented characters. Accented characters must be surrounded by braces.
    Example: Erd{\H o}s.
  8. Overriding the default sort order. Bibtex normally does a good job in arranging references in the appropriate order (alphabetically by author, then chronologically); however, unpublished items that do not have a year listed may get placed before items by the same author published earlier. To prevent this and instead have the unpublished work be listed last, add an "invisible" year entry in the record as follows: year = "\setbox0=\hbox{2003}". Similar tricks allow one to override other undesirable orderings.
  9. Including references that are not cited in the paper. Bibtex builds the bibliography from the references that are actually cited in the paper. Including references without corresponding citations is generally a bad idea, but it may be warranted in special situations. To include a reference that is not cited in the paper, but which has a record in the bibtex database, add the command \nocite{xxx} at the end of the paper, just before the bibliography; here "xxx" is the key for the paper to be cited. The command \nocite{*} causes all items in the database to be included in the references, regardless of whether or not they are cited in the paper.
  10. Printing out a bibtex database. To print out all records in a bibtex database, say mybibliography.bib, create and compile a dummy tex file containing the following commands:

    \documentstyle{amsart}
    \begin{document}
    \nocite{*}
    \bibliographystyle{amsplain}
    \bibliography{mybibliography}
    \end{document}

Saturday, July 4, 2009

\t*** in gedit

Today I tried to replace all "N_\phi" with "N_\theta" in a document opened in gedit, and I was surprised to see a bunch of "N heta"s. "Oops!" I thought to myself, "gedit is capable of recognized \t (tab)! What should I do?" Easy my friend (myself rather), and use "N_\\theta" in the replacement field instead.

One side bracket or parenthesis in math mode

The right side is ended with "\right.". Don't miss the "."! When using bracket, remember to use "\left\{" instead of "\left{". Otherwise latex gives the error "missing delimiter".

Friday, July 3, 2009

A good trick: using "array" in math environment for better alignment

In some cases, an equation is long and overlaps with the equation number. One way to overcome this is to wrap the equation in the "array" environment (within the math environment), and the equation number is automatically moved to the next line in its normal horizontal place.

Howto: write a single line equation without a number

The \nonumber command doesn't work in the "equation" environment, but one can use the "eqnarray" environment with \nonumber for this purpose. For better alignment with the rest of the text, don't put any alignment marker & at all.

Thursday, July 2, 2009

Matlab R2009a sucks!

I updated to R2009a and it couldn't even load my old v7.3 mat files. I thought the files were corrupted, so I re-generated one of them. But it simply refused to save the file! It was not that huge (~3gb) and should have no problem being stored in the v7.3 format. Then I tried the "hdf5write" functions to store it in the hdf5 format. You know what? Matlab failed again!

How to get the pstex files generated by xfig to work in latex

To get the pstex generated by xfig to work in latex,

1) remove the "color" package from the declaration at the beginning of the tex/sty file
2) remove the part "\color[rgb]{0,0,0}" or alike in the pstex_t file.