Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

Quantum Programming using Qiskit / Quantum Software

We previously learned about the basics of classical computing. Below is a brief summary of what we learned. 

Each classical computer is made out of elements like capacitors, transistors, and other hardware, all of which use semiconductors. We use transistors and capacitors to represent bits. There are many small gates like the AND and OR gates that are applied to the bits. Gates can be combined to make circuits. Each circuit fulfils a specific, simple purpose. Many circuits combined together are how we make many of the hardware components of the computer, such as the central processing unit (CPU). 


Quantum computers are made of qubits; unlike bits, qubits can not easily be represented using semiconductors or other materials used in classical computers. Instead, scientists use superconductors or photons. Depending on the method of representing the qubit, the quantum computer will behave slightly differently. However, they will all have the same overarching systems. For example, they will all use gates like we learned about. Quantum gates will also come together to shape quantum circuits and in a larger scale quantum hardware like Quantum Processing Units (QPUs).

In classical computers the software layer comes at the top the hardware layer. This is the same for quantum computers. That means quantum computers also benefit from algorithms as a way for figuring out how to get the processing done. They can be programmed as well and have their own dedicated programming languages and tools. On this section we will learn more about how we can program and get quantum computers to solve our problems.

Quantum Programming - An Overview

Some programming languages used for quantum computer are ones that also work with classical computers, while others are specific to quantum computing. Programming in classical languages (like Python and C) is made possible with the aid of a Software Development Kit (SDK) made for quantum computers. SDKs are a set of software tools packaged into bundles for easy installation and use. They will have specific applications such as quantum programming or machine learning. This way, we are able to program on new devices without having to learn a new language. 

One of the languages made specifically for quantum computing is Q#, a language developed by Microsoft and QMASM. Q# is a low-level coding language, which means it works directly with hardware or very close to it. It is specifically designed to be used for quantum computers like the ones made at D-Wave, which are called quantum annealers.

Ocean is an example of a quantum computing SDKs. Ocean allows you to write programs in Python to solve your desired problem. The tools included in the SDK make it possible to be for the code to be executed on D-wave's quantum annealer. 

Qiskit, developed by IBM,  is another SDK that lets the user write quantum programs that can be used two ways: on IBM's quantum computers, or a simulator that behaves like a quantum computer. Besides writing and executing programs on quantum computers or simulators, Qiskit also includes tools that let us design and simulate quantum circuits. In the second part of this course, we are going to teach you how to use Qiskit to either make quantum circuits or write and run quantum programs!

There are also SDKs that only run on a quantum computer simulator, and do not directly access any actual quantum computers. Quantum Development Kit, developed by Microsoft, is an example of that type of SDK.

IBM Quantum Experience

IBM Circuit Composer
We looked a bit at the IBM Circuit Composer in the previous module while implementing various circuits. We saw how to use different gates to build quantum circuits using the drag and drop functionality of the Circuit Composer. We also analyzed the results using histograms.

IBM Qiskit
Qiskit is an SDK for performing quantum computations that make use of quantum mechanical principles (superposition, entanglement) in quantum circuits. It has in-built functions for quantum gates and quantum circuits which can be executed on a quantum computer. Using Qiskit along with classical computing resources, one can solve problems in optimization, quantum chemistry, physics, machine learning, and finance. 

Here, we will teach you basic Qiskit commands and how to use it for building quantum circuits. 

For detailed documentation of Qiskit and understanding quantum computing using Qiskit, the following links are useful:


Quantum Circuits With Qiskit


Qiskit Workflow
The workflow of using Qiskit consists of three high-level steps: BUILD, EXECUTE, ANALYZE.

Build: First and foremost, we need to design the circuit based on the specifications given to us. Once the design is ready, we need to translate it into the Qiskit language. Any Qiskit code would start with importing libraries that are required for running the Python-based program. This would be followed by initialization of circuit variables in Qiskit / Python. After this, we need to add gates. Finally, we can visualize the circuit!

Execute: Once the quantum circuit is successfully built using the Qiskit packages, our Qiskit/Python code is then converted into machine language and fed it into a quantum simulator or a quantum computer.  A simulator is a powerful classical computer which essentially replicates the output that an actual quantum computer would give. For problems involving low computational complexity (such as the ones we are dealing with here), a simulator should ideally give the same output as a quantum computer.

Analyze: The simulator/quantum computer upon finishing the execution of the quantum circuit, would generate output data. We will need to understand the generated output and represent it in a way that enables us to visualize the results of the experiments we conduct.

coding activity

Now, we will get some hands-on experience with building, executing and analyzing quantum circuits using IBM Qiskit. The following "Notebook" will guide you through all the components of a basic Qiskit code. Feel free to experiment by making changes to various blocks of the code. Your instructors will help you understand the code in detail.



This activity provides you with a skeleton structure of a Qiskit code. Choose your favourite quantum circuit and fill into the Notebook to see what output you get! You can choose any of the circuits that you completed in the exercises of the previous module. 





Post a Comment

0 Comments