Impact Awards

Posted in Activity 2 months ago

I was at the BC Technology Impact Awards ceremony last week representing my company Zymeworks. Zymeworks was nominated for the most promising pre-commercial technology company, but unfortunately we didn’t win. The award in this category went to Lignol Energy Corp., a clean tech company.

The organizers had tiled one wall of the Banquet Hall with a 100 feet screen. They had calibrated multiple projectors to blend the edges. Pretty impressive. You can get this technology from a couple of companies: here’s one.

Abebooks.com, an online market for new and used books also won an award. I’ve been using this website for the past couple of years to get used textbooks. Highly recommended.

John MacDonald, the founder of MDA (the ‘M’ in MDA) and of Day4Energy Inc. got the Person of the Year award. It’s truly an honor to be in the same room with the accomplished!

Silicon Valley

Posted in Travel 2 months ago

Not. Dead. Yet.

A couple of months back, I got a chance to go to Stanford for a conference. I took the opportunity to visit a couple of my friends in the area. It was a blast!

Though I doubt if they’ll continue to remain my friends: I put almost 400 miles (ugh…metric units) on his car in two days! Living in Mountain View, we visited San Francisco twice, Berkeley once, Stanford twice (or thrice?) We went around almost all major tech companies in the valley.

I’ve heard about a lot of tech companies being in the same area, but I didn’t expect them to be so densely concentrated. As my friend says, “you can change your job without really changing where you park your car!” So true.

One of the things I really wanted to do is to have authentic Mexican cuisine (none of that Taco Bell crap.) We went to two places: La Fiesta in Mountain View and another one I can’t recall in San Francisco (it’s by the beach.) My friend remarked that he has had better, but I’ll have to start somewhere. I’ll be in San Diego and Austin (i.e., closer to the Mexican border) later this year, and I guess I can re-fulfill that wish again.

One of the things that really irked me was how often people pull out their car. Here in Vancouver, I always walk a couple of blocks to the corner grocery store or for breakfast or anything for that matter. For breakfast, we pulled out the car, drove on the freeway, and landed at House of Pancakes. For lunch, we pulled out the car, drove on the freeway, and landed at a restaurant. For buying a razor at Safeway, we pulled….you get the picture.

The SVD

Posted in Computing 6 months, 2 weeks ago

A couple of months back, Prof. Gilbert Strang had come to SFU as part of the distinguished speakers series (as I had written earlier.) After the talk, I got a chance to chat with the guru. I owe a lot of my understanding of linear algebra to his books and his kick-ass animations (check out these eigen-analysis demos,) and so I asked him about the single most important topic in linear algebra. Without hesitation, he immediately responded: “the SVD!”

The Singular Value Decomposition is the swiss-knife of linear algebra. Every matrix Y can be factored into three matrices: U, S, and V as

Y = U S V^t

U and V are orthogonal matrices and S is a diagonal matrix. Some uses of this factorization of the matrix Y: calculating 2-norms, Frobenius norms, ranks, null spaces and ranges, (pseudo)inverses and determinants, and by extension solving systems of equations (exact, over- and under- determined), eigenvalues and eigenvectors, and approximations.

Almost every problem in engineering becomes an optimization problem (as in reducing the error under some norm) and the method of least squares makes extensive use of the SVD.

The stage has been set for the next few posts of mine.

Fitting data with Python

Posted in Computing, Physics 6 months, 2 weeks ago

I’ve recently become a heavy user of the numerical capabilities of Python. I’ve written about my experiments before, but now I’m writing production quality code with numpy and matplotlib.

Mobility Temperature Plot

The above is an actual plot that I created for some Hall measurements I was doing. I was supposed for find functional relationships between temperature and majority charge carriers, which in my case were electrons because of the n-type doping. The simple case was a least squares fit: scipy.optimize.leastsq to the rescue. The more complicated part was solving a non-linear equation for roots and then doing a least squares fit. The root-finding module in scientific python provides lots of options. At this point, I can confidently say that this environment has more features than Octave.

Just today, I wanted to use the Fourier method on a differential equation (plug: the advantages of which are here) and numerical python with fft, fftshift and fftfreq are exact substitutes for their Matlab equivalents. You can also put actual LaTeX equations on plots, which is a major plus.

That is all.

Unit Tests in C

Posted in Computing 6 months, 2 weeks ago

I strongly think that unit tests are absolutely necessary to keep the overall quality of ones code high. I’ve written about Unit Tests before, so I’ll continue on that trend.

Most high performance numerical codes use some variant of Fortran or just raw C (which is my staple language.) In that case, as Micheal Feathers rightly points out, unit tests can “collide” with C.

I’ll want to expand on his solution of link seams.

GNU/Linux (and other Unix-like operating systems I think), provide a mechanism of loading shared object files at runtime. Using dlopen(3) and dlsym(3) you can re-create much of the reflection functionality that the Java community enjoys. So by loading your unit test dynamically at runtime, and having a predetermined symbol that behaves as the entry point, you can nicely wrap your module/function with a unit test. Interface this with ctest from the cmake project, and you are set. If you want to have a private function whose symbol isn’t visible on the outside, make it static. The nm utility will give you a list of public symbols in an object.

I’m pretty sure this is supported across the board. I remember doing this under DOS using DJGPP (remember that?) so this isn’t exactly novel.