PyQASM 0.5.0
Release 0.5.0 (August 14, 2025)
Summary
Added
- A new discussion template for issues in pyqasm (#213)
- A github workflow for validating
CHANGELOGupdates in a PR (#214) - Added
unrollcommand support in PYQASM CLI with options skipping files, overwriting originals files, and specifying output paths.(#224) - Added
Duration,Stretchtype,DelayandBoxsupport forOPENQASM3code in pyqasm. (#231)Example:
OPENQASM 3.0; include "stdgates.inc"; qubit[3] q; duration t1 = 200dt; duration t2 = 300ns; stretch s1; delay[t1] q[0]; delay[t2] q[1]; delay[s1] q[0], q[2]; box [t2] { h q[0]; cx q[0], q[1]; delay[100ns] q[2]; }
- Added a new
QasmModule.comparemethod to compare two QASM modules, providing a detailed report of differences in gates, qubits, and measurements. This method is useful for comparing two identifying differences in QASM programs, their structure and operations. (#233) - Added
.github/copilot-instructions.mdto the repository to document coding standards and design principles for pyqasm. This file provides detailed guidance on documentation, static typing, formatting, error handling, and adherence to the QASM specification for all code contributions. (#234) - Added support for custom include statements in
OPENQASM3code in pyqasm. This allows users to include custom files or libraries in their QASM programs, enhancing modularity and reusability of code. (#236) - Added support for
Angle,externandComplextype inOPENQASM3code in pyqasm. (#239)Example:
OPENQASM 3.0; include "stdgates.inc"; angle[8] ang1; ang1 = 9 * (pi / 8); angle[8] ang1 = 7 * (pi / 8); angle[8] ang3 = ang1 + ang2; complex c1 = -2.5 - 3.5im; const complex c2 = 2.0+arccos(π/2) + (3.1 * 5.5im); const complex c12 = c1 * c2; float a = 1.0; int b = 2; extern func1(float, int) -> bit; bit c = 2 * func1(a, b); bit fc = -func1(a, b); bit[4] bd = "0101"; extern func6(bit[4]) -> bit[4]; bit[4] be1 = func6(bd);
Improved / Modified
- Added
slots=Trueparameter to the data classes inelements.pyto improve memory efficiency (#218) - Updated the documentation to include core features in the
README(#219) - Added support to
device qubitresgister consolidation.(#222) - Updated the scoping of variables in
QasmVisitorusing aScopeManager. This change is introduced to ensure that theQasmVisitorand thePulseVisitorcan share the sameScopeManagerinstance, allowing for consistent variable scoping across different visitors. No change in the user API is expected. (#232) - Enhance function call handling by adding support for nested functions. This change allows for more complex function definitions and calls, enabling better modularity and reusability of code within QASM programs. (#245)
Deprecated
Removed
Fixed
- Fixed multiple axes error in circuit visualization of decomposable gates in
drawmethod. (#209) - Fixed depth calculation for decomposable gates by computing depth of each constituent quantum gate.(#211)
- Optimized statement copying in
_visit_function_callwith shallow-copy fallback to deepcopy and addedmax_loop_itersloop‐limit check in for loops.(#223)
Dependencies
- Add
pillow<11.3.0dependency for test and visualization to avoid CI errors in Linux builds (#226) - Added
tabulateto the testing dependencies to support new comparison table tests. (#216) - Update
docutilsrequirement from <0.22 to <0.23 (#241) - Bumps
actions/download-artifactversion from 4 to 5 (#243)
New Contributors
- @LukeAndreesen made their first contribution in #236
Full Changelog: v0.4.0...v0.5.0