Quantum Bit Encoding: How to Program with Quantum Assembly Language

Quantum Bit Encoding: How to Program with Quantum Assembly Language

Author | W. Wayt Gibbs Translator | Sambodhi Planner | Liu Yan Assembly language is the lowest-level programming language that works directly on hardware. As is well known, all data and instructions in computers consist of 0s and 1s. In quantum computers, there are assembly instructions similar to those in classical computers.

The quantum assembly language “Jaqal” was developed by Sandia National Laboratories in the USA on its QSCOUT platform.

The ion trap of QSCOUT uses electromagnetic fields to maintain a chain of Ytterbium-171 ions, which serve as quantum bits. The ion trap launched in February features 3 quantum bits, which will be upgraded to accommodate 10 quantum bits in 2021. Program commands send ultraviolet light pulses from lasers to the ions to control their direction and quantum states.

It can be said that without quantum computing software and hardware, quantum computing is not yet mature. Sandia National Laboratories, located in Albuquerque, New Mexico, is conducting a project on an open-source quantum computer, aiming to solve this issue through a custom quantum assembly language.

In the coming years, physicist Susan Clark and her team at Sandia plan to run code provided by academic, commercial, and independent researchers worldwide on their QSCOUT platform with a $25 million, 5-year grant from the U.S. Department of Energy. By 2023, the platform will steadily upgrade from today’s 3 quantum bits to 32 quantum bits.

QSCOUT stands for Quantum Scientific Computing Open User Testbed, consisting of ionized Ytterbium atoms suspended in a vacuum chamber. By executing algorithms written in the quantum assembly code that the team has just started, the flickering of ultraviolet lasers causes these atoms to rotate—they named it Just Another Quantum Assembly Language (meaning “other quantum assembly languages”) or JAQAL (they have registered the trademark for Jaqal with a lowercase “aqal,” so all subsequent references will use that handle).

Although Google, IBM, and some other companies have built larger quantum machines and developed their own programming languages, Clark states that QSCOUT offers benefits to those eager to explore this frontier of computer science. Of course, like the superconducting gates in Google and IBM machines, it is also very fast. However, they are unstable and lose coherence and data in less than a second.

Clark states that QSCOUT can maintain the coherence of its calculations, thanks to ion trapping technology developed by IonQ (which has explained this very well): “Think of it as a computational process that retains a thought for up to 10 seconds. This is the best we have right now,” Clark says, “but our quantum logic is a bit slower.”

However, the real advantage of QSCOUT is not its performance, but that it allows users to control the operations of the computer as they wish, even adding new or modified operations to the computer’s basic instruction set architecture. “QSCOUT is like a breadboard, while what companies provide is like a printed circuit board,” says Andrew Landahl, who leads the QSCOUT software team.

Quantum Bit Encoding: How to Program with Quantum Assembly Language

A vacuum chamber encloses an ion trap, protecting individual ions from heat and electromagnetic noise sources that could alter their states, thus making the quantum processor fully effective.

“Our users are scientists who want to conduct controlled experiments,” he says. “They request two quantum logic gates to occur simultaneously, while commercial systems often optimize users’ programs to improve their performance.” Clark states, “But they don’t provide you with too many details to tell you what happens behind the scenes.” In the early days, when it was still unclear how to best handle major issues like noise, data persistence, and scalability, having a quantum machine that simply does what you tell it to do was crucial.

Landahl states that to achieve this combination of precision and flexibility, they created Jaqal, which includes commands to initialize ions as quantum bits, rotate them individually or together into various states, entangle them into superpositions, and then read the final states in the form of output data.

The first line of any Jaqal program, for example:

from qscout.v1.std usepulses *

loads a logic gate pulse file that defines standard operations (“quantum gates” in quantum computing terminology). This scheme can easily achieve scalability. Landahl states that the next version will add new instructions to support more than 10 quantum bits and will introduce new features. Additionally, he also mentioned that users can even write their own functions.

Clark states that one feature that should exist in classical computing, which is on the “wish list,” is the ability to perform local measurements on ongoing computations and then adjust based on intermediate states. In the quantum realm, due to the interconnectedness of quantum bits, this local measurement approach is challenging, but experimentalists have demonstrated that it is possible.

Utilities mix quantum operations with classical operations, so the QSCOUT team has also released a Python package called JaqalPaq on GitHub, which provides a Jaqal simulator and some commands that can include Jaqal code as objects within a larger Python program.

Sandia National Laboratories accepted the first 5 project proposals among the initial 15 applicants, most of which will conduct various benchmark tests on other quantum computers. But Clark stated, “One team (led by Phil Richerme from Indiana University, Bloomington) is addressing small-scale quantum chemistry problems by studying the ground states of specific molecules.”

After the team upgrades the machine from 3 quantum bits to 10 quantum bits, Clark plans to invite a second round of proposals in March.

Jaqal programming language outputs “Hello World”

Landahl states that the simplest non-trivial programs usually run on a new quantum computer, which can entangle 2 quantum bits into a so-called Bell state, which is a superposition of the classical binary states 0 and 1. The Jaqal documentation provides an example of a 15-line program that defines two textbook operations, executing these instructions to prepare a Bell state and then reading the measurement values of the two quantum bits in the result state.

However, QSCOUT, as an ion trap computer, supports a clever operation called the Mølmer-Sørensen logic gate, providing a shortcut. Utilizing this, the following 6-line program can accomplish the same task and can be repeated 1024 times:

register q[2]        // Define a 2-qubit register
Loop 1024 {          // Sequential statements, repeated 1024x
    prepare_all     // Prepare each qubit in the |0⟩ state
    Sxx q[0] q[1]    // Perform the Mølmer–Sørensen gate
    measure_all     // Measure each qubit and output results
}

Original link:

https://spectrum.ieee.org/tech-talk/computing/software/qscout-sandia-open-source-quantum-computer-and-jaqal-quantum-assembly-language

Quantum Bit Encoding: How to Program with Quantum Assembly Language

Are you “watching” too?👇

Leave a Comment