top of page
Writer's picturemansour ansari

How to write a program on a quantum computer?

Updated: Oct 21, 2021



This short post covers the high-level view of writing a program (quantum circuit), submitting it to a quantum platform, retrieving the output, and producing evidence and proof. It is similar to writing a program on your PC, submitted to a compiler and extracting results. But, the similarity ends there. The details are entirely different. Here is a cursory look at writing a quantum application that runs on different hardware. For example, Google, IBM, IonQ, etc.


Basically, a quantum computer programmer synthesizes a complete quantum circuit developed from a high-level functional model. The operational model works with a classical computer over the cloud to submit the "program" for quantum computation. The Circuit may "run" many times.

The program code (written in different Quantum-friendly languages) goes through the compiler to weed out, for example, perform local optimizations such as eliminating two back-to-back Hadamard gates, "clean" the code before submission, retrieval, and pass back to classical PCs, for further manipulation, graphing, output formats, etc.


So basically, the CLOUD compilers and transpilers ingest the output of the circuits and gates, adapting the code to the particular hardware-specific connectivity and available qubits, gates, among other tasks. This process entails building and designing a logic gate that can provide an answer to the problem.

Gate and Circuit design knowledge are essential to talk to this generation of quantum computing hardware.

The circuit must work with different cloud-connected quantum platforms, ranging from ion trapping, annealing, superconducting, photonic, and a few more platforms. The idea is to run the circuit on all available platforms to compare the results.



If you remember, in the 80's when the classical PCs were a "thing", this computer language was available for any one (with knowledge of bit flipping) to design logic, write low-level code, develop "drivers" for hardware, etc. Later, it was replaced with many "high-level" programming languages such as BASIC, C, etc. Compared to the evolution of classical computers, we are now working at not even assembly-level language era. It is the pre-assembly language era. Users must design circuits to "flip" qubits using "gates".

There are a few software available to make circuit design and gate development much more manageable.


Quantum Circuit diagram tools:


Web address: https://wybiral.github.io/quantum/#

Examples:

Bell state

In logic circuits, the Toffoli gate, invented by Tommaso Toffoli, is a universal reversible logic gate, which means that any classical reversible circuit can be constructed from Toffoli gates. It is also known as the "controlled-controlled-not" gate, which describes its action.


2 Qubit QFT: In quantum computing, the quantum Fourier transform (QFT) is a linear transformation on quantum bits, and is the quantum analogue of the inverse discrete Fourier transform.

Grover's algorithm, which takes O(N1/2) time, is the fastest possible quantum algorithm for searching an unsorted database. It provides "only" a quadratic speedup, unlike other quantum algorithms, which can provide exponential speedup over their classical counterparts.

Quantum gate teleportation is a variant of the one-way quantum computer where quantum gates are applied to quantum states via quantum teleportation.







Recent Posts

See All

Comments


bottom of page