oqpy icon indicating copy to clipboard operation
oqpy copied to clipboard

OpenQASM AST for DelayInstruction/QuantumBarrier `qubits` attribute name is misleading

Open stephteo opened this issue 3 years ago • 2 comments

The AST for DelayInstruction and QuantumBarrier defines a qubits attribute, but in oqpy we also use them for frames so the attribute naming is misleading. The typing is not an issue here.

@dataclass
class DelayInstruction(QuantumStatement):
    """
    Delay instruction

    Example::

        delay[start_stretch] $0;
    """

    duration: Expression
    qubits: List[Union[IndexedIdentifier, Identifier]]

@dataclass
class QuantumBarrier(QuantumStatement):
    """
    A quantum barrier instruction

    Example::

        barrier q;
    """

    qubits: List[Expression]

stephteo avatar Sep 26 '22 23:09 stephteo

This PR already makes the change to the variable name in Program.delay() and Program.barrier() from qubits to qubits_or_frames. If that is sufficient, we can close this issue.

stephteo avatar Sep 26 '22 23:09 stephteo

sounds like this is an openpulse issue

karalekas avatar Oct 05 '22 18:10 karalekas