Skip to content

Commit

Permalink
housekeeping updates (#135)
Browse files Browse the repository at this point in the history
* housekeeping updates

* shorten pr template

* bump dev version
  • Loading branch information
ryanhill1 authored Aug 9, 2024
1 parent 06b0934 commit 8d5d4c0
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 67 deletions.
12 changes: 10 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<!-- Please link or tag any issues that is PR closes -->
<!--
Before submitting a pull request, please read:
# Changes
- https://github.com/qBraid/qbraid-qir/blob/main/CONTRIBUTING.md#pull-requests
⚠️ Your pull request title should be short, detailed, and understandable for all.
⚠️ Please link any issues that this PR aims to close, if applicable.
⚠️ If you believe this PR should be highlighted in the qBraid-QIR CHANGELOG, please add a new entry to the `CHANGELOG.md` file, summarizing the change, and including a link back to the PR.
-->

## Summary of changes
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Types of changes:
- `Added`: for new features.
- `Improved`: for improvements to existing functionality.
- `Deprecated`: for soon-to-be removed features.
- `Removed`: for now removed features.
- `Fixed`: for any bug fixes.

## [Unreleased]

### Added

### Improved

### Deprecated

### Removed

### Fixed
14 changes: 7 additions & 7 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ authors:
- given-names: Harshit
family-names: Gupta
affiliation: qBraid Co.
- given-names: Samuel
family-names: Kushnir
affiliation: University of Maryland
- given-names: Rohan
family-names: Jain
affiliation: Carnegie Mellon University
- given-names: Samuel
family-names: Kushnir
affiliation: University of Maryland
- given-names: Priyansh
family-names: Parakh
affiliation: University of Toronto
- given-names: Ryan James
family-names: Hill
affiliation: qBraid Co.
repository-code: 'https://github.com/qBraid/qbraid-qir'
url: 'https://sdk.qbraid.com/projects/qir/en/v0.2.1/'
repository-artifact: 'https://github.com/qBraid/qbraid-qir/releases/tag/v0.2.1'
url: 'https://sdk.qbraid.com/projects/qir/en/v0.2.2/'
repository-artifact: 'https://github.com/qBraid/qbraid-qir/releases/tag/v0.2.2'
keywords:
- python
- quantum-computing
Expand All @@ -32,5 +32,5 @@ keywords:
- cirq
- openasm
license: GPL-3.0
version: 0.2.1
date-released: '2024-06-25'
version: 0.2.2
date-released: '2024-08-09'
20 changes: 14 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ Before you start working on a new feature or a fix, here's how you can contribut
```shell
git clone https://github.com/qBraid/qbraid-qir.git
cd qbraid-qir
pip install -e '.[cirq,qasm3]'
pip install -e '.[qasm3,cirq]'
```

## Pull request checklist
## Pull requests

Before submitting a pull request (PR), ensure your contributions comply with the [Developer's Certificate of Origin](https://developercertificate.org/), confirming your right to submit the work under this project's license. Contributors are encouraged to [sign commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits), however, it is not required.

For code changes, please ensure that:
1. All new code includes corresponding unit tests and satisfies code coverage.
2. Docstrings are thorough and accurate for both new and updated features.
3. All integration tests, including docs and linters, are passing.
4. New functions and classes are annotated with Python type hints to support `py.typed`.

### Run tests

Expand Down Expand Up @@ -51,10 +59,10 @@ pytest --cov=qbraid_qir --cov-report=term tests/

Workflow: [`docs.yml`](.github/workflows/docs.yml)

- [ ] Docs builds are passing
- [ ] New/modified code has appropriate docstrings
- [ ] Tree stubs are updated, if applicable
- [ ] Examples on how to use new/updated features added to User Guide
- [ ] Docs builds are passing.
- [ ] New/modified code has appropriate docstrings.
- [ ] Tree stubs are updated, if applicable.
- [ ] README and/or example notebooks are updated, if applicable.

Static docs pages (e.g. User Guide) are written using reStructuredText (reST), which is the default plaintext markup language used by [Sphinx](https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html). It's pretty straightforward once you get the hang of it. If you're unfamiliar, [reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#restructuredtext-primer) is a good place to start.

Expand Down
60 changes: 21 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
<a href='https://github.com/qBraid/qbraid-qir/actions/workflows/main.yml'>
<img src='https://github.com/qBraid/qbraid-qir/actions/workflows/main.yml/badge.svg' alt='CI'>
</a>
<!-- <a href="https://codecov.io/gh/qBraid/qbraid-qir" >
<img src="https://codecov.io/gh/qBraid/qbraid-qir/graph/badge.svg?token=GUQ3EN8DGI"/>
</a> -->
<a href='https://sdk.qbraid.com/projects/qir/en/latest/?badge=latest'>
<img src='https://readthedocs.com/projects/qbraid-qbraid-qir/badge/?version=latest&token=7656ee72b7a66dec6d78dda911ce808676dca55c3e86702d5e97191badfdf19c' alt='Documentation Status'/>
</a>
Expand Down Expand Up @@ -38,7 +35,7 @@ qBraid-SDK extension providing support for QIR conversions.

<img align="right" width="100" alt="qir" src="https://qbraid-static.s3.amazonaws.com/logos/qir.png">

This project aims to make [QIR](https://www.qir-alliance.org/) representations accessible via the qBraid-SDK [transpiler](#architecture-diagram), and by doing so, open the door to language-specific conversions from any and all high-level quantum languages [supported](https://docs.qbraid.com/en/latest/sdk/overview.html#supported-frontends) by `qbraid`. See QIR Alliance: [why do we need it?](https://www.qir-alliance.org/qir-book/concepts/why-do-we-need.html).
This project aims to make [QIR](https://www.qir-alliance.org/) representations accessible via the qBraid-SDK [transpiler](#architecture-diagram), and by doing so, open the door to language-specific conversions from any and all high-level quantum languages [supported](https://docs.qbraid.com/sdk/user-guide/overview#supported-frontends) by `qbraid`. See QIR Alliance: [why do we need it?](https://www.qir-alliance.org/qir-book/concepts/why-do-we-need.html).

## Installation

Expand All @@ -52,16 +49,16 @@ pip install qbraid-qir

qBraid-QIR offers integrations that require extra (optional) dependencies, which can be installed as follows:

For Cirq to QIR conversions, install the `cirq` extra:
For OpenQASM 3 to QIR conversions, install the `qasm3` extra:

```shell
pip install 'qbraid-qir[cirq]'
pip install 'qbraid-qir[qasm3]'
```

For OpenQASM 3 to QIR conversions, install the `qasm3` extra:
For Cirq to QIR conversions, install the `cirq` extra:

```shell
pip install 'qbraid-qir[qasm3]'
pip install 'qbraid-qir[cirq]'
```

### Install from source
Expand All @@ -78,7 +75,7 @@ pip install .
To include optional dependencies when installing from source, use the same "extras_require" format, e.g.

```shell
pip install '.[cirq,qasm3]'
pip install '.[qasm3,cirq]'
```

## Check version
Expand All @@ -94,31 +91,12 @@ In [2]: qbraid_qir.__version__
## Resources

- [User Guide](https://docs.qbraid.com/qir/user-guide)
- [API Reference](https://sdk.qbraid.com/projects/qir/en/latest/api/qbraid_qir.html)
- [API Reference](https://sdk.qbraid.com/projects/qir/en/stable/api/qbraid_qir.html)
- [Example Notebooks](examples)
- [Test Containers](test-containers)

## Usage examples

### Cirq conversions

```python
import cirq
from qbraid_qir.cirq import cirq_to_qir

q0, q1 = cirq.LineQubit.range(2)

circuit = cirq.Circuit(
cirq.H(q0),
cirq.CNOT(q0, q1),
cirq.measure(q0, q1)
)

module = cirq_to_qir(circuit, name="my-circuit")

ir = str(module)
```

### OpenQASM 3 conversions

```python
Expand All @@ -143,19 +121,23 @@ module = qasm3_to_qir(program, name="my-program")
ir = str(module)
```

### Add QIR node to qBraid conversion graph
### Cirq conversions

```python
import cirq
from qbraid_qir.cirq import cirq_to_qir
from qbraid.transpiler import Conversion, ConversionGraph

graph = ConversionGraph()
q0, q1 = cirq.LineQubit.range(2)

conversion = Conversion("cirq", "qir", cirq_to_qir)
circuit = cirq.Circuit(
cirq.H(q0),
cirq.CNOT(q0, q1),
cirq.measure(q0, q1)
)

graph.add_conversion(conversion)
module = cirq_to_qir(circuit, name="my-circuit")

graph.plot()
ir = str(module)
```

## Architecture diagram
Expand All @@ -170,7 +152,7 @@ qBraid-SDK transpiler hub-and-spokes [architecture](https://docs.qbraid.com/qir/
[CONTRIBUTING.md](CONTRIBUTING.md)
- For feature requests and bug reports:
[Submit an issue](https://github.com/qBraid/qbraid-qir/issues)
- For discussions, and specific questions about the qBraid-SDK, qBraid-QIR, or
- For discussions, and specific questions about qBraid-QIR, or
other topics, [join our discord community](https://discord.gg/TPBU2sa8Et)
- For questions that are more suited for a forum, post to
[QCSE](https://quantumcomputing.stackexchange.com/)
Expand All @@ -185,12 +167,12 @@ citation details, please refer to [CITATION.cff](CITATION.cff).

```bibtex
@software{Gupta_qBraid-QIR_Python_package_2024,
author = {Gupta, Harshit and Kushnir, Samuel and Jain, Rohan and Parakh, Priyansh and Hill, Ryan James},
author = {Gupta, Harshit and Jain, Rohan and Kushnir, Samuel and Parakh, Priyansh and Hill, Ryan James},
license = {GPL-3.0},
month = jun,
month = aug,
title = {{qBraid-QIR: Python package for QIR conversions, integrations, and utilities.}},
url = {https://github.com/qBraid/qbraid-qir},
version = {0.2.1},
version = {0.2.2},
year = {2024}
}
```
Expand Down
25 changes: 13 additions & 12 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,34 @@ qBraid-QIR requires Python 3.9 or greater. The base package can be installed wit
pip install qbraid-qir
To enable specific conversions such as Cirq to QIR or OpenQASM 3 to QIR, you can install one or both extras:
To enable specific conversions such as OpenQASM 3 to QIR or Cirq to QIR, you can install one or both extras:

.. code-block:: bash
pip install 'qbraid-qir[cirq,qasm3]'
pip install 'qbraid-qir[qasm3,cirq]'
Resources
----------

- `User Guide <https://docs.qbraid.com/qir/user-guide>`_
- `Example Notebooks <https://github.com/qBraid/qbraid-qir/tree/main/examples>`_
- `API Reference <https://sdk.qbraid.com/projects/qir/en/latest/api/qbraid_qir.html>`_
- `API Reference <https://sdk.qbraid.com/projects/qir/en/stable/api/qbraid_qir.html>`_
- `Source Code <https://github.com/qBraid/qbraid-qir>_`


.. toctree::
:maxdepth: 1
:caption: SDK API Reference
:hidden:

qbraid <https://sdk.qbraid.com/en/latest/api/qbraid.html>
qbraid.programs <https://sdk.qbraid.com/en/latest/api/qbraid.programs.html>
qbraid.interface <https://sdk.qbraid.com/en/latest/api/qbraid.interface.html>
qbraid.transpiler <https://sdk.qbraid.com/en/latest/api/qbraid.transpiler.html>
qbraid.passes <https://sdk.qbraid.com/en/latest/api/qbraid.passes.html>
qbraid.runtime <https://sdk.qbraid.com/en/latest/api/qbraid.runtime.html>
qbraid.visualization <https://sdk.qbraid.com/en/latest/api/qbraid.visualization.html>
qbraid <https://sdk.qbraid.com/en/stable/api/qbraid.html>
qbraid.programs <https://sdk.qbraid.com/en/stable/api/qbraid.programs.html>
qbraid.interface <https://sdk.qbraid.com/en/stable/api/qbraid.interface.html>
qbraid.transpiler <https://sdk.qbraid.com/en/stable/api/qbraid.transpiler.html>
qbraid.passes <https://sdk.qbraid.com/en/stable/api/qbraid.passes.html>
qbraid.runtime <https://sdk.qbraid.com/en/stable/api/qbraid.runtime.html>
qbraid.visualization <https://sdk.qbraid.com/en/stable/api/qbraid.visualization.html>

.. toctree::
:maxdepth: 1
Expand All @@ -122,5 +123,5 @@ Resources
:caption: CORE API Reference
:hidden:

qbraid_core <https://sdk.qbraid.com/projects/core/en/latest/api/qbraid_core.html>
qbraid_core.services <https://sdk.qbraid.com/projects/core/en/latest/api/qbraid_core.services.html>
qbraid_core <https://sdk.qbraid.com/projects/core/en/stable/api/qbraid_core.html>
qbraid_core.services <https://sdk.qbraid.com/projects/core/en/stable/api/qbraid_core.services.html>
2 changes: 1 addition & 1 deletion qbraid_qir/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
Version number (major.minor.patch[-label])
"""
__version__ = "0.2.2"
__version__ = "0.2.3.dev"

0 comments on commit 8d5d4c0

Please sign in to comment.