The purpose of the tool contained in this repository is to provide means to manipulate the intermediate representation (IR) of quantum programs. We refer to these IRs as quantum IRs (QIRs). The main tool provided here is QIR adaptor tool (QAT) which allows one to transform one QIR to another QIR that fulfils certain requirements.
When we refer to a QIR in any of the documentation related to this tool, we do so irrespective of whether we represent the QIR though human readable text, the more storage-efficient bit-code format or in-memory representation. We note that all of these representations are semantically identical and for that reason, QAT is designed to work with all of them.
QAT can be built either using Bazel or CMake. In the following two sections, we
discuss how to build QAT using either of these tools. Building on Windows is
currently only supported
using Bazel. The
detailed decription of building with Bazel
outlines how to install bazelisk
and discusses configuration flags. If you
already have bazelisk
installed, simply run
bazelisk build //qir/qat:qat --config [compiler] --config release
to build qat
where compiler should be substituted with clang
on Linux and
macOS, and msvc
on Windows. If you prefer CMake, please
see the detailed instructions here.
Once the project is built (see next sections), you can transform a QIR according to a profile as follows:
qat --apply --target-def target.yaml -S path/to/example.ll
Likewise, you can validate that a QIR follows a specification by running (Note, not implemented yet):
qat --validate --target-def target.yaml -S path/to/example.ll
You can access the documentation here.
If you have feedback about the content in this repository, please let us know by filing a new issue!
There are many ways in which you can contribute to QAT, whether by contributing a feature or by engaging in discussions; we value contributions in all shapes and sizes! We refer to this document for guidelines and ideas for how you can get involved.
Contributing a pull request to this repo requires to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. We are still working on setting up a suitable CLA-bot to automate this process. A CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately. Once it is set up, simply follow the instructions provided by the bot. You will only need to do this once.
This project has adopted the community covenant Code of Conduct. Please contact qiralliance@mail.com for Code of Conduct issues or inquires.