Skip to content

Add test for converting openqasm3 to cudaq with control modifier(s) #938

@ryanhill1

Description

@ryanhill1

Control modifiers are now supported by pyqasm, so would like to add a test case for the following lines in openqasm3_to_cudaq:

# pyqasm unrolls multiple modifiers.
# ctrl isn't supported so multi-ctrl is not an issue at the moment.
assert len(statement.modifiers) <= 1
if len(statement.modifiers) == 1:
mod = statement.modifiers[0]
assert (
mod.modifier == ast.GateModifierName.ctrl
), f"non-ctrl modifiers should've be unrolled: {mod}"
gate = get_gate(name, targs)
kernel.control(gate, qubit_refs[0], *qubit_refs[1:])

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerstesting 🧪Updates, changes to unit tests and coveragetranspiler 🚊Circuit conversions across program types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions