Thursday, August 18, 2022

My First Quantum Computer Program

I ran my first program on a quantum computer, today.

I've run programs on quantum computer simulators in the past, but today was the first time I ran a program on an actual quantum computer. It wasn't anything special – my program simply simulated a coin flip. I guess that's the Hello World equivalent on a quantum computer.

About a year and a half ago, I gave a presentation on quantum computing, which has always fascinated me. However, quantum computing is a lot like nuclear fusion or bitcoin in that it's not yet practical. We can see that these technologies are real and feasible, but they'll require some more engineering, both technically and socially, for them to be in widespread use.

Currently, quantum computers are at the stage that personal computers were in the early 1970s. The design and engineering involves circuits. Next step will be programs and then practical applications.

What I Did

Today's program emulated a coin flip by passing a qubit through a Hadamard gate which puts the qubit into a superposition state. A Hadamard gate takes a qubit as input and its output has a seemingly random 50/50 chance of being |0> or |1> when measured. But what's fascinating about a Hadamard gate is that, if you take the output of from a Hadamard gate and pass it through another Hadamard gate then the qubit will always return to its original state.

My code snippet: Simulating the flip of a coin on an actual quantum computer

How I Did It

Like a true script kiddie, I followed a YouTube tutorial. I literally stopped the video when Toby showed her code, took a screen shot, imported the screen shot into the Apple Photos app, and then I copied and pasted the code from the photo into my web based text editor on IBM's Quantum Lab. The code I wrote was in Python utilizing the Qiskit SDK and it was free to run on IBM's system; a bargain at twice the price.

Monday, August 15, 2022

Stolen Catalytic Converter

My exhaust pipe, sans my catalytic converter

My catalytic converter was stolen two months ago.

I immediately knew it when I started the engine on my Honda Accord – it sounded like a Harley at red line. Coincidentally, my sister, who lives nearly 3,000 miles away, had her catalytic converter stolen from her Accord a few weeks later.

Thieves steal catalytic converters because they're easy targets under the chassis – there's no alarm or cage around them and they contain valuable precious medals like platinum, palladium, and rhodium. A replacement catalytic converter typically runs around $1,000. When you add in the labor, the price ends up over $1,500. My insurance company's bill came in over $2,000 out of their pocket when including the towing and car rental.

Replacing a catalytic converter isn't as simple as replacing other car parts, especially with California's anti-smog requirements. (If you've ever smelled the difference between the exhaust from a modern car and one made before 1975 then you've noticed the smog filtering effects of a catalytic converter.) New catalytic converters replacement parts are scarce because of the increase in thefts.

In California, catalytic converters have to be approved for different car models. Every two years, I have to pay about $60 to have my Accord smog checked. This was never a problem until today when the smog inspector told me that my catalytic converter was "illegal in the state of California." The new, aftermarket, catalytic converter installed on my car did not match the approved family of catalytic converters according to the "Vehicle Emission Control Information."

In order to rectify this discrepancy I had to "Ask the Referee" if my catalytic converter was a suitable substitute. This entails making an appointment, typically two weeks in the future, for a free inspection to see if my catalytic converter passes muster. While the appointment is free, the penalty for missing an appointment is a 60-day delay until I could reschedule my next appointment; a very unfavorable situation since my registration expires in 42 days, which requires passing a smog check.

Fortunately, I lucked out when I called the referee since I was able to get an appointment, due to a cancellation, 90 minutes later today, with the stringent warning to not be late and the understanding that same-day cancellations would cost me a 60-day delay in rescheduling.

Although the inspection site was difficult to find because it was on a college campus which, like a military base, doesn't have buildings with GPS'able street addresses. But, in the end, it all worked out for me. That wasn't the case for the car owner ahead of me whose catalytic converter wasn't a suitable substitute. As soon as I received the sticker on my car door approving my catalytic converter, I returned to the same smog inspection station from earlier in the afternoon and passed my inspection. Now, the last step is for the California DMV to send me my new vehicle registration. 

Thursday, August 4, 2022

The Concept of Time

La Muse Verte Absinthe: A birthday gift to myself

Time is the school in which we learn,   
Time is the fire in which we burn.

On today, my birthday, I can't help but notice the passage of time.

But what is time? – I ask this question in a physical sense, not philosophically or metaphysically. 

There are certain realities of time. While it is relative to space and energy, it moves at an absolute pace in any given frame of reference. Whether I'm here on Earth or outside an event horizon or traveling near the speed of light, time will always pass at the rate of one second, every second. In other words, when I look at my wristwatch, time will run perfectly normal, regardless of my motion.

We speak of time as being a fourth dimension of space, i.e. spacetime, but it's not "real" like the three dimensions of space. Rather, time is an emergent property. While we observe, in our personal experiences, cause and effect such as a glass breaking, we don't see that same, one way flow, at the subatomic level.

This is similar to ocean tides on Earth. There is no physical "tide property" of water. Tides only emerge when we collect a lot of it and introduce other forces such as gravity from the sun and moon along with the Earth's rotation, i.e. it's an emergent property. 

What is Time?

Time is literally nothing more than the passage of events – it's neither energy nor physical. Think of it as hole flow in an electrical circuit. We measure time by the ticking of a watch's second hand. Imagine the universe's clock as the motion of atoms, such as an electron orbiting an atom's nucleus. The motion of matter marks time similar to a computer's clock ticking off cycles for the CPU. Different computer clocks move at different rates, and time also moves at different rates depending on how much energy is around it. In your frame of reference, a watch's second hand will always tick away one second, every second, no matter if you're at rest or moving close to the speed of light.

In the presence of huge amounts of energy, time literally slows down, from the perspective of an outside observer. This is simply due to the atoms, in the presence of large amounts of energy, struggling to move through this energy molasses. But, since all the atoms in this frame of reference experience the same slowing, everything looks normal. Imagine if all the clocks and watches (and atoms) in your home slowed down because they had dirt or grit in the "gears" – everything would continue to seem normal even though things are moving slower. But, to an outside observer, your passage of time would be different.

Time Travel?

So, is time travel is possible? Absolutely not. You can slow down how fast time passes, but that's about it; you can't speed it up. The concept of traveling through time to a different period makes as much sense as traveling through tides (or love, etc). While we know what causes the flow of the time or tides, it is, as I mentioned earlier, an emergent property. 

For time travel to be possible, every particle in the universe would have to move in the opposite direction (backwards). Doing this would move the entire universe back to an earlier state that it was in. However, the atoms in your body would still need to move forward. So, while the universe is moving backwards, your being is moving forward and that would allow you to travel backwards in time. Then, at some point, to return to the present you left, you'd need to slow down all the particles in the universe and/or speed up the particle motion in your body to catch up. 

Changing the state of the entire universe simply isn't possible. There is only one state of the universe, The Now.