Least Action

Nontrivializing triviality..and vice versa.

An inexpensive way to connect an HDMI screen to a Macbook

leave a comment »

I am not a huge Mac fan, but I do happen to have access to a Macbook Air, and since I find it hard to carry two laptops, a tablet and at least 5-6 books daily, I wanted to figure out a cheap way to get my Macbook Air to work with my HP Pavilion 27xi HDMI monitor. After some research, I went ahead and purchased an AmazonBasics Mini DisplayPort (Thunderbolt) to HDMI Adapter cable for about $10. There are many more cables available on Amazon, and most of them are much more expensive. But they’re all manufactured in roughly the same areas of our planet, so I wasn’t convinced about buying a costlier adapter especially for something I wouldn’t be heavily relying on. But this adapter is very nifty and works well.

The only other problem was to get the resolutions to match. For this, click on the leftmost button on the touch-activated panel of the HP Pavilion 27xi monitor. A menu opens up. Use the third soft key from left (with a “-” symbol) to navigate down to Image Control. When Image Control is highlighted, tap on the leftmost soft key again. Now, select Custom Scaling and press the leftmost soft key. Then, select Overscan and select “Off”. This should eliminate the problem of screen contents on the HDMI monitor being chopped. In my case at least, the default setting (Auto) does not work well with the Macbook Air I am working on.

Written by Vivek

November 6, 2014 at 21:53

Posted in Electronics

Tagged with , , ,

Divergence Theorem in Complex Coordinates

leave a comment »

The divergence theorem in complex coordinates,

\int_R d^2{z} (\partial_z v^z + \partial_{\bar{z}}v^{\bar{z}}) = i \oint_{\partial R}(v^z d\bar{z} - v^{\bar{z}}dz)

(where the contour integral circles the region R counterclockwise) appears in the context of two dimensional conformal field theory, to derive Noether’s Theorem and the Ward Identity for a conformally invariant scalar field theory (for example), and is useful in general in 2D CFT/string theory. This is equation (2.1.9) of Polchinski’s volume 1, but a proof is not given in the book.

This is straightforward to prove by converting both sides separately to Cartesian coordinates (\sigma^1, \sigma^2), through

z = \sigma^1 + i \sigma^2
\bar{z} = \sigma^1 - i \sigma^2

\partial_z = \frac{1}{2}(\partial_1 - i \partial_2)

\partial_{\bar{z}} = \frac{1}{2}(\partial_1 + i \partial_2)

d^2 z = 2 d\sigma^1 d\sigma^2 = 2 d^2 \sigma

and using the Green’s theorem in the plane

\oint_{\partial R}(L dx + M dy) = \int \int_{R} \left(\frac{\partial M}{\partial x} - \frac{\partial L}{\partial y}\right) dx dy

with the identifications

x \rightarrow \sigma^1, y \rightarrow \sigma^2
L \rightarrow -v^2, M \rightarrow v^1

There is perhaps a faster and more elegant way of doing this directly in the complex plane, but this particular line of reasoning makes contact with the underlying Green’s theorem in the plane, which is more familiar from real analysis.

If I were a Springer-Verlag Graduate Text in Mathematics….

leave a comment »

If I were a Springer-Verlag Graduate Text in Mathematics, I would be William S. Massey’s A Basic Course in Algebraic Topology.

I am intended to serve as a textbook for a course in algebraic topology at the beginning graduate level. The main topics covered are the classification of compact 2-manifolds, the fundamental group, covering spaces, singular homology theory, and singular cohomology theory. These topics are developed systematically, avoiding all unecessary definitions, terminology, and technical machinery. Wherever possible, the geometric motivation behind the various concepts is emphasized.

Which Springer GTM would you be? The Springer GTM Test

Written by Vivek

October 10, 2014 at 17:52

Posted in Uncategorized

Calligraphic symbols in LaTeX

leave a comment »

If you’re unhappy with the way the standard amsmath/amssymb packages display a caligraphic L, and you want a more curly/loopy L for your Lagrangian density, then here’s a way out.

1. Install the package texlive-calrsfs. I had to run “yum install texlive-calrsfs” as superuser to accomplish this on Fedora 20.

2. Declare the following headers above your document



3. The more loopy version of L is now mapped to \La, whereas the conventional version is \Lb.

Hope this helps!

Adapted from: http://tex.stackexchange.com/questions/69085/two-different-calligraphic-font-styles-in-math-mode

Written by Vivek

July 18, 2014 at 10:35

Posted in LaTeX, Linux

