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. The installation instructions describe the recommended install process, but a minimal installation can be performed with the package manager pip:
pip install jaqalpaq
JaqalPaq includes an emulator that can provide measurement probabilities for any native gate set. However, we only currently support the native operations of QSCOUT, which are modeled as pure-state preparations, unitary transformations, and destructive measurements. This is available on Gitlab in the QSCOUT Gate Models repository.
Refer to the INSTALL.md for complete instruction on how to enable this capability, as well as others, such as transpilation to other quantum languages.
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.jaqal
, 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
Questions?
For help and support, please contact qscout@sandia.gov.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file test-JaqalPaq-0.0.0.1.0.0rc2.tar.gz
.
File metadata
- Download URL: test-JaqalPaq-0.0.0.1.0.0rc2.tar.gz
- Upload date:
- Size: 357.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c169877bf8e55786b928409b5ad7918ab8154baf5d0fa82698d97817dadd251d |
|
MD5 | cdfcf16d0a33e5556576fc29ba56ea05 |
|
BLAKE2b-256 | ec201bf6c2799c930529ec84eb097c001c179311293454b468fcf071fba32d58 |
File details
Details for the file test_JaqalPaq-0.0.0.1.0.0rc2-py2.py3-none-any.whl
.
File metadata
- Download URL: test_JaqalPaq-0.0.0.1.0.0rc2-py2.py3-none-any.whl
- Upload date:
- Size: 395.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a99fd7c3e6c2f6d9c2d468bb7b050014f7043e632ba04d7d16c7924a66994d3 |
|
MD5 | 35d5c0d1d55cc92c28a161ad02f4daf6 |
|
BLAKE2b-256 | 87bf23b0c89b2e740be23811821907eba434d1edcc777e2511a04c2d517d6416 |