From 4f3af78c72c2fcf58008c0bb6e4af7aa07637095 Mon Sep 17 00:00:00 2001 From: TheGupta2012 Date: Thu, 19 Sep 2024 11:20:20 +0530 Subject: [PATCH] fix print + update changelog --- CHANGELOG.md | 24 ++++++++++++++++++++++++ qbraid_qir/qasm3/transformer.py | 2 -- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a812f5..83aebb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,11 +17,33 @@ Types of changes: ### ➕ New Features * Add support for pauli measurement operators in `cirq` converter ( [#144](https://github.com/qBraid/qbraid-qir/pull/144) ) * Add support for `sizeof` operator in `openqasm` converter ( [#146](https://github.com/qBraid/qbraid-qir/pull/146) ) +* Add complete support for `array` type in subroutines ( [#151](https://github.com/qBraid/qbraid-qir/pull/151) ) ### 🌟 Improvements * Re-factor the `BasicQasmVisitor` and improve modularity ( [#142](https://github.com/qBraid/qbraid-qir/pull/142) ) * Add static type checking with `mypy` ( [#150](https://github.com/qBraid/qbraid-qir/pull/150) ) * Improve measurement statement parsing logic and add support for range definition and discrete set ( [#150](https://github.com/qBraid/qbraid-qir/pull/150) ) +* Expanded support for parameters used in gate body expressions. Initially, if a statement inside a gate body used its parameters in arbitrary expressions, the expression was not evaluated correctly as the identifiers were not replaced. ( [#157](https://github.com/qBraid/qbraid-qir/pull/157) ). Example - + +```c++ +// previous +gate my_gate(a, b) q { + rx(a) q; + ry(b) q; + + // this was not supported + rz(5 * a) q; +} + +// current +gate my_gate(a, b) q { + rz(a) q; + + // expressions supported now + rx(a * 3.2) q; + ry(a / b + pi) q; +} +``` ### 📜 Documentation * Housekeeping updates for release ( [#135](https://github.com/qBraid/qbraid-qir/pull/135) ) @@ -32,6 +54,8 @@ Types of changes: * Fix function block issues where qubit references were not getting populated correctly. Users can now use `for`, `switch` and other constructs inside functions. ( [#141](https://github.com/qBraid/qbraid-qir/pull/141) ) ### ⬇️ Dependency Updates +* Update sphinx-autodoc-typehints requirement from <2.3,>=1.24 to >=1.24,<2.4 ( [#152](https://github.com/qBraid/qbraid-qir/pull/152) ) +* Update sphinx-autodoc-typehints requirement from <2.4,>=1.24 to >=1.24,<2.5 ( [#153](https://github.com/qBraid/qbraid-qir/pull/153) ) ### 👋 Deprecations diff --git a/qbraid_qir/qasm3/transformer.py b/qbraid_qir/qasm3/transformer.py index 0b0ed40..cb0081f 100644 --- a/qbraid_qir/qasm3/transformer.py +++ b/qbraid_qir/qasm3/transformer.py @@ -202,9 +202,7 @@ def transform_gate_params( for i, actual_arg in enumerate(gate_op.arguments): # recursively replace ALL instances of the parameter in the expression # with the actual value - print("Before transformation: ", actual_arg) gate_op.arguments[i] = Qasm3Transformer.transform_expression(actual_arg, param_map) - print("After transformation: ", gate_op.arguments[i]) @staticmethod def get_branch_params(condition: Any) -> tuple[int, str]: