Skip to content

Syntactic sugar for declaring signatures #1769

@mpharrigan

Description

@mpharrigan

A traditional function signature gives is an ordered mapping of parameter name to its data type. In Qualtran, we have both inputs and outputs as part of the function signature with many "registers" doing double-duty as both inputs and outputs ("THRU" registers). We support classical ndarrays of variables with the shape parameter. Suggest supporting building signatures with a syntax like:

Signature.build(ctrl=1, ints=QInt(8)[5])
Signature.build(x=(QAny(3), QBit()[3]))

for

Signature([Register('ctrl', QBit()), Register('ints', QInt(8), shape=(5,))])
Signature([Register('x', QAny(3), side=Side.LEFT), Register('x', QBit(), shape=(3,), side=Side.RIGHT)])

respectively

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions