From 59b5ca6c018d23888bbd8b170f82aa596dce5750 Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Tue, 17 Feb 2026 12:41:37 -0600 Subject: [PATCH 1/3] format + docs logo + links --- .github/workflows/logo-check.yml | 73 ----------- README.md | 10 +- bin/bump_version.py | 1 + bin/stamp_pre_release.py | 1 + docs/_static/pyqasm.svg | 136 --------------------- docs/conf.py | 2 +- docs/index.rst | 17 ++- src/pyqasm/__init__.py | 1 + src/pyqasm/_logging.py | 1 + src/pyqasm/analyzer.py | 1 + src/pyqasm/elements.py | 1 + src/pyqasm/entrypoint.py | 1 + src/pyqasm/expressions.py | 1 + src/pyqasm/linalg.py | 1 + src/pyqasm/maps/decomposition_rules.py | 1 + src/pyqasm/maps/gates.py | 1 - src/pyqasm/preprocess.py | 1 + src/pyqasm/printer.py | 1 + src/pyqasm/pulse/frame.py | 1 + src/pyqasm/pulse/utils.py | 1 + src/pyqasm/pulse/validator.py | 1 + src/pyqasm/pulse/visitor.py | 1 + src/pyqasm/subroutines.py | 1 + src/pyqasm/transformer.py | 1 + src/pyqasm/validator.py | 1 + src/pyqasm/visitor.py | 1 + tests/cli/test_unroll_cli_commands.py | 72 ++++------- tests/qasm2/test_declarations.py | 1 + tests/qasm2/test_operations.py | 25 ++-- tests/qasm2/test_rotation_gates.py | 1 + tests/qasm2/test_to_qasm3.py | 1 + tests/qasm3/declarations/test_classical.py | 1 + tests/qasm3/declarations/test_quantum.py | 1 + tests/qasm3/resources/gates.py | 1 + tests/qasm3/resources/subroutines.py | 1 + tests/qasm3/resources/variables.py | 1 + tests/qasm3/test_barrier.py | 1 + tests/qasm3/test_box.py | 1 + tests/qasm3/test_delay.py | 1 + tests/qasm3/test_depth.py | 1 + tests/qasm3/test_entrypoint.py | 1 + tests/qasm3/test_expressions.py | 1 + tests/qasm3/test_format.py | 1 + tests/qasm3/test_gates.py | 1 + tests/qasm3/test_loop.py | 30 ++--- tests/qasm3/test_measurement.py | 1 + tests/qasm3/test_rebase.py | 1 + tests/qasm3/test_reset.py | 1 + tests/qasm3/test_sizeof.py | 1 + tests/test_include.py | 1 + tests/test_linalg.py | 1 + tests/utils.py | 1 + 52 files changed, 103 insertions(+), 306 deletions(-) delete mode 100644 .github/workflows/logo-check.yml delete mode 100644 docs/_static/pyqasm.svg diff --git a/.github/workflows/logo-check.yml b/.github/workflows/logo-check.yml deleted file mode 100644 index 10a14909..00000000 --- a/.github/workflows/logo-check.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Logo Check - -on: - pull_request_target: - branches: ['main'] - types: [opened, reopened, ready_for_review, synchronize] - -jobs: - check-logo-changes: - name: Check for Logo Changes - runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot' && github.actor != 'dependabot[bot]' && github.actor != 'github-actions' && github.actor != 'github-actions[bot]' && github.event.pull_request.draft == false }} - steps: - - name: Checkout code - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Fetch main changes for diff - run: | - git fetch origin main - - - name: Check for logo.png changes - id : logo_check - run: | - # Get the list of changed files - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) - echo "changed_files<> $GITHUB_OUTPUT - echo "$CHANGED_FILES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - # Check if logo.png is in the changed files - if echo "$CHANGED_FILES" | grep -q "docs/_static/logo.png"; then - echo "❌ ERROR: Changes to docs/_static/logo.png are not allowed!" - echo "The logo.png file is protected and cannot be modified through pull requests." - echo "If you need to update the logo, please contact the repository maintainers." - echo "" - echo "Changed files in this PR:" - echo "$CHANGED_FILES" - exit 1 - else - echo "✅ No changes detected to docs/_static/logo.png" - fi - - - name: Comment on PR if logo changes detected - if: failure() - uses: actions/github-script@v8 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `🚫 **Logo Change Blocked** - - Changes to \`docs/_static/logo.png\` are not allowed in pull requests. - - **Why is this blocked?** - - The logo is a protected asset that should only be updated by repository maintainers - - This helps maintain brand consistency and prevents unauthorized logo changes - - **What should you do?** - - Remove the logo.png changes from this PR - - If you need to update the logo, please contact the repository maintainers directly - - **Files changed in this PR:** - \`\`\` - ${process.env.INPUT_CHANGED_FILES || 'Unable to retrieve changed files'} - \`\`\`` - }) - env: - INPUT_CHANGED_FILES: ${{ steps.logo_check.outputs.changed_files }} - diff --git a/README.md b/README.md index c39283e0..467949a5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# pyqasm -

