Thursday, September 8, 2011

Python Documentation

I’ve recently been trying to reload the quantum mechanics that I learned during my stretch in the physics department at UT, and I ran across a rather cool python package called PyQuante, which contains a variety of useful tools for performing quantum chemistry calculations. It’s my first *significant* foray into python, and I have to say that I’m addicted.

The one huge drawback that I’ve found in dealing with python, though, is that even though there are a huge number of free packages out there for dealing with a wide range of complex tasks, their documentation universally *sucks* compared to similar offerings in other languages. This perception may be related to the fact that I’m a cheapskate and haven’t shelled out for a decent IDE, but the community *seems* to feel that using a commandline “help()” command (behaves similar to *nix ‘man’ feature) is enough to cut the butter. It ain’t. Typing anything besides the direct object of my query, particularly something that has to be syntactically correct in order to function properly, is a huge waste of my time, when compared to the online help systems offered by many other commercial compilers and their packages. Yeah, I’m talking about .NET. Yeah, I’m talking about Borland’s compilers and components. If I remember correctly, I can get it out of eclipse with a php plug-in. Cold Fusion, for all of its flaws, has a decent help system (compared to what I’ve encountered in python).

SO here’s the best solution I’ve found so far (on Win7x64):

- grab nssm so you don’t break a sweat on the next step

- run the PyDoc web server as a windows service. this will get you an html interface to your code library.

- then get a copy of NetGrabber 4.1. you’ll have to obtain a registered version in order to do the next step.

- point NetGrabber at your local web server (e.g. http://localhost:8000), and grab a coffee. note: make sure you drop the thread count down to 1 or 2 during the project setup – the pydoc web server choked hard when I set the thread count to 8.

- after about 20 minutes, NetGrabber will ask you if you want to create a CHM file, to which you answer ‘Yep’.

Open up your new CHM file, and you’ll see that you now have a nice *fast*, *searchable*, cross-linked snapshot of all documentation that your python packages have natively available.

Rock the house.

I should mention here that my copy of python actually came with a fairly extensive help file (in .chm format), to temper my bad-mouthing of python documentation. It does not cover the modules I’ve installed, however, like PyQuante, scipy, numpy, and mdp, which (as I’ve been discovering the hard way) contain many modules that reference one another.

What I really need is something that will resolve references within a source file and make *that* clickable back to the proper *.py module & object definition, though the answer to this might be in my earlier comment about forking out for a decent IDE. Perhaps a static code analyzer.

Cheers!

:-)


Monday, April 4, 2011

I pray too

It’s 4am, and my youngest daughter is fitful. No deep and long dreaming tonight, but I don’t mind. Somewhere between the stress of climbing a flight of stairs every hour in the middle of the night and the happiness of being the Daddy that makes the night feel safe again, there’s a balance that doesn’t seem to allow resentment to exist. I’ll just keep listening to the static hiss of the monitor, and do what I always do in these in-between spaces – continue the endless imaginary conversations I have with people I care about.

Right now, it’s my grandparents. I spent a lot of time with them as a kid, mostly after they’d moved to NY. Before that it was the week or two weeks here and there at their place in MD, but when they moved closer I ended up at their place a lot.

I’ve always felt like a personality mosaic – a jigsaw puzzle composed of the people I’ve spent time with and loved. There was a long stretch of time when I would go to my grandparents’ place after school instead of home, because my parents were working. I loved every minute of the time I spent there – even regular chores seemed fun, and there was always something better around the corner, like a tasty dinner or a quick trip up to the pond to catch a bass or bluegill. They were always to optimistic about me, always made it so clear that they loved me, all the time. They’d bark at me now and then, like a mother dog telling her pups to stop chewing on her feet, but I don’t have a single memory of feeling put down or shaking my metaphorical fist at some unfairness.

So it was a really Good Thing for me, and there are pieces of my soul that I trace directly back to that part of my life – my ability to tie a bowline knot with my eyes closed in under five seconds, my driving style (not everyone sees this as a good thing), my devotion to logical pictures of the World.

