Skip to main content

Python tools for Jaqal

Project description

JaqalPaq

JaqalPaq

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).

Installation

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

Usage

The following simple example is from examples/usage_example.py

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.jql, is

from qscout.v1.std usepulses *

register q[2]

prepare_all
Sxx q[1] q[0]
measure_all

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

Documentation

Online documentation is hosted on Read the Docs.

License

Apache 2.0

Questions?

For help and support, please contact qscout@sandia.gov.

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.0b1
Filename, size File type Python version Upload date Hashes
Filename, size JaqalPaq-1.0.0b1-py3-none-any.whl (84.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size JaqalPaq-1.0.0b1.tar.gz (60.4 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