Skip to main content

Python tools for Jaqal

Project description



JaqalPaq is a python package used to parse, manipulate, emulate, and generate quantum assembly code written in Jaqal (Just another quantum assembly language). JaqalPaq can be installed with optional transpilers that convert code written in other quantum assembly languages to a version of Jaqal whose native gates are relevant for QSCOUT (Quantum Scientific Computing Open User Testbed).


JaqalPaq is available on GitLab. Use the package manager pip to install it.

pip install jaqalpaq

To install the optional transpiler suite, use the following:

pip install jaqalpaq-extras

The JaqalPaq emulator can be programmed to emulate any native gate set. However, we only currently provide an emulator for QSCOUT native operations, which are modeled as pure-state preparations, unitary transformations, and destructive measurements. This is available on Gitlab in the QSCOUT Gate Models repository. pyGSTi is used to perform forward simulations. To install this capability, use the following

pip install qscout-gatemodels pygsti


The following simple example is from examples/

import jaqalpaq
from jaqalpaq.parser import parse_jaqal_file
from jaqalpaq.emulator import run_jaqal_circuit
from jaqalpaq.generator import generate_jaqal_program

JaqalCircuitObject = parse_jaqal_file("jaqal/Sxx_circuit.jaqal")
JaqalCircuitResults = run_jaqal_circuit(JaqalCircuitObject)
print(f"Probabilities: {JaqalCircuitResults.subcircuits[0].probability_by_str}")
JaqalProgram = generate_jaqal_program(JaqalCircuitObject)

The Jaqal file processed by this example, examples/jaqal/Sxx_circuit.jaqal, is

from qscout.v1.std usepulses *

register q[2]

Sxx q[1] q[0]

More extensive examples, including detailed Jupyter notebooks implementing the variational quantum eigensolver (VQE) quantum algorithm for some simple molecules, can be found in the examples directory.

For information on the JaqalPaq emulator's command-line interface, run the following in your shell:

jaqal-emulate --help


Online documentation is hosted on Read the Docs.


Apache 2.0


For help and support, please contact

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for JaqalPaq, version 1.0.0rc1
Filename, size File type Python version Upload date Hashes
Filename, size JaqalPaq-1.0.0rc1-py3-none-any.whl (89.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size JaqalPaq-1.0.0rc1.tar.gz (63.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page