A graph representation for quantum programs