Backend

System design of the Tergite backend

The Tergite backend, also called the Backend Control Computer (BCC), runs the jobs of one or more quantum devices: real devices through Qblox clusters with quantify, or simulated ones, a simulated chip behind dummy clusters. One backend process tree runs:

They share no memory: they meet in an SQL database, SQLite by default, and a storage folder for the job files and results.

Flows

Tergite backend flows

Before arrival

The Tergite SDK is used by the experimentalist to specify the quantum circuits, or the pulses, to run on the quantum computer. It registers the job with the public API, which gets it a job token from the backend, and then uploads the job file, with that token, to the Tergite backend.

On arrival

The Tergite backend receives the job as a JSON job file sent to its RESTful API. The file holds the job’s OpenQASM 3 circuits, which may hold OpenPulse cal blocks and defcals for pulse-level jobs, with their shots, meas_level and meas_return.

The API stores the job in the SQL database and wakes the device’s heavy worker.

Waiting in the database

The backend has no queue. A job waits as a row of the database, and the workers decide what runs next by querying the database when they look, with the rules of the device’s bookings in the query. Each stage of a job has a queued step, which a worker claims, and a working step:

Stage Worker What happens
Preprocessing (PRE_PROC_Q, PRE_PROC_W) heavy the circuits are compiled for the device and their duration estimated
Execution (EXEC_Q, EXEC_W) heavy the job the bookings let run next is run on the control instruments, or the simulated chip
Postprocessing (PST_PROC_Q, PST_PROC_W) light the measurements are discriminated into each shot’s bits, and the results sent to the public API

A heavy worker prefers executing a job to preprocessing one, and preprocessing to recalibrating its device: a recalibration runs only when the device has no job to execute or preprocess.

A job that fails at any stage, or exceeds its stage’s time limit, is marked failed and the public API is told.

After execution

The workers tell the public API of a job’s results, or of its failure, as they tell it of the device’s properties and calibrations, over a websocket that they sign with the backend’s private key. If the public API cannot be reached, they keep the events and send them, in order, once it can.

Special Techniques

Compiling OpenQASM 3

The real control devices in current use are produced by Qblox. Simulated devices are simulated chips behind dummy Qblox clusters, so both are compiled the same way.

The backend parses each circuit, OpenPulse included, and translates its gates into the device’s native gates. It then compiles them, with the device’s own calibration, into a quantify Schedule for the Qblox clusters. A device that takes pulse-level jobs plays their OpenPulse on the frames it publishes, named after its ports (q12_drive, q12_readout, q12_q13_coupler), within the pulse_limits of its backend config.

Compiling a job’s OpenQASM 3

Recalibration

Each device recalibrates with tergite-tuner every BCC_DEFAULT_RECALIBRATION_INTERVAL seconds. The calibration it finds becomes the device’s: the jobs after it are compiled and discriminated with it, and it is sent to the public API.

The tergite-backend DESIGN.md describes the backend in detail.

Back to top