The Yang Mills Field Strength: a motivation for differential forms

leave a comment »

Although their importance and applications are widely recognized in theoretical physics, differential forms are not part of the standard curriculum in physics courses, except for the rare mention in a general relativity course, e.g. if you have used the book by Sean Carroll. In this blog post, we describe the construction of the field strength tensor for Yang Mills Theory, using differential forms. The derivation (which is based on the one given by Tony Zee in his QFT book) is elegant, and mathematically less tedious than the more conventional derivation based on the matrix gauge field. It also illustrates the power of the differential forms approach.

To begin with, let me define a normalized matrix gauge field A_\mu which is -i times the usual matrix gauge field. So in the equations that appear below, the covariant derivative has no lurking factors of -i. This greatly simplifies the algebra for us, as we don’t have to keep track of conjugations and sign changes associated with i. The covariant derivative is thus D_\mu = \partial_\mu + A_\mu in terms of this new gauge field. The matrix 1-form A is

A = A_\mu dx^\mu

So, A^2 = A_\mu A_\nu dx^\mu dx^\nu. But since dx^\mu dx^\nu = -dx^\nu dx^\mu, only the antisymmetric part of the product survives and hence we can write

A^2 = \frac{1}{2}[A_\mu, A_\nu] dx^\mu dx^\nu

We want to construct an appropriate 2-form F = \frac{1}{2}F_{\mu\nu}dx^\mu dx^\nu from this 1-form A. Now, if d denotes the exterior derivative, then dA is a 2-form, as is A^2. These are the only two forms we can construct from A. So, F must be a linear combination of these two forms. This is a very simple, and neat argument!

Now, the transformation law for the gauge potential is

A \rightarrow U A U^\dagger + U dU^\dagger

where U is a 0 form (so dU^\dagger = \partial_\mu U^\dagger dx^\mu). Applying d to the transformation law, we get

dA \rightarrow U dA U^\dagger + dU A U^\dagger - U A dU^\dagger + dU dU^\dagger

where the negative sign in the third term comes from moving the 1-form d past the 1-form A. Squaring the transformation law yields

A^2 \rightarrow UA^2 U^\dagger + U A dU ^\dagger + U dU^\dagger U A U^\dagger + U dU^\dagger U dU^\dagger

Now, $UU^\dagger = 1$, so applying d again to both sides we get U dU^\dagger = -dU U^\dagger. So, we can write the square transformation law as

A^2 \rightarrow U A^2 U^\dagger + U A dU^\dagger - dU A U^\dagger - dU dU^\dagger
whereas if we recall the expression for the transformation of dA, it was just
dA \rightarrow U dA U^\dagger + dU A U^\dagger - U A dU^\dagger + dU dU^\dagger

Clearly if we merely add A^2 and dA, the last 3 terms on the RHS of each cancel out, and we get

A^2 + dA \rightarrow U(A^2 + dA)U^\dagger

which is the expected transformation law for a field strength of the form F = A^2 + dA:

F \rightarrow U F U^{\dagger}

The differential form approach uses compact notation that suppresses the Lorentz index \mu as well as the group index a, and gives us a fleeting glimpse into the connection between gauge theory and fibre bundles.

For a gentle yet semi-rigorous introduction to differential forms, the reader is referred to the book on General Relativity by Sean Carroll.

Written by Vivek

June 11, 2014 at 10:53

From engineering to physics graduate school

leave a comment »

This blog post is about switching to physics graduate school, when you do not have a physics undergrad per se, but something like an engineering degree. I have been meaning to write this post for years, as I never found one myself when I was trying to figure things out for myself. In some sense, this is a personal chronicle of my experiences, opinions and beliefs which have been shaped over the past 8 years or so. Before I proceed though, I should warn readers that I am by no means an authority on either physics graduate school, or this particular career path. I cannot also say with any degree of finality that things have worked out optimally for me. This is also not a philosophical career advice post, and at this point, I have no intention to adapt it to different kinds of individuals who may have different tastes, inclinations or backgrounds. Ultimately, and I cannot emphasize this enough, no advice is good advice.

1. First advice; don’t!

Physics is a challenging and tricky subject that requires a lot of dedication and focus. I dislike the use of the term “genius” because while there are luminaries and experts in physics, use of this term suggests that it is possible for some people to do nothing and yet do extremely well in physics. This is deceptive. I believe everyone you see who is really very good has worked hard in his or her own way by solving lots of problems, understanding things properly and patiently, and persisting. Some people require less time, but it is incorrect to say that they do not have to work hard to achieve the same amount as someone else because they are geniuses.

