autoqasm package

AutoQASM provides a native Python programming experience for building complex quantum programs and running them on simulators and quantum hardware using Amazon Braket.

The basic usage of AutoQASM is as follows:

import autoqasm as aq
from autoqasm.instructions import h, cnot, measure

@aq.main
def my_program():
    h(0)
    cnot(0, 1)
    result = measure([0, 1])
    return result

program = my_program()
print(program.build().to_ir())

The Python code above outputs the following OpenQASM program:

OPENQASM 3.0;
qubit[2] __qubits__;
h __qubits__[0];
cnot __qubits__[0], __qubits__[1];
bit[2] result;
result[0] = measure __qubits__[0];
result[1] = measure __qubits__[1];

Subpackages

Submodules