If you’re doing a lot of simulations, optimizations or other muckity-muck, it’s easy to start writing down equations with matrices like $$A^{-1}B$$ inside of them. And, depending on the application, it might be a really good idea to precompute this matrix. But there’s that pesky inverse operation, and generally inverting a matrix is a no-no since it can easily land you in trouble when that matrix isn’t really very stable.

So, here’s a trick you can use in these situations to avoid explicitly inverting the matrix $$A$$.  It turns out that instead we can just solve the system $$Ax=b$$ a bunch of times in order to explicitly compute the product matrix $$A^{-1}B$$.

It’s pretty straightforward.  If we want to extract the $$i$$th column from $$A^{-1}B$$, we need to solve the equation $$x = A^{-1}B e_i$$, where $$e_i$$ is the indicator vector with $$0$$s everywhere except the $$i$$th entry, which is $$1$$.  If we just massage this equation a bit, we get $$Ax = Be_i = b_i$$ where $$b_i$$ is the $$i$$th column of $$B$$.  Sweet!  If we have a good way to pre-factor $$A$$ or otherwise prepare it for repeated solves, we can also keep this solution method pretty efficient.

IKEA’s 3-D team is housed in the same building. Faced with a shortage of people capable of doing this work, the company is collaborating with photo schools to teach computer design skills. It is also retraining photographers to better create a scene without a camera. The company said it is retaining all photographers, carpenters and set designers and reapplying their skills to the 3-D environment.

via Paleofuture

This is the fifth post in a series of OpenGL “tutorials” explaining how to get a triangle on your screen using as few lines of code, in as many languages, and on as many platforms as possible.

So, as should be apparent from my last two posts, I’m switching over the front end of my research system to use the Qt GUI framework.  Naturally, since I’m trying out a new platform here, I want to post a simple way to get a triangle up on the screen as quickly as possible.

This is just a quick note on how to get up and running really fast with Qt on a mac.

1. Go ahead and download the installer from the Qt site.
2. Install Qt and note where you created the QtSDK directory
3. Add /…/QtSDK/desktop/…/bin to your shell path.  (This ensures qmake is on the path among other things)

That’s it.  I found a reasonable tutorial here.  BUT, there’s one more slight rub.

If you follow through that tutorial, you’ll see that Qt prefers you to use their own autotool-like cross platform build system.  This usually involves issuing the three shell commands “qmake -project” “qmake” and then “make” in succession.  However, on mac, doing this will get you an app bundle.  What if you still want to be able to print to standard out and launch the program from the terminal in the normal unix fashion?

This can be fixed by editing the project_name.pro file generated when you issue “qmake -project”  Simply add the following line:

CONFIG-=app_bundle

Then the qmake toolchain will generate a nice normal unix program.  If you want to create an app bundle to distribute, just remove the line, and you’ll be all set again.

I just decided to try switching over the front end of my project to Qt.  I was trying to make an immediate mode GUI before, but it turns out that’s actually a terrible idea.  There’s a couple of reasons why:

1. major GUI toolkits have had a lot of people, time, and attention given to them, so they have many more features than you could hope to implement on your own.
2. major GUI toolkits also have a tremendous amount of HCI wisdom and knowledge embedded in them.  If you use a good GUI toolkit, your program will probably be somewhat more usable even if you don’t know the first thing about usability.
3. immediate mode GUIs scale poorly to more complicated interfaces.  They don’t have hierarchical layouts and more complex reactive functionality has to be hand coded.

I figured I should throw something up and warn people away from the siren’s call.

“Cyberspace. A consensual hallucination experienced daily by billions of legitimate operators, in every nation, by children being taught mathematical concepts… A graphic representation of data abstracted from banks of every computer in the human system. Unthinkable complexity. Lines of light ranged in the nonspace of the mind, clusters and constellations of data. Like city lights, receding…” — William Gibson, Neuromancer (1984)

Is TRON a good depiction of cyberspace, Gibson’s “nonspace of the mind”? I’m inclined to say no. Space in TRON is very physical and literal. On “the grid” time and space have their usual relationship: to get from point A to point B requires an amount of time proportional to the amount of space. There are concrete forms, buildings, hallways, corridors.  TRON looks really cool, but it fails to capture much of the essence of computers, the internet or digital interaction.

The problem is that cyberspace is a misnomer.  Almost every attempt to make our online experience spatial has failed.  Chat rooms are not rooms; online “stores” are more like mail-order catalogs; the distance between any two points is the same: a hyperlink.  Despite pervasive use of spatial metaphors, the internet is for all practical purposes simply not a space. Still, the idea of cyberspace persists, an alluring, romantic thought.  What does our massive interconnected network of computers, information, and people look like?  What is its shape, its architecture, its landscape? Read the rest of this entry »

Ben Blum-Smith asked the question I’ve been pondering since my last post

I’m a little confused… if a real matrix is not symmetric, there is no guarantee of a real eigenvector (e.g. take a 2-d rotation matrix), so what did you mean “I expect that other arguments along similar lines are possible for non-symmetric real matrices”?

As it turns out, I’ve been spending quite some time repairing my own understanding of linear algebra.  What I should have said is, I expect to find similar arguments for normal matrices.

Normal is a terrible name of course.  Are other matrices weird? non-conformist?

Unfortunately, I haven’t figured out how to pin down a similarly elementary flavored proof for normal matrices.  Instead, I’m going to present an argument for another branch of the family tree: (so to speak) orthonormal matrices.

But first, I realized my last post might have jumped in a bit too deep all at once, so I’m going to try to err the other way and cover some more basic linear algebra this time as well.  Bear with me and let me define orthonormal matrices before I talk about their eigenanalysis.  I’ll give two definitions and suggest why they’re equivalent.
Read the rest of this entry »

For those of you that have had complex/imaginary numbers tacked onto your curriculum like an aluminum spoiler on a stock Honda Civic, I really think you should teach the Mandelbrot Set.

I’m a firm believer that if you can’t understand some concept without resorting to complex numbers and invoking the fundamental theorem of algebra, then you don’t have a deep understanding of the concept.  This is particularly a problem for teaching undergraduate mathematics (particularly to scientists and engineers), since some of the most crucial techniques—eigenanalysis and Fourier transforms—make heavy use of complex numbers.  The result of the “complex” arguments presented is that most students have a very difficult time with these subjects.  Ultimately, many treat them as magical tools that are hardly worth the time invested to understand.

Such a perspective is of course hogwash.

I know for a fact that a much more geometric (and in my opinion illuminating) interpretation of eigenanalysis is possible.  However, I had never seen a clear exposition from first principles that one could reasonably expect to present in a beginning linear algebra course.  Every explanation of the geometric perspective that I’ve seen has been post-hoc or relied on machinery like Lagrange multipliers—an unwelcome diversion.

I would not be surprised if someone else has come up with this proof before.  However, I was not able to quickly find a reference for it.  It makes no appeals to (a) the characteristic polynomial, (b) matrix polynomials (c) complex numbers or (d) Lagrange multipliers.  I have only treated the real-symmetric case, although I expect that other arguments along similar lines are possible for non-symmetric real matrices. Read the rest of this entry »