But having said that, physics isn’t for the weak-hearted (nor is engineering actually, but there’s a greater commercial value associated with it, so it manages to attract more weak-hearted and feeble souls than the pure sciences do). Switching to physics is going to be a rocky road and if you are putting off physics for practicality so that you can do engineering (or something else) now and “always switch to physics later”, this is a bad idea. There are exceptions, which this post is about, so we’ll get to them later.

Why do I say this? Well, that’s because physics has several foundational pillars which you really can’t do without, and a patchy education means you will spend many years gathering confidence and learning things which you ought to have learnt systematically through courses and books. So the bottom line is if you are into physics because of the popular science books on dark mater and string theory, then you are either in for a rude shock or you’re being misled. So start reading real physics books!

Also, be advised that you will probably not have a lot of time for “hobbies” and for doing things like playing guitar and skydiving and fixing radios and watching all your favorite movies and TV shows all at the same time. You could have done all of that as an undergrad (perhaps even a physics undergrad at a less demanding college) and yet managed to scrape through by studying at the last minute. But progress in the long term will demand some major task scheduling. And yet, I should add that a lot of very enthusiastic, excellent and bright people I know do manage to do all these things and also pace their physics work. So yes, its more of how you manage yourself.

2. Enroll in physics courses in your undergrad.

Reading books by yourself is a good idea, but there is a reason why courses are more effective in getting you started: they expose you to the 40% or so of the things you can find in a book, but with discipline. You attend classes, work out problems in homeworks, take exams (okay, not the best thing in the world), and more importantly, discuss with peers and your professors.

3. Take core courses seriously

There is a lot of physics in engineering courses, more than you may realize. If you are a mechanical engineer, you have excellent opportunities to learn about stress tensors, Lagrangians and Hamiltonians, thermodynamics and some statistical mechanics, etc. If you are an electrical engineer, semiconductor device physics is a playground for statistical mechanics, solid state physics and even some quantum mechanics (these days, with people in engineering research playing with things like NEGF and simulations, “some” is an understatement). There’s a lot of physics and classical mechanics in particular, in things like linear systems analysis, control system theory, and of course, RF and electromagnetism. From a practical standpoint, doing badly in engineering courses, and better in physics courses only shows lack of commitment and not physicsy brilliance.

4. Take courses on Classical Mechanics, Quantum Mechanics, Electromagnetic Theory and Statistical Mechanics

You may be able to impress people with fancy courses like quantum field theory and particle physics as an undergrad, but everyone who does any serious physics knows the importance of the four pillar courses. A good foundation in Classical Mechanics at the level of Goldstein, is more vital to a good understanding of QM, SM, EMT and even more advanced courses. I don’t have a “below Goldstein” suggestion if you didn’t do calculus in high school (in India calculus is taught in the 11th year of school, and every science student knows a good deal of calculus irrespective of whether he/she does science or engineering). But Giancoli’s books are good to finish off by the end of your freshman year if you haven’t done so before (I personally read them in 11th and 12th grade, but that’s because of the Indian system). There’s also a very tried and tested book on Mechanics by Kleppener and Kolenkow from MIT, which is worth checking out. For a first course in Quantum Mechanics, I strongly suggest being able to do almost every problem of Griffiths’s book, but for a text there is no dearth of choices. I recommend having a good library of all the ‘standard’ books (these days you can get ebooks, but its probably a good idea to have hard copies nonetheless) like Shankar, Griffiths, Sakurai, Cohen-Tannoudji, Powell and Crasemann, Townsend, Merzbacher, Gottfried to name a few. For Statistical Mechanics, I believe Reif’s two books (the non-Berkeley series one as well as the Berkeley series one), Thermal Physics by Schroeder, and of course Pathria are good choices, though over time other books such as the one by Kubo have emerged as options too.

For EM, I suggest reading Griffiths cover to cover definitely, and working out as many problems as you can (ideally, all). This will form a great foundation for starting that Bible of EM called Jackson. Something I’ve realized in graduate school is that almost everyone (including wannabe serious physicists) hate electromagnetism. This came as a surprise to me as an electrical engineering undergraduate, because EM for me was one of the most important courses, and it was taught in a way that I couldn’t dislike it. So, for me doing Jackson problems — albeit in a very limited way given the time constraints of first semester in grad school — was fun. I could not understand why electromagnetic theory, which gives you quick returns in the form of visualizable, sensible, physical predictions, and is a good way to flex your muscle with special functions, mathematical methods, computer programming, etc. is loathed so much. I can find two reasons: (a) lack of time, (b) an enormous negative reputation built up by generations of practicing physicists, graduate students. Of course, Jackson problems are hard, and you will probably benefit a lot from discussing them (instead of just looking up solutions off the web). But this is somewhere you can make yourself different from the herd. That of course doesn’t mean you should keep Jackson’s book under your pillow and have sleepless nights filled with Bessel function integrals in your head. You could choose the former, or the latter.