A large and important piece of this mosaic: I believe they taught me how to love my best friend – Amy. I think a lot of people have helped to teach me this, and continue to - it’s a very cyclical process – but I wouldn’t know what qualities to respect and emulate if I hadn’t had good role models, and my grandparents are that classic couple that moves easily between being affectionately close, to being co-conspirators, to being an arm for the other to lean upon, and back, in the deepest sense of the vows they took when they were married. They showed me this goal, and it’s one of many things I want to be when I grow up.

--

In my grandparents’ house, we would always pray together before meals, holding hands. I’ve never been a Christian and never prayed by myself, but I almost always participate in others’ prayers to some extent, out of respect for the positive hopes being expressed within them. So when I hear that others have prayed for me, I appreciate the love they’re showing by talking to the highest power they know on behalf of nobody in particular, just me.

It struck me this morning as I thought about my grandparents, wishing I could tell them all of this and infinitely more, wishing them even more strength and patience than they’ve already shown, that there isn’t much difference between what I’m wishing and what I would ask of God.

I guess I pray too.

Every day.

Monday, February 28, 2011

Cleaning House

I see that Providence, Rhode Island has been taking steps to carefully and thoughtfully weed out the teachers in their ranks that are lazy and ineffective. The ‘shoot first and ask questions later’ method is sure to produce excellent results, and improve the overall morale of the teaching staff in that region.

My Question, however, is, “Why stop there?”

If the gross incompetence that seems to lace the teaching profession is such a boil on the derriere of this country’s financial system, and it can be lanced with such ease, why not extend this solution to the remainder of the public sector? Surely there are other types of public servants that are perceived as dead weight on the country’s trek to economic recovery?!

How about policemen? This profession has been riddled with documented corruption and incompetence since before our country even existed. Fire ‘em all! Can’t come back ‘til the lie detector says you’re clean!!

How about sanitation workers, ‘cause heaven knows they could be working faster, better, and cheaper. Fire ‘em all! Let ‘em pass an Army obstacle course before they can come back.

Ooooh! I’ve got a GOOD one!!!

How about our politicians?

Seems to be all the rage right now.

Tuesday, January 25, 2011

The Hollow Argument

I think part of the problems with motivating students (and adolescents/children in general) is that there are a huge range of arguments that adults make, that the younger folk may actually have a valid counterargument for, but are unable to express it because it shows a lack of respect for the adult. An example of this happened today in school, as I was struggling to explain to a student why it was useful / important to complete Living Environment labs, and one of the immediate arguments that came to mind was that “You need it to graduate”. This is a circular argument, which kids can intuitively spot in a heartbeat –

Student: “Why, as an adult, do you feel that it’s important for me to take this class?”

Teacher: “Because you need it to graduate.”

Student: “Why do I need to graduate?”

Teacher: “Because the State mandates it.”

Student: “Why does the State mandate that I must graduate from high school?”

Teacher: “Because they feel that an education is the foundation necessary to become a functioning part of our society.”

Student: “How did they arrive at this conclusion?”

Teacher: “It was voted into Law by our government.”

Student: “So, if I may paraphrase, a group of adults representing a larger group of adults voted this mandate into Law because they felt that it was important for me to have this education before entering the adult world?”

Teacher: “Yes.”

Student: “And if I may simplify my prior statement, it’s because a group of adults felt that it was important?”

Teacher: “Yes.”

Student: “So you, an adult, are telling me that the reason it’s important for me to take this class, is because a group of adults felt that it was important to take this class?”

Teacher: “Oh.”

Now, most students would tend to keep it at a less detailed level:

Student: “Why, as an adult, do you feel that it’s important for me to take this class?”

Teacher: “Because you need it to graduate.”

Student: “That sounds like bullsh*t to me…”

--

Oh well. Gotta find some more authentic reasons…

