Bump actions/upload-pages-artifact from 1 to 3 (#46)
Bumps actions/upload-pages-artifact from 1 to 3.
updated-dependencies:
- dependency-name: actions/upload-pages-artifact dependency-type: direct:production update-type: version-update:semver-major …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Importer from OpenQASM 3 to Qiskit
This repository provides the Python package
qiskit_qasm3_import
, which is a basic and temporary importer from OpenQASM 3 into Qiskit’sQuantumCircuit
.Qiskit itself accepts this package as an optional dependency if it is installed. In that case, Qiskit exposes the functions
qiskit.qasm3.load
andqiskit.qasm3.loads
, which are wrappers aroundqiskit_qasm3_import.parse
. This project is a stop-gap measure until various technical decisions can be resolved the correct way; Terra makes strong guarantees of stability and support in its interfaces, and we are not yet ready to make that commitment for this project, hence the minimal wrappers.Example
The principal entry point to the package is the top-level
parse
function, which accepts a string containing a complete OpenQASM 3 programme. This complex example shows a lot of the capabilities of the importer.Assuming this program is stored as a string in a variable
program
, we then import it into aQuantumCircuit
by doing:circuit
is now a completeQuantumCircuit
, so we can see exactly what it turned into:Installation
Install the latest release of the
qiskit_qasm3_import
package from pip:This will automatically install all the dependencies as well (an OpenQASM 3 parser, for example) if they are not already installed. Alternatively, you can install Qiskit Terra directly with this package as an optional dependency by doing
Developing
If you’re looking to contribute to this project, please first read our contributing guidelines.
Set up your development environment by installing the development requirements with pip:
This installs a few more packages than the dependencies of the package at runtime, because there are some tools we use for testing also included, such as
tox
andpytest
.After the development requirements are installed, you can install an editable version of the package with
After this, any changes you make to the library code will immediately be present when you open a new Python interpreter session.
Building documentation
After the development requirements have been installed, the command
will build the HTML documentation, and place it in
docs/_build/html
. The documentation state of themain
branch of this repository is published to https://qiskit.github.io/qiskit-qasm3-import.Code style and linting
The Python components of this repository are formatted using
black
. You can run this on the required files by runningThe full lint suite can be run with
License
This project is licensed under version 2.0 of the Apache License.