Skip to content

[BUG] Incorrect validation error on parametrized gates #175

@ryanhill1

Description

@ryanhill1

Environment

  • PyQASM version: 0.3.1
  • Python version: 3.11
  • Operating system: Ubuntu 20.04

What happened?

import pyqasm

qasm = """
OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
u1(pi) q[0];
"""

module = pyqasm.loads(qasm)

module.validate()
ERROR:pyqasm: Error at line 5, column 0 in QASM file

 >>>>>> u1(pi) q[0];
...

ValidationError: Expected 1 parameter for gate 'u1', but got 1

Thee program gave the expected number of parameters, but still resulted in validation error, showing there is some bug here. Could also happening for other parameterized gates, but haven't checked.

Currently causing qBraid-SDK daily CI to fail: https://github.com/qBraid/qBraid/actions/runs/14575738997/job/40881368223

Suggestions (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions