Home Teaching
PHY605 Announcement/Update
AcademicCalendar
PHY 605 Quantum Programming
(Spring 2025) Days/Time: MW 09:30-10:50AM; Location: HUMANITIES 2094
3 credits, Letter graded (A, A-, B+, etc.)
This course will meet twice a week for 80 minutes per meeting.
Instructor: Tzu-Chieh Wei <tzu-chieh.wei[at]stonybrook[dot]edu>
Office hours: by appointment
TA: TBA <[at]stonybrook[dot]edu>
Course description :
The
field of quantum information and computation has evolved to a stage
where there are quantum devices that can be programmed and various
tasks and algorithms can be tested on these devices. This course
introduces various quantum programming frameworks. It aims to provide a
more practical approach of learning quantum computing by programming,
via softwares developed using Python. Important basic quantum
algorithms will be reviewed and learned by programming them and
simulating their action. Moreover, an emphasis will be paid to the
so-called Variational Quantum Eigensolver that has already been used on
many problems, from molecular energies and optimization to financial
applications and quantum machine learning. Some illustration of quantum
programming will be done on IBM's transmon-type cloud quantum
computers. Beyond the circuit-based quantum computers, programming
quantum annealers will provide an alternative approach to solve a wide
family of optimization problems.
Prerequisite:
PHY 568 Quantum Information Science (or other related courses, such as
CSE 550 Quantum Computing and Applications) or permission by the
instructor
This course is part of the curriculum in our Master's Program in Quantum Information Science and Technology (also here); see alo other courses PHY631 Quantum Information Physical Systems and Materials offered concurrently this semester.
For
undergraduates: This course may be taken by upper-level undergraduates, who still need to complete the prerequsite. It needs the
permission and the signature of the instructor in order to register for
this course; permission form can be downloaded here.
Course objectives/Student learning outcomes:
Students who have completed this course
•
will be able to explain quantum computation of the standard circuit
approach and analyze how basic quantum algorithms work
• will be able to write Python codes to program these quantum algorithms and design ones based on existing algorithms
•
will be able to apply various quantum algorithms for applications, such
as optimization problems and scientific problems
Textbooks and resources:
There is no required textbook. But there are recommended textbooks :
Quantum Computation and Quantum Information, M. Nielsen and I. Chuang (Cambridge University Press)
Learn Quantum Computation using Qiskit (free digital textbook) [update: which is not longer maintained by IBM, now at Github]
IBM Quantum Learning (website with various resources)
IBM Quantum Documentation
Further bibliographic resources will be provided as the course progresses.
Python programming: there are many courses, books, tutorials, videos, code examples; see the list in BeginnersGuide/Programmers - Python Wiki.
Only basic understanding and programming experience of Python is needed
in the beginning. We learn by reading and modifying other people's
codes. It is also useful to know how to use iPython/Jupyter notebooks. If you really need to a book, I recommend a compact book "Python (2nd Edition): Learn Python in One Day and Learn It Well," by Jamie Chan, available on Amazon at a very reasonable price (e.g. Kindle version is $3.99). There is also a companion workbook: "Python Workbook: Learn Python in one day and Learn It Well." (Kindle version is $1.99.)
Another recommended free on-lne book is Python Programming and Numerical Methods - A Guide for Engineers and Scientists
Tutorials at: Python Tutorial
Assessment and Grading:
Grades: (tentative) Course grades on a 100 point scale are: A (93-100);
A- (90-92); B+ (87-89); B (83-86); B- (80-82); C+ (77-79); C (73-76);
C- (70-72); F (69 or lower)
Note that the following grading system
will be used for graduate students: A (4.0), A- (3.67), B+ (3.33), B
(3.00), B- (2.67), C+ (2.33), C (2.00), C-(1.67), F (0.00).
Graded/Pass/No Credit (G/P/NC) and grades of D are not approved grades
for graduate students.
Homework 50% (need to submit the solutions in Brightspace), In-class presentation or midterm exam 20%, Final project 30%
The
homework grading is
based on the level of correctness and clarity of logical steps
demonstrated in students’ solutions or whether the codes can be run successfully. Final project grading is based on
the content, key concepts, organization, coding, analysis of results,
and documentation.
Topics to be covered and tentative syllabus
(This
is a tentative syllabus. Exam dates and homework due dates may change.
The choice of topics may not exactly follow this tentative syllabus.)
(week
1) Overview of this course and review of linear algebra, basics
of quantum mechanics, quantum bits and quantum gates; overview of
Python and the use of Jupyter Notebook
(week 2) More quantum
gates and circuit model of quantum computation; quantum teleportation, quantum algorithms
including Deutsch, Deutsch-Josza, Simons, Vazirani-Berstein. IBM Quantum Composer.
(week 3) IBM Qiskit framework and programming algorithms of week 2
(week
4) Grover's quantum search algorithm and its programming and The
variational quantum eigensolver (VQE) and its programming.
(week 5)
Machine learning and Quantum Machine Learning; introducing PyTorch and
PennyLane for programming quantum machine learning
(week 6) Quantum
Fourier Transform, quantum phase estimation, Shor’s factoring algorithm
and quantum linear system (such as the HHL algorithm), and their
programming
(week 7) Advanced topic: quantum computing for molecular energies in Quantum Chemistry
(week
8) Overview of other software frameworks, such as D-Wave’s quantum
annealers and programming on D-Wave's SDK Ocean and/or Amazon Braket
(week 9) Qutip: simulating quantum dynamics and the master's equation. Cavity and atoms.
(week 10) Qutip: case studies
(week 11) Quantum communication: Quantum key distribution, Ekert's protocol, quantum teleportation, entanglement swapping
(week 12) Overview on NetSquid and/or SeQUeNce for simulating quantum internet
(week 13) Establishing long range entanglement; realistic case study
(week 14) (Student project presentation)
(week 15) (Student project presentation)
There
was a big jump of IBM's Qiskit from version 0.46 to version 1.x in
2024. The current version as of mid Jan 2025 is v1.3. Many earlier
codes (including last year's) need to be modified to suit Qiskit v1.3.
Still basic features such as circuits and gates remain largely stable.
There has also been advocates from IBM on the "utility era", where they
encourage running circuits and tasks that involve a large number of
qubits, e.g., over 100, and they retired all small machines. Existing
devices all have num_qubits > 100. This year we will mostly focus on
Qiskit and we will also use PennyLane.
Students will need to
install Python and Qiskit on their own laptops (unfortuantely, IBM
retired their web-based Quantum Lab in May 2024). We will go over
installation and students should bring their laptops to class and we
will have time in class to play with Jupyter notebooks.
[update/actual progress]
(week
1) [1/27,1/29] 1/27: We gave an overview of this course; students
intalled Python and Qiskit. We ran an example Overview notebook for
writing qiskit codes. [see IBM researcher Derek Wang's videos on (1) introduction to qiskit/coding, (2) installing qiskit and (3) hello world (documentation link)]
1/29:
We gave an overview of Python Programming (we learned basics of Python)
and reviewed the Deutsch algorithm (for the latter, please refer back
to PHY568 QIS), and used IBM Quantum Composer to implement some of the four possible instances.
next: we will explain the notebook for the Deutsch algorithm, and review gates and circuits (with notebooks).
(week
2) [2/3, 2/5] 2/3: We first went over the Deutsch algorithm notebook,
then we went over tutorials on gates, circuits and visualization tools
in qiskit. 2/7: We went into the Documentation on Qiskit Circuit
Library, discussed general multi-qubit control gate decomposition (to
elementary one- and two-qubit gates), returned to implementing two
other basic quantum algorithms: Bernstein-Varzirani and Simon's.
next: we plan to review Grover's search algorithm and illustrate its Qiskit implementation; then we will move on to VQE.
(week
3) [2/10, 2/12] 2/10: We discussed in detail the implementation of
Simon's algorithm, and reviewed Grover's algorithm and went over its
Qiskit implementation. 2/12: We discussed the framework of VQE and went
over two notebooks on implementation. (We used qiskit_algorithm package
in one notebook and the Session method in the other.)
(week 4) [2/17, 2/19] 2/17: We discussed Operator in Qiskit and then circuit transpilation.
(week 5) [2/24, 2/26]
(week 6) [3/3, 3/5]
(week 7) [3/10, 3/12]
(week spring recess) [3/17, 3/19] Spring Recess: No classes
(week 8) [3/24, 3/26]
(week 9) [3/31, 4/2]
(week 10) [4/7, 4/9]
(week 11) [4/14, 4/16]
(week 12) [4/21, 4/23]
(week 13) [4/28, 4/30]
(week 14) [5/5, 5/7]
(final exam period)
Academic Integrity Statement
Each
student must pursue his or her academic goals honestly and be
personally accountable for all submitted work. Representing another
person's work as your own is always wrong. Faculty is required to
report any suspected instances of academic dishonesty to the Academic
Judiciary. Faculty in the Health Sciences Center (School of Health
Technology & Management, Nursing, Social Welfare, Dental Medicine)
and School of Medicine are required to follow their school-specific
procedures. For more comprehensive information on academic integrity,
including categories of academic dishonesty please refer to the
academic judiciary website at
http://www.stonybrook.edu/commcms/academic_integrity/index.html
Critical Incident Management
Stony
Brook University expects students to respect the rights, privileges,
and property of other people. Faculty are required to report to the
Office of University Community Standards any disruptive behavior that
interrupts their ability to teach, compromises the safety of the
learning environment, or inhibits students' ability to learn. Faculty
in the HSC Schools and the School of Medicine are required to follow
their school-specific procedures. Further information about most
academic matters can be found in the Undergraduate Bulletin, the
Undergraduate Class Schedule, and the Faculty-Employee Handbook.