PyQASM Logo (Light Mode) PyQASM Logo (Dark Mode) @@ -15,7 +13,9 @@ Python toolkit providing an OpenQASM 3 semantic analyzer and utilities for program analysis and compilation. -[![Env Badge](https://img.shields.io/endpoint?url=https://api.qbraid.com/api/environments/valid?envSlug=pyqasm_l9qauu&label=Launch+on+qBraid&labelColor=lightgrey&logo=rocket&logoSize=auto&style=for-the-badge)](http://account.qbraid.com?gitHubUrl=https://github.com/qBraid/pyqasm.git&envId=pyqasm_l9qauu) + ## Motivation [OpenQASM](https://openqasm.com/) is a powerful language for expressing hybrid quantum-classical programs, but it lacks a comprehensive tool supporting the _full capabilities of the language_. PyQASM aims to fill this gap by building upon the [`openqasm3.parser`](https://github.com/openqasm/openqasm/blob/ast-py/v1.0.1/source/openqasm/openqasm3/parser.py), and providing support for semantic analysis and utilities for program compilation. @@ -85,10 +85,10 @@ PyQASM offers robust support for the **extensive grammar of OpenQASM 3**, includ - Quantum-classical interaction (`measurement`, `reset`, etc.) - Inclusion of standard libraries (`stdgates.inc`, etc.) -- **[Unrolling](https://docs.qbraid.com/pyqasm/user-guide/examples#inlining-%26-unrolling):** +- **[Unrolling](https://docs.qbraid.com/v2/pyqasm/user-guide/examples#inlining-%26-unrolling):** Expands all custom gates, loops, subroutines, branches, etc. into a flat, hardware-ready sequence of instructions. -- **[Validation](https://docs.qbraid.com/pyqasm/user-guide/overview#the-qasmmodule-object):** +- **[Validation](https://docs.qbraid.com/v2/pyqasm/user-guide/overview#the-qasmmodule-object):** Performs semantic analysis to ensure programs are correct and conform to the OpenQASM 3 specification. --- diff --git a/bin/bump_version.py b/bin/bump_version.py index ef307f1c..74b9d2ce 100755 --- a/bin/bump_version.py +++ b/bin/bump_version.py @@ -16,6 +16,7 @@ Script to bump the major, minor, or patch version in pyproject.toml. """ + import pathlib import sys diff --git a/bin/stamp_pre_release.py b/bin/stamp_pre_release.py index febacad5..4be820c2 100755 --- a/bin/stamp_pre_release.py +++ b/bin/stamp_pre_release.py @@ -16,6 +16,7 @@ Script for getting/bumping the next pre-release version. """ + import pathlib import sys diff --git a/docs/_static/pyqasm.svg b/docs/_static/pyqasm.svg deleted file mode 100644 index 8f27c840..00000000 --- a/docs/_static/pyqasm.svg +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/conf.py b/docs/conf.py index e128a9f0..082aa405 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,7 @@ # -- Project information ----------------------------------------------------- project = "qBraid" -copyright = "2025, qBraid Development Team" +copyright = "2026, qBraid Development Team" author = "qBraid Development Team" # The full version, including alpha/beta/rc tags diff --git a/docs/index.rst b/docs/index.rst index 68f47a1d..3239e73e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -45,12 +45,11 @@ -

- pyqasm logo - PyQASM +

+ pyqasm logo

-

- Python toolkit for OpenQASM program analysis and compilation. +

+ Python toolkit for OpenQASM program analysis and compilation.

@@ -154,7 +153,7 @@ Example Resources ---------- -- `User Guide `_ +- `User Guide `_ - `Example Usage `_ - `Source Code `_ @@ -193,3 +192,9 @@ Resources :hidden: api/pyqasm + +.. toctree:: + :caption: ALGOS API Reference + :hidden: + + qbraid_algorithms \ No newline at end of file diff --git a/src/pyqasm/__init__.py b/src/pyqasm/__init__.py index 119db776..11ea581a 100644 --- a/src/pyqasm/__init__.py +++ b/src/pyqasm/__init__.py @@ -51,6 +51,7 @@ QasmParsingError """ + import warnings from importlib.metadata import version diff --git a/src/pyqasm/_logging.py b/src/pyqasm/_logging.py index eff9d49c..dfa74c08 100644 --- a/src/pyqasm/_logging.py +++ b/src/pyqasm/_logging.py @@ -16,6 +16,7 @@ Module defining logging configuration for PyQASM. """ + import logging # Define a custom logger for the module diff --git a/src/pyqasm/analyzer.py b/src/pyqasm/analyzer.py index 7c82afd3..74539ff7 100644 --- a/src/pyqasm/analyzer.py +++ b/src/pyqasm/analyzer.py @@ -16,6 +16,7 @@ Module with analysis functions for QASM visitor """ + from __future__ import annotations import re diff --git a/src/pyqasm/elements.py b/src/pyqasm/elements.py index eafd3dcf..a63e0442 100644 --- a/src/pyqasm/elements.py +++ b/src/pyqasm/elements.py @@ -16,6 +16,7 @@ Module defining Qasm Converter elements. """ + from dataclasses import dataclass from enum import Enum from typing import Any, Optional diff --git a/src/pyqasm/entrypoint.py b/src/pyqasm/entrypoint.py index a368ca34..73af7916 100644 --- a/src/pyqasm/entrypoint.py +++ b/src/pyqasm/entrypoint.py @@ -16,6 +16,7 @@ Top-level entrypoint functions for pyqasm. """ + from __future__ import annotations import os diff --git a/src/pyqasm/expressions.py b/src/pyqasm/expressions.py index 1480feec..0ad37c6d 100644 --- a/src/pyqasm/expressions.py +++ b/src/pyqasm/expressions.py @@ -16,6 +16,7 @@ Module containing the class for evaluating QASM expressions. """ + from openqasm3.ast import ( AngleType, BinaryExpression, diff --git a/src/pyqasm/linalg.py b/src/pyqasm/linalg.py index 657522c7..1cc3298e 100644 --- a/src/pyqasm/linalg.py +++ b/src/pyqasm/linalg.py @@ -16,6 +16,7 @@ Module for linear algebra functions necessary for gate decomposition. """ + from __future__ import annotations import cmath diff --git a/src/pyqasm/maps/decomposition_rules.py b/src/pyqasm/maps/decomposition_rules.py index b57b9a1f..3a17c961 100644 --- a/src/pyqasm/maps/decomposition_rules.py +++ b/src/pyqasm/maps/decomposition_rules.py @@ -15,6 +15,7 @@ """ Definition of the decomposition rules for the gates in the basis sets. """ + from enum import Enum from pyqasm.elements import BasisSet diff --git a/src/pyqasm/maps/gates.py b/src/pyqasm/maps/gates.py index a1accc93..0e792c28 100644 --- a/src/pyqasm/maps/gates.py +++ b/src/pyqasm/maps/gates.py @@ -19,7 +19,6 @@ """ - from typing import Callable import numpy as np diff --git a/src/pyqasm/preprocess.py b/src/pyqasm/preprocess.py index daf293f8..c02cfdb8 100644 --- a/src/pyqasm/preprocess.py +++ b/src/pyqasm/preprocess.py @@ -15,6 +15,7 @@ """ Pre-processing prior to loading OpenQASM files as QasmModule objects. """ + import os import re from dataclasses import dataclass, field diff --git a/src/pyqasm/printer.py b/src/pyqasm/printer.py index 7a7c52f3..eabeee66 100644 --- a/src/pyqasm/printer.py +++ b/src/pyqasm/printer.py @@ -18,6 +18,7 @@ Functions for drawing quantum circuits. """ + from __future__ import annotations from pathlib import Path diff --git a/src/pyqasm/pulse/frame.py b/src/pyqasm/pulse/frame.py index f8783986..0c333731 100644 --- a/src/pyqasm/pulse/frame.py +++ b/src/pyqasm/pulse/frame.py @@ -18,6 +18,7 @@ This module contains functions for validating different types of frame declarations in OpenPulse programs. """ + from typing import Any, Tuple import openqasm3.ast as qasm3_ast diff --git a/src/pyqasm/pulse/utils.py b/src/pyqasm/pulse/utils.py index 34ed0f5a..2c741033 100644 --- a/src/pyqasm/pulse/utils.py +++ b/src/pyqasm/pulse/utils.py @@ -16,6 +16,7 @@ Module with utility functions for Pulse visitor """ + import re from typing import Any, Sequence diff --git a/src/pyqasm/pulse/validator.py b/src/pyqasm/pulse/validator.py index 54573a4a..888f8180 100644 --- a/src/pyqasm/pulse/validator.py +++ b/src/pyqasm/pulse/validator.py @@ -16,6 +16,7 @@ Module with validation functions for Pulse visitor """ + from typing import Any, Optional import numpy as np diff --git a/src/pyqasm/pulse/visitor.py b/src/pyqasm/pulse/visitor.py index 6db8d4c3..9fa5cc14 100644 --- a/src/pyqasm/pulse/visitor.py +++ b/src/pyqasm/pulse/visitor.py @@ -19,6 +19,7 @@ Module defining OpenPulse Visitor. """ + import logging from typing import Any, Optional diff --git a/src/pyqasm/subroutines.py b/src/pyqasm/subroutines.py index 0045f34a..8e8f1971 100644 --- a/src/pyqasm/subroutines.py +++ b/src/pyqasm/subroutines.py @@ -16,6 +16,7 @@ Module containing the class for validating QASM3 subroutines. """ + import uuid from typing import Optional diff --git a/src/pyqasm/transformer.py b/src/pyqasm/transformer.py index 76f18396..9dbbfa2e 100644 --- a/src/pyqasm/transformer.py +++ b/src/pyqasm/transformer.py @@ -16,6 +16,7 @@ Module with transformation functions for QASM3 visitor """ + from copy import deepcopy from typing import Any, NamedTuple, Optional, Sequence, cast diff --git a/src/pyqasm/validator.py b/src/pyqasm/validator.py index 7160e96c..b9097fd6 100644 --- a/src/pyqasm/validator.py +++ b/src/pyqasm/validator.py @@ -16,6 +16,7 @@ Module with utility functions for QASM visitor """ + from typing import Any, Optional import numpy as np diff --git a/src/pyqasm/visitor.py b/src/pyqasm/visitor.py index 0c256350..0ad4cd60 100644 --- a/src/pyqasm/visitor.py +++ b/src/pyqasm/visitor.py @@ -18,6 +18,7 @@ Module defining Qasm Visitor. """ + import copy import logging import re diff --git a/tests/cli/test_unroll_cli_commands.py b/tests/cli/test_unroll_cli_commands.py index 32ffb19d..1b3e647d 100644 --- a/tests/cli/test_unroll_cli_commands.py +++ b/tests/cli/test_unroll_cli_commands.py @@ -43,16 +43,14 @@ def test_unroll_command_single_file(runner: CliRunner, tmp_path): """Test the `unroll` CLI command with a single file.""" # Create a test file test_file = tmp_path / "test.qasm" - test_file.write_text( - """ + test_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; gate hgate q { h q; } qubit[2] q; hgate q[0]; hgate q[1]; - """ - ) + """) result = runner.invoke(app, ["unroll", str(test_file)]) @@ -69,16 +67,14 @@ def test_unroll_command_single_file_with_output(runner: CliRunner, tmp_path): """Test the `unroll` CLI command with explicit output path.""" # Create a test file test_file = tmp_path / "test.qasm" - test_file.write_text( - """ + test_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; gate hgate q { h q; } qubit[2] q; hgate q[0]; hgate q[1]; - """ - ) + """) output_file = tmp_path / "custom_output.qasm" result = runner.invoke(app, ["unroll", str(test_file), "--output", str(output_file)]) @@ -130,16 +126,14 @@ def test_unroll_command_directory(runner: CliRunner, tmp_path): # Create multiple test files for i in range(3): test_file = test_dir / f"test{i}.qasm" - test_file.write_text( - f""" + test_file.write_text(f""" OPENQASM 3.0; include "stdgates.inc"; gate hgate{i} q {{ h q; }} qubit[2] q; hgate{i} q[0]; hgate{i} q[1]; - """ - ) + """) result = runner.invoke(app, ["unroll", str(test_dir)]) @@ -194,14 +188,12 @@ def test_unroll_command_with_skip(runner: CliRunner, tmp_path): # Create test files for i in range(3): test_file = test_dir / f"test{i}.qasm" - test_file.write_text( - """ + test_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; qubit[2] q; h q; - """ - ) + """) # Skip one file skip_file = str(test_dir / "test1.qasm") @@ -224,27 +216,23 @@ def test_unroll_command_with_skip_tag(runner: CliRunner, tmp_path): # Create a file with skip tag skip_file = test_dir / "skip_me.qasm" - skip_file.write_text( - """ + skip_file.write_text(""" // pyqasm disable: unroll OPENQASM 3.0; include "stdgates.inc"; qubit[2] q; h q[0]; - """ - ) + """) # Create a normal file normal_file = test_dir / "normal.qasm" - normal_file.write_text( - """ + normal_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; gate hgate q { h q; } qubit[2] q; hgate q[0]; - """ - ) + """) result = runner.invoke(app, ["unroll", str(test_dir)]) @@ -260,14 +248,12 @@ def test_unroll_command_with_invalid_file(runner: CliRunner, tmp_path): """Test the `unroll` CLI command with an invalid file.""" # Create an invalid test file test_file = tmp_path / "invalid.qasm" - test_file.write_text( - """ + test_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; qubit[1] q; h q[2]; // Invalid: index 2 out of range - """ - ) + """) result = runner.invoke(app, ["unroll", str(test_file)]) @@ -285,25 +271,21 @@ def test_unroll_command_mixed_success_and_failure(runner: CliRunner, tmp_path): # Create a valid file valid_file = test_dir / "valid.qasm" - valid_file.write_text( - """ + valid_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; qubit[1] q; h q[0]; - """ - ) + """) # Create an invalid file invalid_file = test_dir / "invalid.qasm" - invalid_file.write_text( - """ + invalid_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; qubit[1] q; h q[2]; // Invalid: index 2 out of range - """ - ) + """) result = runner.invoke(app, ["unroll", str(test_dir)]) @@ -450,16 +432,14 @@ def test_unroll_qasm_function_single_file(capsys, tmp_path): """Test unroll_qasm function directly with a single file.""" # Create a test file test_file = tmp_path / "test.qasm" - test_file.write_text( - """ + test_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; gate hgate q { h q; } qubit[2] q; hgate q[0]; hgate q[1]; - """ - ) + """) with pytest.raises(typer.Exit) as exc_info: unroll_qasm([str(test_file)]) @@ -485,14 +465,12 @@ def test_unroll_qasm_function_with_invalid_file(capsys, tmp_path): """Test unroll_qasm function directly with an invalid file.""" # Create an invalid test file test_file = tmp_path / "invalid.qasm" - test_file.write_text( - """ + test_file.write_text(""" OPENQASM 3.0; include "stdgates.inc"; qubit[1] q; h q[2]; // Invalid: index 2 out of range - """ - ) + """) with pytest.raises(typer.Exit) as exc_info: unroll_qasm([str(test_file)]) @@ -510,13 +488,11 @@ def test_unroll_command_reports_logger_error_output(runner: CliRunner, tmp_path) """Test that logger error output is shown in CLI output when unroll fails.""" # Create an invalid QASM file (e.g., missing semicolon) invalid_file = tmp_path / "invalid.qasm" - invalid_file.write_text( - """ + invalid_file.write_text(""" OPENQASM 3.0 qubit[2] q h q[0] - """ - ) + """) result = runner.invoke(app, ["unroll", str(invalid_file)]) diff --git a/tests/qasm2/test_declarations.py b/tests/qasm2/test_declarations.py index 60a9c50c..942727b9 100644 --- a/tests/qasm2/test_declarations.py +++ b/tests/qasm2/test_declarations.py @@ -17,6 +17,7 @@ declarations. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm2/test_operations.py b/tests/qasm2/test_operations.py index 21a2c4db..441b6bc1 100644 --- a/tests/qasm2/test_operations.py +++ b/tests/qasm2/test_operations.py @@ -17,6 +17,7 @@ declarations. """ + import pytest from pyqasm.entrypoint import dumps, loads @@ -71,8 +72,7 @@ def test_subroutine_blacklist(): # subroutines with pytest.raises(ValidationError): - loads( - """ + loads(""" OPENQASM 2.0; include 'qelib1.inc'; qreg q[2]; @@ -81,15 +81,13 @@ def test_subroutine_blacklist(): def my_func(int[32] a) -> int[32] { return a; } - """ - ).validate() + """).validate() def test_switch_blacklist(): # switch statements with pytest.raises(ValidationError): - loads( - """ + loads(""" OPENQASM 2.0; include 'qelib1.inc'; qreg q[2]; @@ -101,15 +99,13 @@ def test_switch_blacklist(): default: h q[0]; } - """ - ).validate() + """).validate() def test_for_blacklist(): # for loops with pytest.raises(ValidationError): - loads( - """ + loads(""" OPENQASM 2.0; include 'qelib1.inc'; qreg q[2]; @@ -118,15 +114,13 @@ def test_for_blacklist(): for (int i = 0; i < 2; i++) { h q[i]; } - """ - ).validate() + """).validate() def test_while_blacklist(): # while loops with pytest.raises(ValidationError): - loads( - """ + loads(""" OPENQASM 2.0; include 'qelib1.inc'; qreg q[2]; @@ -135,8 +129,7 @@ def test_while_blacklist(): while (1) { h q[0]; } - """ - ).validate() + """).validate() # TODO : extend to more constructs diff --git a/tests/qasm2/test_rotation_gates.py b/tests/qasm2/test_rotation_gates.py index afe1feed..8f0a24eb 100644 --- a/tests/qasm2/test_rotation_gates.py +++ b/tests/qasm2/test_rotation_gates.py @@ -17,6 +17,7 @@ rotations in qasm2 format. """ + from pyqasm.entrypoint import dumps, loads from tests.utils import check_unrolled_qasm diff --git a/tests/qasm2/test_to_qasm3.py b/tests/qasm2/test_to_qasm3.py index bcbd094b..eb26da5a 100644 --- a/tests/qasm2/test_to_qasm3.py +++ b/tests/qasm2/test_to_qasm3.py @@ -16,6 +16,7 @@ Module containing unit tests for conversion to qasm3. """ + import pytest from pyqasm.entrypoint import loads diff --git a/tests/qasm3/declarations/test_classical.py b/tests/qasm3/declarations/test_classical.py index 1d6733f0..37696c42 100644 --- a/tests/qasm3/declarations/test_classical.py +++ b/tests/qasm3/declarations/test_classical.py @@ -16,6 +16,7 @@ Module containing unit tests for QASM3 to QIR conversion functions. """ + import pytest from pyqasm.entrypoint import loads diff --git a/tests/qasm3/declarations/test_quantum.py b/tests/qasm3/declarations/test_quantum.py index 39c38a8a..0d6844c8 100644 --- a/tests/qasm3/declarations/test_quantum.py +++ b/tests/qasm3/declarations/test_quantum.py @@ -17,6 +17,7 @@ declarations. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/resources/gates.py b/tests/qasm3/resources/gates.py index 9cac401f..cce5375a 100644 --- a/tests/qasm3/resources/gates.py +++ b/tests/qasm3/resources/gates.py @@ -18,6 +18,7 @@ Module defining QASM3 gate tests. """ + import os import pytest diff --git a/tests/qasm3/resources/subroutines.py b/tests/qasm3/resources/subroutines.py index 000c46d9..3885af1a 100644 --- a/tests/qasm3/resources/subroutines.py +++ b/tests/qasm3/resources/subroutines.py @@ -16,6 +16,7 @@ Module defining subroutine tests. """ + SUBROUTINE_INCORRECT_TESTS = { "undeclared_call": ( """ diff --git a/tests/qasm3/resources/variables.py b/tests/qasm3/resources/variables.py index 10415d25..654b3380 100644 --- a/tests/qasm3/resources/variables.py +++ b/tests/qasm3/resources/variables.py @@ -16,6 +16,7 @@ Module defining QASM3 incorrect variable tests. """ + DECLARATION_TESTS = { "keyword_redeclaration": ( """ diff --git a/tests/qasm3/test_barrier.py b/tests/qasm3/test_barrier.py index bbb1cb81..fa3456cb 100644 --- a/tests/qasm3/test_barrier.py +++ b/tests/qasm3/test_barrier.py @@ -16,6 +16,7 @@ Module containing unit tests for the barrier operation. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_box.py b/tests/qasm3/test_box.py index 7580c978..d8ef0d1a 100644 --- a/tests/qasm3/test_box.py +++ b/tests/qasm3/test_box.py @@ -15,6 +15,7 @@ """ Module containing unit tests for Box Statement. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_delay.py b/tests/qasm3/test_delay.py index 28ea4f57..ceff3b90 100644 --- a/tests/qasm3/test_delay.py +++ b/tests/qasm3/test_delay.py @@ -15,6 +15,7 @@ """ Module containing unit tests for Delay Instruction. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_depth.py b/tests/qasm3/test_depth.py index a796a50a..2c9db0ba 100644 --- a/tests/qasm3/test_depth.py +++ b/tests/qasm3/test_depth.py @@ -16,6 +16,7 @@ Module containing unit tests for calculating program depth. """ + import pytest from pyqasm.entrypoint import loads diff --git a/tests/qasm3/test_entrypoint.py b/tests/qasm3/test_entrypoint.py index 93a8061a..4fa791e9 100644 --- a/tests/qasm3/test_entrypoint.py +++ b/tests/qasm3/test_entrypoint.py @@ -16,6 +16,7 @@ Module containing unit tests for entrypoint functions. """ + import os import pytest diff --git a/tests/qasm3/test_expressions.py b/tests/qasm3/test_expressions.py index b07b7a63..ef549f51 100644 --- a/tests/qasm3/test_expressions.py +++ b/tests/qasm3/test_expressions.py @@ -16,6 +16,7 @@ Module containing unit tests for expressions. """ + import pytest from pyqasm.entrypoint import loads diff --git a/tests/qasm3/test_format.py b/tests/qasm3/test_format.py index f5b31b37..831c26ba 100644 --- a/tests/qasm3/test_format.py +++ b/tests/qasm3/test_format.py @@ -16,6 +16,7 @@ Module containing unit tests for program formatting """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_gates.py b/tests/qasm3/test_gates.py index c0e88a55..6dae4bd2 100644 --- a/tests/qasm3/test_gates.py +++ b/tests/qasm3/test_gates.py @@ -16,6 +16,7 @@ Module containing unit tests for unrolling quantum gates. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_loop.py b/tests/qasm3/test_loop.py index bcb71c44..479f85c7 100644 --- a/tests/qasm3/test_loop.py +++ b/tests/qasm3/test_loop.py @@ -46,8 +46,7 @@ def test_convert_qasm3_for_loop(): """Test converting a QASM3 program that contains a for loop.""" - result = loads( - """ + result = loads(""" OPENQASM 3.0; include "stdgates.inc"; @@ -59,8 +58,7 @@ def test_convert_qasm3_for_loop(): cx q[i], q[i+1]; } measure q->c; - """ - ) + """) result.unroll() assert result.num_qubits == 4 assert result.num_clbits == 4 @@ -71,8 +69,7 @@ def test_convert_qasm3_for_loop(): def test_convert_qasm3_for_loop_shadow(): """Test for loop where loop variable shadows variable from global scope.""" - result = loads( - """ + result = loads(""" OPENQASM 3.0; include "stdgates.inc"; @@ -87,8 +84,7 @@ def test_convert_qasm3_for_loop_shadow(): } h q[i]; measure q->c; - """ - ) + """) result.unroll() assert result.num_clbits == 4 @@ -100,8 +96,7 @@ def test_convert_qasm3_for_loop_shadow(): def test_convert_qasm3_for_loop_enclosing(): """Test for loop where variable from outer loop is accessed from inside the loop.""" - result = loads( - """ + result = loads(""" OPENQASM 3.0; include "stdgates.inc"; @@ -116,8 +111,7 @@ def test_convert_qasm3_for_loop_enclosing(): h q[j]; } measure q->c; - """ - ) + """) result.unroll() assert result.num_clbits == 4 @@ -129,8 +123,7 @@ def test_convert_qasm3_for_loop_enclosing(): def test_convert_qasm3_for_loop_enclosing_modifying(): """Test for loop where variable from outer loop is modified from inside the loop.""" - result = loads( - """ + result = loads(""" OPENQASM 3.0; include "stdgates.inc"; @@ -147,8 +140,7 @@ def test_convert_qasm3_for_loop_enclosing_modifying(): } h q[j]; measure q->c; - """ - ) + """) result.unroll() assert result.num_clbits == 4 @@ -160,8 +152,7 @@ def test_convert_qasm3_for_loop_enclosing_modifying(): def test_convert_qasm3_for_loop_discrete_set(): """Test converting a QASM3 program that contains a for loop initialized from a DiscreteSet.""" - result = loads( - """ + result = loads(""" OPENQASM 3.0; include "stdgates.inc"; @@ -173,8 +164,7 @@ def test_convert_qasm3_for_loop_discrete_set(): cx q[i], q[i+1]; } measure q->c; - """ - ) + """) result.unroll() assert result.num_clbits == 4 diff --git a/tests/qasm3/test_measurement.py b/tests/qasm3/test_measurement.py index 61ace6ee..89f58728 100644 --- a/tests/qasm3/test_measurement.py +++ b/tests/qasm3/test_measurement.py @@ -16,6 +16,7 @@ Module containing unit tests for loading measurement operations. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_rebase.py b/tests/qasm3/test_rebase.py index 0b310d22..79a245c5 100644 --- a/tests/qasm3/test_rebase.py +++ b/tests/qasm3/test_rebase.py @@ -16,6 +16,7 @@ Module containing unit tests for rebasing programms """ + import pytest from pyqasm.elements import BasisSet diff --git a/tests/qasm3/test_reset.py b/tests/qasm3/test_reset.py index dafe71ff..263ce09f 100644 --- a/tests/qasm3/test_reset.py +++ b/tests/qasm3/test_reset.py @@ -16,6 +16,7 @@ Module containing unit tests for reset operation. """ + import pytest from pyqasm.entrypoint import dumps, loads diff --git a/tests/qasm3/test_sizeof.py b/tests/qasm3/test_sizeof.py index 9ab82a68..15acf613 100644 --- a/tests/qasm3/test_sizeof.py +++ b/tests/qasm3/test_sizeof.py @@ -16,6 +16,7 @@ Module containing unit tests for sizeof operation. """ + import pytest from pyqasm.entrypoint import loads diff --git a/tests/test_include.py b/tests/test_include.py index acbc3eb6..c1d508ad 100644 --- a/tests/test_include.py +++ b/tests/test_include.py @@ -16,6 +16,7 @@ Module containing unit tests for linalg.py functions. """ + import pytest from pyqasm import ValidationError, dumps, loads diff --git a/tests/test_linalg.py b/tests/test_linalg.py index 2f77859b..30c551ba 100644 --- a/tests/test_linalg.py +++ b/tests/test_linalg.py @@ -16,6 +16,7 @@ Module containing unit tests for linalg.py functions. """ + import numpy as np import pytest diff --git a/tests/utils.py b/tests/utils.py index bfe986de..8272c803 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -16,6 +16,7 @@ Module containing utility functions for unit tests. """ + import openqasm3.ast as qasm3_ast from pyqasm.maps.expressions import CONSTANTS_MAP From d249a05eebb6c32a8b7f93a9ecdc38af41e5685d Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Tue, 17 Feb 2026 12:47:55 -0600 Subject: [PATCH 2/3] Update CHANGELOG and pyproject.toml to reflect new logo, added Python 3.14 support, and minor formatting fixes. --- CHANGELOG.md | 1 + pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd71109d..23ed69f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Types of changes: ### Improved / Modified - Moved the `visit_map` from the `visit_statement` function to a class level variable for improved efficiency. ([#279](https://github.com/qBraid/pyqasm/pull/279)) - Added SVG light and dark mode versions of PyQASM logo, with and without text, and added dynamic logo mode to `README.md` based on color palette used on user-side. ([#288](https://github.com/qBraid/pyqasm/pull/288)) +- Updated docs with new logo, added v2 links, and applied minor Python formatting fixes for style consistency. ([#289](https://github.com/qBraid/pyqasm/pull/289)) ### Deprecated diff --git a/pyproject.toml b/pyproject.toml index 79acdc06..9d38c6f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development", "Topic :: Scientific/Engineering", From 3bfab5216c69fa44627313ce59f5bb4ee01a1788 Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Tue, 17 Feb 2026 12:52:08 -0600 Subject: [PATCH 3/3] update logo dimensions + padding --- docs/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 3239e73e..766bffb7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -45,10 +45,10 @@ -

- pyqasm logo +

+ pyqasm logo

-

+

Python toolkit for OpenQASM program analysis and compilation.