Posts

IBM Qiskit Exam: my four weeks preparation

Image
After dedicating approximately a month to preparing for the IBM Certified Associate Developer - Quantum Computation using Qiskit v0.2X, and successfully passing the exam (making 3 errors out of 60 questions), I am sharing my experience in this blog. First of all, let me be very clear: I cannot and will not share exam questions due to the exam policies. Nevertheless, what I can and will share is how I organized myself, the materials I used, and the preparation tests I undertook along the last month. First of all, let me provide some context regarding my prior knowledge before the preparation. I have acquired previous knowledge in quantum computing through my attendance at two quantum computing courses, participation in two IBMQ challenges, reading of books, articles, and papers on quantum computing and quantum machine learning (some of which I have shared in my previous blogs). While this prior knowledge is advantageous for preparation, it's important to emphasize that the test spec...

The simplest quantum binary classifier

Image
How the simplest quantum binary classifier looks like? While searching in internet for the smallest quantum classifier I came across the article from Maria Schuld “Building the world’s smallest quantum classifier” (1) and, based on the circuit proposed there, I thought an even smaller classifier could be built. Here I show a simple variational circuit that can be applied to a 2-feature dataset for binary classification. Though the example is questionable for practical purposes, it gives interesting insights on how to apply quantum computing to machine learning. The circuit is composed of two parts: the embedding, which transforms the classical data into quantum states, and the ansatz, which is parametrized, and the parameters are optimized using a particle swarm optimization algorithm (2). The circuit and the findings follow. First, we need a dataset! Instead of searching for real datasets which must be cleaned, normalized, etc… I’ve created one. The dataset contains 60 samples, each s...

Behind phase Oracles

Image
  Quantum algorithms such as Deutsch, Bernstein-Vazirani, Simon and Grove rely on Oracles. A particular class of Oracles, the phase Oracles, allows to selectively switch phases of the input state, thus helping these algorithms to distinguish states by their phases. In this blog I will explore a bit more this class of Oracles Firstly. lets revisit the superposition state for a single qubit $|0\rangle$ after applying the Hadamard gate:                     $ H\otimes|0\rangle = \frac {1} {\sqrt{2}} ( |0\rangle + |1\rangle ) = |+\rangle $ To recap, this is a state of maximum uncertainty when measured in the computational basis. In simple terms, it represents a state where, when measured, has equal probability of being 0 or 1. As mentioned before, the trick to make the information conveyed by a state more useful is to include a local phase to it. This can be achieved by adding a new qubit in the superposition state $|-\rangle =...

A View on the Deutsch Algorithm

Image
  The Deutsch Algorithm is an excellent example of the application of quantum parallelism using superposition of states. The problem which is solved by the algorithm is the following: Given an unknown function f(x): {0:1} -> {0,1}, by using the minimum amount of queries to this function, determine if the function is constant (it always returns 0 or always returns 1) or balanced (on half of the inputs it returns 0 and the other half, 1). In the classical case, we need to query the function twice, one for x=0 and a second for x=1. In case of the quantum algorithm, a single query can define if the function is balanced or constant. There are many articles explaining how the algorithm works. Here I've taken a different approach: After a brief recap of the algorithm, the analysis of the algorithm follows by opening each state and showing how the problem definition and the function we want to classify contributes to the algorithm output.  On its simplest form, the algorithm utiliz...

The spookiness of Controlled Gates

Image
In Quantum Computing, by far the most popular example of controlled gate is the control-not gate. Most, if not all, the textbooks start with an example of control-not and afterwards, expands to the more generalized concept of controlled gates. It is indeed an effective way to gently introduce the topic, making a smooth connection between the existing classical gate - XOR - and the quantum control-not gate - CNOT. But simplicity is not always synonym of completeness. Controlled gates are a little spookier than initially presented by the textbooks. You will see here that there is more to the controlled gates than shown in the first chapters of quantum computing textbooks. Firstly, a quick recap on the control-not gate.  The control-not gate is a quantum gate with 2 input qubits: the first qubit is the 'control' qubit and the second one the 'target'. The control qubit controls the NOT operation to be applied in the target qubit - if the control qubit is in state |1>,...

The order (of the qubits) matters

Image
Those programming using Quantum Computers will, eventually, come across this somewhat awkward observation when using the simulators or the real computers. The topic is often neglected by tutorials in quantum computing, and, to a certain extend, it is understandable that tutorials do not tackle it at first. In fact, if you are simply running operations on circuits in the machine, it will be hard to spot or bother about it. Nevertheless, it can cause a great deal of confusion and pain for those who are unaware or overlook it. The problem, firstly addressed in the classical computers and now resurfacing with the quantum computers, is related to the order that qubits are organized on a sequence of qubits. Note that, when considering a sequence of qubits, and considering their significance in relation to the sequence, there are two ways to order them: either the qubit on the leftmost position of the sequence is considered the least significant qubit of the sequence, or the one in the right...