PsiQ / qref

Quantum Resource Estimate Format

Home Page:https://psiq.github.io/qref/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add example with visualization

mstechly opened this issue · comments

We should have an example how to use rendering module somewhere in our docs. I'm thinking about a bit more polished version of the following:

import yaml
from qref import SchemaV1
from qref.experimental.rendering import to_graphviz

with open("alias_sampling_detailed_fixed_resources.yaml", "r") as f:
    data = yaml.safe_load(f)
program = SchemaV1.model_validate(data)
gv_object = to_graphviz(program)
gv_object.render("as.png")

CC: @dexter2206