Tech Blog

Coding, Programming

Quantum Programming

By Pranay Choudhary3 min read
← Back to blog

What is Quantum Computing?

Since you have landed into this blog, I assume that you have quite an idea what Quantum Computing is. It brought a great revolution in the computing world after personal computers and supercomputers. The personal computers (or called today’s computers in this blog series) calculate using bytes. The quantum computers calculate using laws of quantum mechanics. Instead of bytes, it uses a string of quantum bits called qubits.

The principles of quantum theory

Before we start writing a quantum program, we need to understand a few basic principles of quantum mechanics. Similarly, you might have learned the basics of transistors and binary number systems before learning about today’s computing languages.

  1. Quantum Information: Qubit is the smallest unit of data in the quantum system. The spins of an electron can be used to store a qubit of information.
  2. Quantum State: A quantum state is a measurement (in terms of a probability distribution) used to define a quantum system.
  3. Quantum superposition: Superposition in a system states that the system can be in more than one state at the same time. (Recall that the quantum state is a probability distribution). In today’s computing environment, a bit can represent either zero or one. Whereas, a qubit can represent both zero and one at the same time.
  4. Quantum entanglement: In quantum physics, particles can intertwine (entangle) and share a special bond without any physical connection. Any action performed on one particle simultaneously affects the other, no matter how far they are. This inextricable link between them is a basis for the notion that information can be transmitted faster than the speed of light.

Do I need a quantum computer to write a quantum program?

A quantum program is always written with the help of today’s computers. You need a quantum computer to “execute” your program and get the desired outcome. Don’t worry. You can execute your quantum program in today’s computer also, as a simulated environment.

In this simulation, 2 bits are needed to describe 1 qubit. Not bad huh! 4 bits for 2 qubits, 16 bits for 4 qubits, and so on. To simulate 42 qubits you will need 4 terabits (average storage size of today’s computers). To simulate 1 KiloQubits you will need all the storage present in the world! That sounds pretty impossible to simulate. Well, here is the good news – To handle all the information present in this world, you will need just 1KiloQubit, that can be very well a teeny tiny molecule.

Coming closer to first Quantum Program

So which computing language can I use to write a quantum program?

There are several Programming languages using which you can write your first quantum program. The most popular ones are:

  1. QCL – Resembles C programming language
  2. Q language – Resembles C++
  3. Q# – Developed by Microsoft, resembles C#

There are Quantum development kits too where you can write programs in today’s computing language to manipulate quantum systems. Some of them are:

  1. Cirq – Developed by Google, uses Python.
  2. Qiskit – Developed by IBM, uses Python.
  3. Quantum Development Kit – Developed by Microsoft for its .NET Framework
Stay tuned for my next blog where we start with hello world in Quantum Programming.

Keep reading

You may be interested in

Browse all articles →
How Angular is Different from AngularJS
September 27, 20227 min read

How Angular is Different from AngularJS

What is Angular? Angular is a popular open-source Typescript framework and free to use. Considered to be a JavaScript-based framework,TypeScript.is its primary programming language. TypeScript is Developed by Microsoft and its superset of JavaScript, which simply means that TypeScript has all the capabilities that JS has and more additional features. Angular is majorly used for […]

By Sachin DevadigaRead More →
Angular constructor vs ngOnInit
September 15, 20223 min read

Angular constructor vs ngOnInit

Overview: If you are new to angular or have been working with it for a while, you will have questions like: Is it necessary to inject dependencies in the constructor and bind data? When should we use ngOnInit ? What is the difference between constructor and OnInit?. So, in this blog we will answer all […]

By Priyanka SRead More →
Variables in CSS
September 12, 20222 min read

Variables in CSS

CSS variables (also referred as CSS custom properties) are just like simple variables in other programming languages. They reduce the redundant work. They are used to storing values and reused at multiple places and updated/modified from one place. Syntax: CSS variable is any CSS property whose name starts with two dashes. Like Custom property names […]

By Irshan AhmedRead More →