Overview
What is Bloqade?
Section titled “What is Bloqade?”Bloqade is QuEra Computing’s software development kit (SDK) for neutral atom quantum computers. It is designed to be a hub of embedded domain-specific languages (eDSLs) for neutral atom quantum computing. Bloqade is built on top of Kirin, the Kernel Intermediate Representation Infrastructure.
Writing Kernels
Section titled “Writing Kernels”A kernel is a representation of a hybrid quantum/classical execution that will run “on hardware”. The decorator @squin.kernel can be considered as the “label” to represent this fact. A kernel can take arguments (such as theta here) and can return values (such as bits here). To help the compiler, the inputs and outputs must be decorated with a type. The return values can be considered as the “results” which are returned from the quantum computer, though they can also be intermediate values that are used as a part of a larger computation (e.g. a function call). A kernel can represent both quantum and classical execution: while lots of classical computation is supported (control flow, algebra, etc.) there is less support for arbitrary python calls, as this won’t necessarily be supported on the microcontroller “on hardware”.
An example of a kernel is below:
@squin.kerneldef hello_world(theta: float) -> IList[MeasurementResult, Any]: """ Prepare a Bell state and measure in a basis that might have a Bell violation """ qubits = squin.qalloc(2) squin.h(qubits[0]) squin.cx(qubits[0], qubits[1]) squin.rx(theta, qubits[0]) bits = squin.broadcast.measure(qubits) return bitsRunning Kernels
Section titled “Running Kernels”You can run kernels either in simulation, or on the hardware. Generally, we have a notion of a “task” that contains the kernel and the number of shots for the program, and this “task” object can then be submitted to the hardware for execution.
An example of running kernels in simulation is below:
from bloqade.pyqrack import StackMemorySimulatorsim = StackMemorySimulator(min_qubits=2)probabilities = sim.task(hello_world, args=(1.0,)).batch_run(shots=1000)The method of running kernels on hardware is slightly different, but the overall concepts are the same.