There is also a very nicely written graduate textbook on EM Theory by Andrew Zangwill, which is also definitely worth checking out. Having used it alongside Jackson, I will say that it complements Jackson very well, though having never taught the course or developed enough conviction about it to say such things, I cannot opine on whether it can be an adequate replacement for Jackson, which remains a source of challenging problems and insights.

5. Improve your programming skills, get familiar with Mathematica, Python, C, Matlab, etc.

6. Take difficult courses after doing the foundational courses

It helps to develop more experience by challenging yourself by taking tougher courses in theoretical physics, even if you want to end up doing experiments later. For one, it teaches you the importance of the core courses, and provides you room to apply the skills you learnt in those courses. But it also exposes you to a wider range of physics, and sometimes even some research.

7. Do research

If you end up in your sophomore or junior year as an engineering student who can’t wiggle out and do some physics, do not restrict yourself to reading books and spending time watching popular science expositions of string theory as a theory of everything which will solve global hunger and malnutrition. Instead, do research, take on projects even if they are in engineering topics. To a mature mind, there is no fundamental distinction between physics and engineering. Graduate schools and professors prefer students who have had some research exposure and possibly not even stellar grades over students who have perfect grades but have not proven themselves in an environment outside their comfort zone.

8. Form discussion groups with likeminded students, have blackboard talks, be involved, ask lots of questions! No question is a stupid question, and we all started somewhere. Hopefully people are not born knowing what supersymmetry is! I have learnt more by talking to friends doing different kinds of physics and engineering, than I have by merely reading books and following the internet.

There are of course, other administrative things like taking GREs, recommendations, etc. but I feel those are important yet clerical enough for you to be able to find adequate (and more expert) comments and treatments across the web, and hence I don’t think they merit an inclusion here.

Written by Vivek

May 24, 2014 at 11:00

NVIDIA CUDA on Fedora 20 x86-64 with NVIDIA Optimus

leave a comment »

So after weeks of experimentation, and frustration, I think I have finally gotten CUDA to work on my MSI GE 70 2OE-071 laptop. As you may know, NVIDIA Optimus is a technology that enables power-sharing and switching between Intel HD and NVIDIA GPUs on laptops. For some reason, MSI and some other manufacturers have disabled the option to disable Optimus technology from within the BIOS. Now as far as I know, Linux has shaky support for Optimus, and while I had no trouble with any Linux distro on my previous Dell XPS laptops (which did have Optimus) I just couldn’t get NVIDIA discrete graphics to work on my MSI “gaming” laptop, which is a shame, because much of my work involves (or has involved) the use of CUDA, and I am not eager to spend my programming time on Windows.

This is not an exhaustive guide, and I invite suggestions and corrections from users who may stumble upon this blog post. I tried to reproduce the scenario on my own laptop in order to make sure I didn’t miss anything.

Typically there are six stages in NVIDIA CUDA installation on Linux:

1. Get rid of the nouveau driver if you are installing the proprietary NVIDIA driver by hand.
2. Reboot, get to a text mode (sadly, init doesn’t work anymore, so if you’re a old Unix user like me, you have to google this up before you start playing with your system).
3. Install the NVIDIA device driver.
4. Reboot, make sure a basic X configuration works (known as the “graphical mode” nowadays).
5. Install the CUDA toolkit, and set PATH and LD_LIBRARY_PATH variables.
6. Compile CUDA samples.

Now I believe much of the errors you will face in steps 1 through 6 are from a partial understanding of the way the X Server and Linux work, and that is based on my own experience. Playing with Linux can be a humbling experience even for someone who has used it for over a decade! But this is quite a lot of fun if you can document everything, and remember what you did to get something to work. It also helps if you have a system to play with, so if you have issues with installing and re-installing the OS n times before you can get to perfection, then this guide isn’t for you. Sorry!

Stuff I had to get to run the CUDA samples:
gcc-g++ in Fedora
libXmu-devel in Fedora (this installs the libXmu libraries)


Written by Vivek

April 20, 2014 at 19:16

Posted in CUDA, Linux, Programming


Get every new post delivered to your Inbox.