Quantum Computing using Python- New Thinking, New Possibilities

Python is the one language which far excelled in big data analytics, machine learning, pylogodeep learning, automation, web and API development. Historically python sticks out among the high-level languages with its innate ability to rapidly prototype complex algorithms and to “automate the boring stuff”. According to the 2017 statistics from stackexchange.com, python showcased incredible growth in the last five years across the globe, unparalleled by any other language. Python supports the development from simple command line applications to cross-platform GUI applications.

Now python paves the way to revolutionise the quantum computing industry. Many libraries popped up in recent past which supports the testing and development of quantum-computer-3679893_1920Quantum algorithms. A quantum algorithm is designed to execute on a processor with quantum architecture. Since the commercial Quantum processors are yet to be in reality, a virtual environment on a classical computer can effectively help in testing and development of quantum algorithms. This will help us prepare for the upcoming quantum revolution.


Python already opened its way into the mainstream quantum development with three virtual simulator libraries in place. PyQu is the most popular and actively updated extension module for python 3. However, the other two (Qtip and Qitensor) are not updated for past one year. The key advantage of python libraries lies in the fact that it serves the needs of beginners and experts alike. PyQu houses the complete set of tools, all that you need to program a quantum algorithm under a single roof. With the vast collection of python libraries, offering an easy adaptation of module-functions helps realise the quantum algorithms with neat syntax.

pyQu encompasses an intuitive pattern of function calls which simplifies coding. An example code segment is given below for a demonstration. For more details refer to the official documentation.

from pyqu import * a = Qureg()
print (a.coeff())

The code generates a quantum register with two qubits initialized to the state |0> and prints the output


The computationally expensive task in solving quantum algorithms is the circuit generation. Other tasks won’t save much compared to a compiled language. This overhead can be worked around by using a wrapper code from C or C++ analogous to numpy. This will help save time on pointer indirection, dynamic type checking etc.

Noisy Intermediate-Scale Quantum(NISQ) devices are the next future technology which will outperform the classical machines. The quantum industry classifies the devices as pre and the post NISQ era devices.

The pre NISQ era devices constitute circuits with small size and depth which nullifies the relevance of faster low-level languages, at least for the time being. However, with the development of more efficient quantum gates and higher levels of abstraction in computing models, we need to benchmark the performance of different languages for fully-fault tolerant quantum computing.

Even though the Python implementations are drastically simplified, the quantum programs can have higher sophistication levels and challenges. For instance, to represent quantum objects, we need quantum data types which can encapsulate its properties. A qubit is the quantum equivalent of a classical bit. Unlike the classical bit, a qubit can exist in the superposition states. It requires 2 raised to the power of N number of classical bits to represent the state of N qubits in superposition. This poses challenges to the memory management and programming of multiple qubit simulators. PyQu is still under development is not entirely reliable.


pyQuil is another python library developed and maintained by Rigetti computing, a quantum computing based startup. It facilitates building and running Quil programs. Image result for pyquilpyQuil is licensed and requires key authorisation to run the code on Rigetti Quantum Virtual Machine(QVM).

Quantica, another quantum computing startup from India is presently developing a cross-platform QVM named “Alchemy”. Quantica will soon deploy the python implementation and make it available for developers and quantum technologists for fast and easy implementation of algorithms. Quantica is further coming up with GUI interface for the simulator with drag and drop circuit design features.


About the Author:

“Abhijith Anandakrishnan is a researcher presently working in Nanoscale transport laboratory, IIT Madras, since 2016. He is actively involved in research on the transport of electrons and phonons in 2D crystals and modulation of carrier transport at nanoscale interfaces. He has gained experience in computational physics involving quantum effects. He is presently working with Quantica Computacao, a quantum-computing startup, which develops solutions to secure credit cards, cryptocurrencies and other online transactions.


He played a significant role in the development of Alchemy, a quantum computing simulator which serves as a virtual platform on top of classical computers to simulate various quantum algorithms. It’s a scalable simulator programmed on multiple languages like javascript, python, c and c++. It will aid in design, development and debugging of quantum specific algorithms. With a graphical user interface, it simplifies the process of quantum logic synthesis.
At Quantica he works in projects addressing vital challenges like post-quantum cryptography and blockchain security. He made significant contributions to the novel quantum cryptographic technologies currently under development, which has the potential to outdate the present day systems such as DES, Triple DES, AES, RSA, McEliece encryption, Merkle hash-tree signatures, Merkle–Hellman knapsack encryption, Buchmann–Williams class-group encryption, ECDSA, HFEv−, NTRU, etc”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: