Friday, 29 September 2017

Let the parallel hacking begin!

Its a Friday evening and the challenge for the weekends is Image Processing on NVIDIA GPU!

Its a Lab Assignment, yet so interesting that a formal log of the same is a must. Thus this is gonna be it.

Friday, September 29, 2017
The task is implementing a parallel algorithm for image processing on the NVIDIA Tesla K40c GPU. We are going to use CUDA (in C++). Sequential approach is not so complicated, but the challenge is to implement the same in parallel components by invoking kernels for the same in the GPU. Its going to be a 2 day hackathon, so stay tuned for updates!

Saturday, September 30, 2017
CUDA is a bit complicated to begin. A lot of new concepts of grid, blocks, and threads had to be brought into the picture to even get started. Luckily for me, I had been following the parallel computing course on Udacity to get started. Also, there are a few good webinars on CUDA from NVIDIA to get started. The first task is to convert the image into grayscale. This should not be very difficult. A few ideas are coming into the mind. I can simply begin to read out the image as a 2D array using x for width and y for the height. Implementing on the GPU means invoking threadIdx.x and threadIdx.y; Plan is to read one byte at a time (not very efficient, i know) from the array and from each pixel, we can note down the values of RGBA using the inputImage array. I still cannot figure out what exactly is the role of CImg.h file. For the record, its gigantic - something like 45,000 lines of code. (That clearly means, don't go into the details)

Thursday, 28 September 2017

Not so fancy intro in Quantum!

As a lay man, I used to wonder what quantum is? Is it breaking into another abstraction of the sub atomic? Can we harness quanta? What does it look like? Just breaking into the ice, I'd quote it simply, Quantum is real. And along comes its spectacular properties.

Two weeks have been passed since I dived into Quantum Computing. It is motivating indeed to think of the quantum phenomena of entanglement and quantum teleportation. But as intriguing and spectacular the world of quantum is, even more is the complexity. Prof Feynman once said, "If you think you understand quantum mechanics, you don't understand quantum mechanics". That was a thought somewhere in the corner of my head while choosing this as a major, but despite the odds it needs to be done. Thus, I sit here in the classroom of roughly 150 (and a few people live from University of Twente and TU Eindhoven). My professors are Leo DiCarlo and David Elkouss from QuTech in Applied Sciences. They are one of the best and leading research scientists in the Quantum World. I was reading about the loophole free bell-test that was performed at TU Delft a couple of years ago and these people were the ones who actually did that! They disproved Einstein! (Read: Loophole Free Bell Test - Nature)
Leo DiCarlo and Brian Krzanich, CEO, Intel
Quantum starts with qubits, the fundamental unit of quantum computation, a state that can be |0⟩, |1⟩ or a superposition of |0⟩ and |1⟩, represented as |ψ⟩ = α|0⟩ + β|1⟩ which is the only basic  stuff that you can actually manage to remember during the course.
Qubit have representation, along is qubit measurements and qubit computation using quantum gates. The beauty of quantum fundamentals appears when we represent it mathematically and we can actually see phenomena being proved through maths. Its all in the math!

Why do I study quantum, you ask? A theory that was once unacceptable to Einstein, is emerging. Moore's Law got the world of digital computing so far. What is the future of computing? How would you solve large computations, so complex, not be solved using parallel computing or even super computers? The answer lies in quantum. As an analogy, here's a fact: To simulate a quantum computer with 100 qubits we would require twice the amount of data storage as is the total of data of the world, at present, which is a few Zetabytes.

In fact, to be fair, if you ask what other problems can be solved on a quantum computer? We do not know yet.

Quantum is no doubt a weirdo of Physics. Coming up with good quantum algorithms is hard. But Why? Our human intuition is rooted in the classical world. To design good quantum algorithms, one must turn-off one’s classical intuition for at least part of the design process using truly quantum effects to achieve the desired algorithmic end. And, It is not enough to design that is only quantum mechanical. It must be better than any existing classical algorithm.

Quantum Computation and Quantum Information requires quantum mechanics, computer science, information theory and cryptography. And most important of all, it requires a leap in the imagination to progress in such a field of study. After these two weeks, I can say Quantum is fun, It just needs to be viewed right.