Skip to content

Getting Started with Quantum Program Synthesis

The first steps in quantum program synthesis are defining the algorithms, its constraints, and your preferences. These are described in detail in the following sections.

Once your model is fully defined, it is time to synthesize it.

In the IDE, describe the model in the model page. After writing down the model, click Synthesize on the bottom right of the page. After synthesis, you are automatically redirected to the quantum program page.

Initiate the synthesis process by performing the synthesize method on a model. Alternatively, you can use the async synthesize_async method as part of an async code.

from classiq import Output, QBit, allocate, create_model, synthesize
from classiq.qmod.quantum_function import QFunc


@QFunc
def main(res: Output[QBit]) -> None:
    allocate(1, res)


model = create_model(main)
qprog = synthesize(model)