Skip to content

Commit

Permalink
Add pyqasm dependency in project (#173)
Browse files Browse the repository at this point in the history
* remove semantic analyser

* remove py 3.9

* docs and mypy

* add header check

* add barrier implementation
  • Loading branch information
TheGupta2012 authored Oct 18, 2024
1 parent 4b0df92 commit fccfeee
Show file tree
Hide file tree
Showing 61 changed files with 389 additions and 5,989 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx_copybutton"
"sphinx_copybutton",
]

# set_type_checking_flag = True
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ 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/stable/api/qbraid_qir.html>`_
- `Source Code <https://github.com/qBraid/qbraid-qir>_`
- `Source Code <https://github.com/qBraid/qbraid-qir>`_


.. toctree::
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics"
]
dependencies = ["pyqir>=0.10.0,<0.11.0", "numpy"]
requires-python = ">=3.9"
requires-python = ">=3.10"

[project.urls]
Homepage = "https://github.com/qBraid/qbraid-qir"
Expand All @@ -36,10 +35,10 @@ Discord = "https://discord.gg/TPBU2sa8Et"

[project.optional-dependencies]
cirq = ["cirq-core>=1.3.0,<1.5.0"]
qasm3 = ["openqasm3[parser]>=0.4.0,<1.1.0"]
qasm3 = ["pyqasm>=0.0.1"]
test = ["qbraid>=0.7.1,<0.9.0", "pytest", "pytest-cov", "autoqasm>=0.1.0"]
lint = ["black[jupyter]", "isort", "pylint", "qbraid-cli>=0.8.3"]
docs = ["sphinx>=7.3.7,<8.1.0", "sphinx-autodoc-typehints>=1.24,<2.5", "sphinx-rtd-theme>=2.0,<3.1", "docutils<0.22", "sphinx-copybutton"]
lint = ["black[jupyter]", "isort", "pylint", "qbraid-cli>=0.8.7"]
docs = ["pyqasm>=0.0.1", "sphinx>=7.3.7,<8.1.0", "sphinx-autodoc-typehints>=1.24,<2.5", "sphinx-rtd-theme>=2.0,<3.1", "docutils<0.22", "sphinx-copybutton"]

[tool.setuptools.dynamic]
version = {attr = "qbraid_qir.__version__"}
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
This top level module contains the main qBraid QIR functionality.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/_version.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module containing version information
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module containing Cirq QIR functionality.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/convert.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module containing Cirq to qBraid QIR conversion functions
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/elements.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module defining Cirq LLVM Module elements.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module defining exceptions for errors raised during Cirq conversions.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/opsets.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module mapping supported Cirq gates/operations to pyqir functions.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/passes.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module for processing Cirq circuits before conversion to QIR.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/cirq/visitor.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module defining CirqVisitor.
Expand Down
6 changes: 3 additions & 3 deletions qbraid_qir/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module defining exceptions for errors raised by qBraid QIR.
Expand Down
21 changes: 9 additions & 12 deletions qbraid_qir/qasm3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
#
# This file is part of the qBraid-SDK
# This file is part of qbraid-qir
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# Qbraid-qir is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
#
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for qbraid-qir, as per Section 15 of the GPL v3.

"""
Module containing OpenQASM 3 QIR functionality.
Expand All @@ -20,16 +20,15 @@
:toctree: ../stubs/
qasm3_to_qir
validate_qasm
Classes
---------
.. autosummary::
:toctree: ../stubs/
Qasm3Module
BasicQasmVisitor
QasmQIRModule
QasmQIRVisitor
Exceptions
-----------
Expand All @@ -40,16 +39,14 @@
Qasm3ConversionError
"""
from .checker import validate_qasm
from .convert import qasm3_to_qir
from .elements import Qasm3Module
from .elements import QasmQIRModule
from .exceptions import Qasm3ConversionError
from .visitor import BasicQasmVisitor
from .visitor import QasmQIRVisitor

__all__ = [
"validate_qasm",
"qasm3_to_qir",
"Qasm3Module",
"QasmQIRModule",
"Qasm3ConversionError",
"BasicQasmVisitor",
"QasmQIRVisitor",
]
Loading

0 comments on commit fccfeee

Please sign in to comment.