Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if (c[0] == false) {
### Improved / Modified
- Refactored the initialization of `QasmModule` to remove default include statements. Only user supplied include statements are now added to the generated QASM code ([#86](https://github.com/qBraid/pyqasm/pull/86))
- Update the `pre-release.yml` workflow to multi-platform builds. Added the pre-release version bump to the `pre_build.sh` script. ([#99](https://github.com/qBraid/pyqasm/pull/99))

- Bumped qBraid-CLI dep in `tox.ini` to fix `qbraid headers` command formatting bug ([#129](https://github.com/qBraid/pyqasm/pull/129))

### Deprecated

Expand All @@ -105,6 +105,7 @@ if (c[0] == false) {

Archive of changelog entries from previous releases:

- [v0.1.0](https://github.com/qBraid/pyqasm/releases/tag/v0.1.0)
- [v0.1.0-alpha](https://github.com/qBraid/pyqasm/releases/tag/v0.1.0-alpha)
- [v0.0.3](https://github.com/qBraid/pyqasm/releases/tag/v0.0.3)
- [v0.0.2](https://github.com/qBraid/pyqasm/releases/tag/v0.0.2)
Expand Down
8 changes: 4 additions & 4 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Script to bump the major, minor, or patch version in pyproject.toml.
Expand Down
8 changes: 4 additions & 4 deletions bin/stamp_pre_release.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Script for getting/bumping the next pre-release version.
Expand Down
8 changes: 4 additions & 4 deletions examples/unroll_example.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

# pylint: disable=invalid-name

Expand Down
8 changes: 4 additions & 4 deletions examples/validate_example.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

# pylint: disable=invalid-name

Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Top level module containing the main PyQASM functionality.
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/accelerate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Module providing Cython-based optimizations for computationally intensive functions.
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/analyzer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Module with analysis functions for QASM visitor
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Entrypoint for the PyQASM CLI.
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/cli/validate.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Script to verify OpenQASM files
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/elements.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Module defining Qasm Converter elements.
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Top-level entrypoint functions for pyqasm.
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Module defining base PyQASM exceptions.
Expand Down
9 changes: 4 additions & 5 deletions src/pyqasm/expressions.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Module containing the class for evaluating QASM expressions.

"""

from openqasm3.ast import (
BinaryExpression,
BooleanLiteral,
Expand Down
8 changes: 4 additions & 4 deletions src/pyqasm/linalg.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024 qBraid
# Copyright (C) 2025 qBraid
#
# This file is part of pyqasm
# This file is part of PyQASM
#
# Pyqasm is free software released under the GNU General Public License v3
# PyQASM 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 pyqasm, as per Section 15 of the GPL v3.
# THERE IS NO WARRANTY for PyQASM, as per Section 15 of the GPL v3.

"""
Module for linear algebra functions necessary for gate decomposition.
Expand Down
76 changes: 38 additions & 38 deletions src/pyqasm/maps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Copyright (C) 2024 qBraid
#
# This file is part of pyqasm
#
# Pyqasm 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 pyqasm, as per Section 15 of the GPL v3.
"""
Module mapping supported QASM gates/operations to lower level gate operations.
"""
from openqasm3.ast import (
ClassicalDeclaration,
QuantumBarrier,
QuantumGate,
QuantumGateDefinition,
QuantumMeasurementStatement,
QuantumReset,
QubitDeclaration,
SubroutineDefinition,
)
# Reference : https://openqasm.com/language/classical.html#the-switch-statement
# Paragraph 14
SWITCH_BLACKLIST_STMTS = {
QubitDeclaration,
ClassicalDeclaration,
SubroutineDefinition,
QuantumGateDefinition,
}
SUPPORTED_QASM_VERSIONS = {"3.0", "3", "2", "2.0"}
QUANTUM_STATEMENTS = (QuantumGate, QuantumBarrier, QuantumReset, QuantumMeasurementStatement)
# Copyright (C) 2025 qBraid
#
# This file is part of PyQASM
#
# PyQASM 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 PyQASM, as per Section 15 of the GPL v3.

"""
Module mapping supported QASM gates/operations to lower level gate operations.

"""

from openqasm3.ast import (
ClassicalDeclaration,
QuantumBarrier,
QuantumGate,
QuantumGateDefinition,
QuantumMeasurementStatement,
QuantumReset,
QubitDeclaration,
SubroutineDefinition,
)

# Reference : https://openqasm.com/language/classical.html#the-switch-statement
# Paragraph 14
SWITCH_BLACKLIST_STMTS = {
QubitDeclaration,
ClassicalDeclaration,
SubroutineDefinition,
QuantumGateDefinition,
}

SUPPORTED_QASM_VERSIONS = {"3.0", "3", "2", "2.0"}

QUANTUM_STATEMENTS = (QuantumGate, QuantumBarrier, QuantumReset, QuantumMeasurementStatement)
Loading