Saturday, January 22, 2011

Tangled Invitation

Just read a Wired article on the potential for forward-only time travel using quantum entanglement. Cool article, lays it out cleanly even for those that don't know a ton about quantum mechanics. Based on what I know of this field, and what I know about quantum entanglement, I totally buy this argument - I think it's completely reasonable, and almost obvious to those that happen to look in that direction.

Here's the quick idea - two particles (typically photons) can be created so that in some ways they act like one, until they are measured in a particular way, at which point one takes the 'positive' value, and one takes the 'negative' value. If they aren't both measured the same way, then they aren't guaranteed to be mirror images of one another, and so the act of measuring an entangled photon in Guam is actually impacting (instantly) the value of measuring its entangled sibling in Bermuda. This behavior is pretty well established in the scientific community, lots of experiments that confirm this behavior, lots of theoretical support for this behavior, etc. The thing that all of these experiments have in common, however, is that they separate the two photons by a certain amount of space. What the scientists in this article demonstrated was what happens if the particles are separated in time, or rather that it was actually possible to create a situation where two entangled particles were separated by time, not space. What you then end up with in that scenario is the ability to teleport quantum information from one end of that linkage to the other. (caveat - I'm only part of the way through the arxiv article)

So that got me to thinking (we are in Completely Unsupported Bullshit Land, btw) - if you can entangle the past to the future, it seems like you could reverse that effect: measure the future particle "first", which would cause the entanglement to collapse "before" the "older" measurement, which could then allow you to teleport a quantum state backwards in time.

There would be a catch - the entanglement has to be generated from the "older" point in time, and at that point you don't know what information might be sent back, so you'd have to generate the "carrier states", read them and reconstruct a quantum state on the *assumption* that one was teleported back from whatever the future target time was, and see what you get. Sort of like sending a self-addressed, stamped envelope into the future and seeing what was sent back.

Assuming you manage to engineer all of the kinks out of that process, including the reminder to send something back in time, 15 minutes from now (instead of grabbing that coffee you needed), then you've just created a way to directly evaluate the 'multiverse' theory of time evolution.

some scientists believe that every possibility of every decision actually takes place, and results in multiple universes in which each of those possibilities is played out. some believe that the universe is neatly buttoned up, and you are simply unable to do something that would violate the self-consistency of the decisions that have and will be made. This is hard to envision until you start thinking about time travel. Maybe just watching "Back To The Future" (parts 1-3) would give plenty of explanation: if you go backwards in time and convince your mother to be a nun, would you suddenly disappear, would you continue to exist as this alternate story played itself through without your birth, or would history somehow "heal" itself by finding some other means of causing your birth?

With this 'backwards in time' setup, you could measure that directly -when you send an invitation into the future, then the reception of information back from the future could alter that future. if the future disappears / changes sort of 'instantaneously' based on changes in the past, then that should tend to disrupt the ability to receive a coherent message back from that future. For example, I receive a string of numbers from the future that looks like a lottery number, I'm going to suddenly stop focusing on science and get my ass to the nearest gas station to try that sucker out. If it was legitimate, then I might be to hungover the next day to go to the lab and send that number back to myself. Heck, I might have taken a sudden trip to Bermuda. If the future is changing based on my having won the lottery, then it seems like it would be difficult to receive (at the very least) more information after that lottery number, since that was the information that would *cause* the future to change drastically, but possibly even getting *close* to the completion of that number would cause oscillation among the possible futures, some of which sent the message back to me, some of which did not. Sort of like talking to a multiple personality individual whose personality switches were triggered by the word "the". Pretty much any conversation with this person cause multiple switches, and really hamper their ability to participate in the conversation.

Bottom line, is that if we ever demonstrate this effect in reality, and if my conjecture regarding the ability to send information backwards is accurate, then the ability to receive a clean signal from the future would significantly weaken the multiverse theory, while the inability to receive a clean signal would support the multiverse theory.