Notate Lets Programmers Define Quantum Circuits by Simply Drawing a Diagram

Designed to augment, rather than supplant, traditional textual programming, Notate can boost development speed.

Researchers from Cornell University, Cornell Tech, and Harvard University have developed a tool to make programming more accessible — by allowing would-be programmers to simply draw a diagram for what they want to happen.

"A system like this would be great for data science, specifically with sketching plots and charts that then inter-operate with textual code," claims lead author Ian Arawjo of the work, presented at the ACM Symposium on User Interface Software and Technology (UIST '22). "Our work shows that the current infrastructure of programming is actually holding us back. People are ready for this type of feature, but developers of interfaces for typing code need to take note of this and support images and graphical interfaces inside code."

Notate aims to make programming quicker and more accessible, by interpreting hand-drawn diagrams. (📷: Arawjo et al)

The team's tool is based on what it calls "notational programming," and centers around an extension for programming notebooks like Jupytr dubbed Notate — and a corresponding notation, Qaw, which allows the user to define quantum circuits using only a pen input and their drawing skills.

The Notation system works by passing hand-drawn diagrams to an interpreter, qcr, which combines classical sketch recognition techniques with a deep learning algorithm to interpret each diagram and output corresponding IBM Qiskit quantum circuit code. "Including Notate," the team notes, "our full system took about a year for the first author to build, including (re)training of the ML model and an iterative process to improve the heuristic part of the algorithm."

To prove the concept, the team carried out usability testing with 12 participants between 18-27 years of age. Each were given a tablet computer and a Jupyter notebook environment running the Notate extension — and then given six tasks "of increasing complexity" to solve. All completed the first five, with nine able to finish the final task before time ran out — while a comparison between Notation solutions and traditional textual programming suggested the potential for faster solutions using the diagramming method.

"Although Notate participants were introduced to an entirely new notation, the slash-wire, in Task 3 — compared to Qiskit participants who used familiar for loops — they were able to complete the task significantly faster," the team found. "This is all the more surprising since, usually, a portion of Notate participants' task time was spent wrangling recognition errors."

"Comparison of task times for Notate vs. Qiskit conditions also provides evidence for a longstanding contention by programming researchers studying 'visual' vs. 'textual' notations: that which is 'better' depends on the task at hand, how the design of the notation affords or resists encoding a particular solution, and the background and preferences of who is trying to apply it," the researchers add. "Taken collectively, these findings support our 'heterogeneous' vision of notational programming — for designs that mix modalities, instead of demanding one for all time."

The team's work has been published in the Proceedings of the 35th Annual ACM Symposium on User Interface Software and Technology (UIST '22), under closed-access terms, with Jupyter notebook task files and equivalent Qiskit tasks available for download.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles