braket.ir.openqasm.program_v1 module

class braket.ir.openqasm.program_v1.Program(*, braketSchemaHeader: BraketSchemaHeader = BraketSchemaHeader(name='braket.ir.openqasm.program', version='1'), source: str, inputs: Dict[ConstrainedStrValue, ConstrainedStrValue | ConstrainedFloatValue | int | List[ConstrainedStrValue | ConstrainedFloatValue | int]] | None = None)[source]

Bases: BraketSchemaBase

Root object of the OpenQASM IR.

braketSchemaHeader

Schema header. Users do not need to set this value. Only default is allowed.

Type:

BraketSchemaHeader

source

OpenQASM source program.

Type:

str

inputs

Inputs for the OpenQASM program.

Type:

Dict

Examples

>>> Program(source='OPENQASM 3.0; cx $0, $1')
>>> Program(source='OPENQASM 3.0; input float alpha; qubit[2] q; bit[2] c;     rx(alpha) q[0]; h q[0]; cx q[0], q[1]; c = measure q;', inputs={"alpha": 0.0})

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

braketSchemaHeader: BraketSchemaHeader
source: str
inputs: Dict[ConstrainedStrValue, ConstrainedStrValue | ConstrainedFloatValue | int | List[ConstrainedStrValue | ConstrainedFloatValue | int]] | None