Teaching Quantum Computing Using Microsoft Quantum Development Kit and Azure Quantum
Teaching Quantum Computing Using Microsoft Quantum Development Kit and Azure Quantum
Abstract—This report describes my experience teaching a focused either on the mathematical presentation of the field or
2023 IEEE International Conference on Quantum Computing and Engineering (QCE) | 979-8-3503-4323-6/23/$31.00 ©2023 IEEE | DOI: 10.1109/QCE57702.2023.20320
graduate-level quantum computing course at Northeastern Uni- on the theoretical physics of quantum systems and hardware
versity in the academic year 2022–23. The course takes a devices, would be inefficient.
practical, software-driven approach to the course, teaching basic
quantum concepts and algorithms through hands-on program- The course approached the subject of quantum computing
ming assignments and a software-focused final project. The from a computer science point of view, similar to [4]. It
course guides learners through all stages of the quantum software focused on teaching basic concepts and algorithms of quantum
development process, from solving quantum computing problems computing in a practical manner, requiring students to apply
and implementing solutions to debugging quantum programs,
optimizing the code, and running the code on quantum hardware.
their theoretical knowledge to solving problems, write the
This report offers instructors who want to adopt a similar prac- quantum code to implement the solutions, and verify its
tical approach to teaching quantum computing a comprehensive correctness using quantum simulators or explore its behavior
guide to getting started. when executed on quantum hardware.
The course covered a combination of introductory topics
I. I NTRODUCTION
featured in most courses and textbooks on quantum computing
Quantum computing represents a novel approach to com- with deeper dives into the topics important for understanding
puting, utilizing quantum-mechanical phenomena like super- the current landscape and the future directions of quantum
position and entanglement to execute certain computational computing. It consisted of 10 week-long lecture modules (the
tasks more efficiently compared to classical computing. The number selected to match the length of the semester), an
increasing interest and financial support in the field of quantum introductory module covering the required software setup and
information science and engineering (QISE) have resulted in the math prerequisites (linear algebra tutorial), and a final
a growing need for quantum-trained workforce. project. The lecture modules were, in order of presentation:
Recent evaluations of the needs of quantum industry[1][2]
identified quantum software engineering and application devel- 1) Single-qubit quantum systems: the concept of a quantum
opment as one of the competencies essential for certain roles state, superposition, single-qubit gates, measurements.
within the sector. Surveys of the university programs offer- 2) Multi-qubit quantum systems: multi-qubit quantum states,
ing Master-level education in QISE[2][3] show that quantum entanglement, multi-qubit gates, measurements of multi-
programming is often incorporated in them as an independent qubit systems (including partial measurements).
course or as a component within an introductory course. 3) Simple communication algorithms: BB84 quantum key
In this report I describe my experience teaching a graduate distribution algorithm, teleportation, superdense coding.
course “CSYE6305: Introduction to Quantum Computing with 4) Quantum phase oracles and simple oracular algorithms:
Applications” at Northeastern University during the fall and Deutsch, Deutsch-Josza, and Bernstein-Vazirani.
spring semesters of the academic year 2022–23. I outline 5) Reversible computing: reversible Boolean logic, re-
the guiding principles behind the course design, describe the versible circuit synthesis, implementing marking oracles.
programming assignments created for the course, and discuss 6) Grover’s search algorithm and using it to solve problems.
the lessons learned. 7) Quantum software stack.
I hope that this work will inspire more instructors to adopt 8) Building up to Shor’s algorithm: Fourier transform, phase
a similar software-driven approach to delivering quantum estimation, Shor’s algorithm for integer factorization.
computing courses and enable a broader student audience to 9) Quantum error correction and fault-tolerant quantum
learn quantum programming. computing.
10) The current landscape of quantum hardware development
II. C URRICULUM AND COURSE STRUCTURE and the quantum community.
The course targets engineering graduate students who do not Each of the lecture modules included a 3-hour lecture that
specialize in quantum information science and do not necessar- introduced the relevant concepts, explained quantum algo-
ily have an extensive background in physics, mathematics, or rithms, and covered the software tools necessary for complet-
theoretical computer science. The students’ background means ing the module’s assignments. The supplementary materials
that traditional approaches to teaching quantum computing, for the modules included recommended and optional reading
Fig. 2. Debugging task that shows the output of the BB84 protocol with
a logical error (incorrect gate used to change the basis of the qubit on the Fig. 3. Circuit optimization task that asks the student to rewrite the circuit
sender side) to minimize the resources required to run it. The control bit sequences of the
gates spell the alphabet positions of letters QUANTM (the top wire is the
least significant bit of the letter number).
3) Test the solution, i.e., write the unit tests to check that the hand, it increases the complexity of state preparation and
quantum oracle implemented in the solution is correct. reflection about the mean. The resources required for
4) Compare simulation speeds of the full state simulator and different implementations can be evaluated and compared
the sparse simulator available in the QDK when used to using Azure Quantum Resource Estimator service.
solve the same instances of the problem. 6) Run the solution for a small problem instance on one of
5) Compare different solution approaches and the resources the Azure Quantum hardware targets, and compare the
they require. For example, consider the problem of color- results with the results produced by noiseless simulation.
ing the vertices of an N -vertex graph using three colors 7) Use quantum counting to estimate the number of problem
so that each pair of vertices connected by an edge is solutions. Outside of this task, the students could use a
colored in different colors. One approach is to define the classical estimation of the number of solutions to get the
search space of all bit strings of length 2N that represent optimal number of iterations to be used, or implement
coloring N vertices with colors 00, 01, 10, and 11, and their solution without knowing the number of solutions.
use an oracle that checks both that the pairs of connected 8) Explore automatic code generation for the same problem
vertices have distinct colors and that none of the vertices with Classiq platform5 . The platform offered examples of
are colored 11. Another approach limits the search space code generation for Grover’s search algorithm that could
to only bit strings that represent coloring N vertices with be modified to implement the students’ projects.
colors 00, 01, and 10 by changing the state preparation 9) Present the results during the last lecture of the course.
and reflection about the mean parts of the algorithm, and This encouraged students to practice their public speaking
uses an oracle that only checks that the pairs of connected skills, get early feedback on their work, and learn more
vertices have distinct colors. about the topics covered from other students’ work.
Different approaches to problem solutions can have vary-
The complete solution to the problem and the final presen-
ing resource requirements. In the described example,
tation were required for all final projects. The rest of the tasks
the second approach reduces both the number of qubits
were optional, and each students could select a subset of the
required for the oracle implementation and the size of
tasks they wanted to focus on.
the search space compared to the first one, thus reducing
the number of Grover iterations used. On the other
5 https://platform.classiq.io/
The breakdown of the project into specific tasks enabled the optimal iteration number would yield higher success
standardized grading across the different approaches the stu- probability due to smaller circuit depth.
dents could’ve taken to solve and implement their problem of Offer multiple choices of the hardware provider. Across
choice, since the variation of approaches within each task was the two sessions of the course, several assignments were
significantly smaller than that within the whole projects. negatively impacted by temporary unavailability of one
of the providers’ hardware targets. Enabling running
VIII. L ESSONS LEARNED AND FUTURE WORK
each assignment on multiple hardware backends and
Based on my observations teaching the course during the allowing the students to choose the backend to use
academic year 2022–23, the performance of 10 students who would mitigate the impact of such issues.
enrolled in one of the sessions during this period, and the Finally, the artifacts created for these courses can be ac-
student feedback collected after the course I believe that the cessed by quantum computing educators worldwide to inspire
described software-oriented approach is an effective way to them to adopt a similar teaching approach6 .
introduce students with software development and engineering
backgrounds to quantum computing. IX. ACKNOWLEDGEMENTS
The students enjoyed the hands-on assignments and sin- I thank Kal Bugrara who invited me to teach the course
gled out the Quantum Katas as the part of the course that “CSYE6305: Introduction to Quantum Computing with Ap-
contributed the most to their learning. Sharing the testing plications” at Northeastern University, and the College of En-
harnesses for the automatically graded programming assign- gineering at Northeastern University for enabling this course.
ments with the students led to higher success levels on these I am also grateful to my students for their valuable feedback.
assignments compared to the earlier course session (academic
year 2019–20), in which the students had to come up with R EFERENCES
ways to validate their solutions themselves. [1] C. Hughes, D. Finke, D.-A. German, C. Merzbacher, P. M. Vora, and
On the other hand, several students struggled with the tran- H. J. Lewandowski, “Assessing the needs of the quantum industry,”
2021. [Online]. Available: https://arxiv.org/abs/2109.03601
sition from the small guided assignments to the large project [2] C. D. Aiello, D. D. Awschalom, H. Bernien, T. Brower, K. R. Brown,
focused on self-driven problem solving and exploration. Of T. A. Brun, J. R. Caram, E. Chitambar, R. D. Felice, K. M. Edmonds,
the 10 students enrolled, 2 failed the course, and one passed M. F. J. Fox, S. Haas, A. W. Holleitner, E. R. Hudson, J. H. Hunt,
R. Joynt, S. Koziol, M. Larsen, H. J. Lewandowski, D. T. McClure,
it on the second attempt. The students who received failing J. Palsberg, G. Passante, K. L. Pudenz, C. J. K. Richardson, J. L.
grades did not engage with the learning materials, including Rosenberg, R. S. Ross, M. Saffman, M. Singh, D. W. Steuerman,
the weekly assignments, beyond the first weeks of the course. C. Stark, J. Thijssen, A. N. Vamivakas, J. D. Whitfield, and B. M.
Zwickl, “Achieving a quantum smart workforce,” Quantum Science and
Multiple students expressed special appreciation for the Technology, vol. 6, no. 3, p. 030501, jun 2021. [Online]. Available:
horizon-broadening nature of the course, and claimed that this https://doi.org/10.1088/2058-9565/abfa64
course was among the best ones they have taken as part of [3] T. Plunkett, T. L. Frantz, H. Khatri, P. Rajendran, and S. Midha, “A
survey of educational efforts to accelerate a growing quantum workforce,”
their coursework. One of the students even mentioned that in 2020 IEEE International Conference on Quantum Computing and
they were interested in pursing quantum computing in their Engineering (QCE), 2020, pp. 330–336.
further graduate studies. [4] M. Mykhailova and K. M. Svore, Teaching Quantum Computing through
a Practical Software-Driven Approach: Experience Report. New York,
In the future offerings of this course, the homework assign- NY, USA: Association for Computing Machinery, 2020, p. 1019–1025.
ments would benefit from the following improvements. [Online]. Available: https://doi.org/10.1145/3328778.3366952
[5] Quantum Katas: programming exercises for learn-
Offer more advanced debugging assignments. Pure Q# ing Q# and quantum computing. [Online]. Available:
syntax errors turned out to be very easy to identify and https://github.com/microsoft/QuantumKatas/
fix. At the same time, weekly assignments did not offer [6] K. Svore, A. Geller, M. Troyer, J. Azariah, C. Granade, B. Heim,
V. Kliuchnikov, M. Mykhailova, A. Paz, and M. Roetteler, “Q#: Enabling
students enough practice identifying and eliminating scalable quantum computing and development with a high-level DSL,”
more sophisticated issues, such as the program containing in Proceedings of the Real World Domain Specific Languages Workshop
elements that are not supported on certain hardware 2018, ser. RWDSL2018. New York, NY, USA: ACM, 2018, pp. 7:1–
7:10. [Online]. Available: http://doi.acm.org/10.1145/3183895.3183901
providers in Azure Quantum, that surfaced during their [7] M. Mykhailova and M. Soeken, “Testing quantum programs using Q#
work on their final projects. and Microsoft Quantum Development Kit,” in Quantum Software and
Diversify hardware exploration assignments. The most ef- Engineering Workshop, 2021. [Online]. Available: http://ceur-ws.org/Vol-
3008/short6.pdf
fective hardware exploration assignments were the ones [8] M. E. Beverland, P. Murali, M. Troyer, K. M. Svore, T. Hoefler,
that went beyond the mere observation of the existence V. Kliuchnikov, G. H. Low, M. Soeken, A. Sundaram, and A. Vaschillo,
of the noise, to exploring the impact of the noise on “Assessing requirements to scale to practical quantum advantage,” 2022.
the feasibility of running end-to-end algorithms on the
near-term quantum devices. It would be interesting, for
example, to combine hardware exploration with circuit
optimization, asking the students to optimize the given
circuit to the point where the results of running it on quan-
tum hardware are noticeably more accurate, or to explore
whether running Grover’s search for fewer iterations than 6 https://github.com/microsoft/quantum-curriculum-preview