Tuesday, January 31, 2023

More on subspace states

Last year I wrote a post about subspace states, which are a way of efficiently encoding classical data (in the form of d-dimensional subspaces of an n-dimensional vector space) into quantum states using shallow (d log n depth) quantum circuits, by loading one n-dimensional data vector at a time (in log n depth), repeating d times.

After reading the paper, we became interested in whether similar states might be useful for applications beyond quantum machine learning / quantum linear algebra. Luckily for us, the answer is yes!

We have shown that subspace states can also be used to efficiently generate ansatz states for quantum chemistry calculations on quantum processors, in a preprint uploaded to arXiv a few weeks ago.

The idea is to view each data vector as describing the atomic orbitals occupied by an electron, with the total electronic wavefunction built up by adding one electron at a time. For this analogy to work, however, the parity of the electron wavefunction (anti-symmetry under exchange of orbitals) also needs to be encoded; this gives an additional log n overhead compared to encoding classical data. Once parity is taken into account, we can encode any Slater determinant state (i.e. an uncorrelated electronic wavefunction) in a two-qubit gate depth of O(d log^2 n).

Since Slater determinants are easy to classically simulate, a natural question is whether the approach can be adapted to generate more interesting states exhibiting electronic correlation effects (which are what make the electronic structure problem hard to solve). Chee found a way to do this - instead of loading one vector (electron) at a time, pairwise correlations between electrons can be introduced by loading them two at a time. With pairwise correlations, one can generate ansatz states with energies lower than those obtained from the simplest Hartree-Fock approximation, corresponding to a better approximation to the true ground state of the system of interest. The method can also generalize to higher-order correlations.

Some caveats and limitations of our method which didn't make it into the specialist-oriented preprint:

  • Gate depth and gate count are two distinct quantities affecting circuit performance; our method has a (poly)-logarithmic two-qubit gate depth, but the number of gates is still linear in the system size n (this is the minimum required to encode all the orbital coefficients). Gate depth matters if the quantum processor has slow two-qubit gates, meaning that only a limited number of gates can be applied in series before the qubits decohere. On the other hand, for fast gates with a lower fidelity, the size of the computation will be limited by the total gate count (too many and an error somewhere is certain). The logarithmic depth arises from using a binary tree to encode the state, meaning that long-range two-qubit gates are required. Altogether, this means that the circuits are best implemented on ion trap systems, which support (slow) long range, high fidelity two-qubit gates.
  • Advertisements of algorithmic speedups are typically given in terms of better asymptotic scaling. For practical applications, however, an important question is where the actual cross-over will occur, which depends on constant overhead factors present in the implementation. The proposed circuits will be shallower than existing linear depth beam-splitter mesh circuits for system sizes on the order of hundreds of qubits. This means our approach isn't better to run on currently-available cloud quantum processors - we'll need to wait until larger devices come online.
  • It's unclear how well our method will perform on near-term devices without quantum error correction. Quantum error mitigation will be needed to get useful results out of any experiment. Since we're not experts in error mitigation we're hoping this functionality will be built-in to future cloud quantum processors.

Tuesday, January 17, 2023

Tips for choosing an undergraduate research project

The start of any new semester is accompanied by undergrads enrolled in degrees with a research component scrambling to find professors willing to supervise mini-projects. The (lack of) success in a project often boils down to factors outside the student’s control, such as a crucial piece of equipment breaking and being unusable for months. Nevertheless, there are some strategies you can use improve the chances that your hard work will lead to a coveted journal article:

Ask early

Potential supervisors might need time to brainstorm possible undergrad-friendly project ideas. Or if they’re popular and receive many requests, they might only offer a spot to the first person who asks. Maybe after meeting the supervisor and hearing further details on the project you decide it’s not a good fit and need to find someone else. The earlier you start looking, the more possibilities you will have.

Find someone new

Contacting a professor you have never met can be intimidating, so it’s tempting to ask lecturers of current or previous courses to supervise a project. This is also a common strategy for students who didn’t think about organising a project until the first week of the semester. Sadly, this is sub-optimal for a few reasons:

  • Professors with teaching duties usually have less time for supervision.
  • You are probably following in the footsteps of many undergraduates before you who worked on the same topic and already plucked the low-hanging fruit.
  • One of the biggest benefits of undergrad projects is expanding your network and trying something new without much risk – even if your project does not achieve the original goals, if you put in regular effort you will rarely get a poor grade. By sticking with familiar topics and supervisors, you’re less likely to stumble upon something you didn’t know you excelled at.

Check the supervisor’s history

If the professor leads a group, ask the existing team members and alumni about their experience. Is it a supportive research environment? Does the professor respect the team members? How regularly does the team publish? Is the professor responsive and taking an active role in day-to-day problems, or are students left to fend for themselves? These questions are best asked in-person, not over email, and are equally valid for prospective PhD students and postdocs. For undergraduate projects it is also useful to ask the team members about their future career plans, whether they think the research field is fertile or in decline, and what transferable skills they have picked up.

Project scope

You need to identify a niche where your unique experiences will be useful to the project. Typically for undergraduate projects, you will lack high-level background knowledge (covered in later year courses), so it is better to focus on skills you either have or are keen on learning. It is rare to find a project where programming skills will not be useful, even if just for validating an analytical result or processing experimental data obtained by someone else. Projects aimed at supporting an ongoing study in this manner are more likely to lead to a publication, although not as the lead author. Your best bet for a first author publication is some new but speculative idea that the professor feels is too speculative to risk on a graduate student or postdoc.

For example, my first project entitled “New constraints on the Earth’s inner core anisotropy from Antarctic seismic stations” exceeded my wildest expectations and (eventually) resulted in my first journal publication. In hindsight I think this project was risky – it involved using a unique but quite noisy seismic dataset to study the Earth’s inner core. I did not need to program everything from scratch – the “meat” of the project involved writing a shell script to analyze data using existing seismic analysis programs. Most importantly, I was lucky to have a highly responsive and patient supervisor who put up with all my naive questions and was willing to put in the substantial extra effort to help me improve the project writeup into a journal-quality manuscript.

Thursday, January 12, 2023

AI and physics education

New technologies bring new opportunities for physics education. ANU Physics has for several years been looking at incorporating virtual reality (VR) into their courses, particularly for first year physics. Two examples:

"Dissonance-VR targets misconceptions around forces, by quizing students about forces acting on a basketball, and then presenting them with the physical world that manifests their answer. Any misconception they have results in an unphysical world that feels wrong. A narrator guides them to correct their choice and their misconception."

"Field-VR is an electric and magnetic field sandbox that allows students to visualise electric and magnetic fields and be immersed in them. They can build complex fields using standard electric and magnetic sources, as well as test charged particle trajectories. The hope is that this visual tool will aid students in learning EM, particularly those who find spatial problems challenging. This software has recently been upgraded to allow for multiple users - i.e. collaborative VR tutorials."

How can emerging AI tools such for text generation (e.g. ChatGPT) and image analysis/generation (e.g. StableDiffusion) be useful for education? 

From what I've seen in the news and social media, the academic perspective on these tools has so far been largely negative, focusing on how they may be used for cheating, making take-home assignments obsolete. Even if methods for detecting AI-generated text are improved and made widely available, the student who modifies an AI-generated first draft will probably have an advantage. 

Rather than making futile attempts to stamp out these new tools, we should be thinking about how they will change our workflows in physics (and other fields) and how courses should be updated to incorporate them.

Already there are businesses springing up selling AI content generators for blogs, marketing materials, coursework, etc. It won't be long before text-to-text models will be used by working scientists for tedious tasks such as drafting article introductions, literature reviews, and maybe even PhD theses, most likely using a general purpose model augmented with text harvested from the articles your work cites. This will give us more time to do actual science, provided we remain mindful of the biases and limitations of AI models. We will need to train students on how to prompt these models to obtain a useful first draft and to identify and correct physics errors in the generated text. This is not unlike the role of professors today, who will assign a research topic and get the student started by providing a list of references to read and eventually (nominally) make improvements to the first draft written by the student.

Lab courses will also be transformed by the availability of fast AI computer vision tools for object detection, image segmentation, and so on. I remember my first year physics labs frequently involved mucking around with stopwatches to make (inaccurate) measurements of stuff such as the local gravitational acceleration. These kinds of experiments can be made enormously easier and more precise by recording a video using a smartphone camera and post-processing to extract the needed observables. This will change the required skills and dominant sources of error.

Apart from changes to the techniques, we will also be able to conduct experiments at a much larger scale, e.g. involving hundreds or thousands of objects that can be individually tracked using computer vision libraries. An infamous thermodynamics lab experiment at ANU involved testing the ergodic hypothesis by observing the motion of several battery-powered cat balls on a partitioned table (explained here) and periodically counting the number of "atoms" (balls) in each partition. This was not only tedious, but randomly-failing batteries often led to experimental results apparently violating the laws of statistical mechanics. With computer vision you can get the full time series of the position data and not only compute the required observables for much larger system sizes, but also identify and exclude balls as soon as their batteries fail.

What do you think? Is this the future? Or have these techniques already been implemented by lab demonstrators and I'm just showing my age?

Monday, January 9, 2023

Workshop on Topological Data Analysis: Mathematics, Physics and beyond

Next month I'll be speaking at a workshop on topological data analysis (TDA) organized by the Korean Institute for Advanced Study, to be held on February 8-10 in Seoul. I'm quite excited because this will be my first chance to attend an in-person meeting dedicated to this topic! From the workshop website

"This workshop aims to share our knowledge about topological data analysis from the viewpoint of mathematics and physics. We are trying to make this event in-person with a relaxed schedule, so that we can discuss each other more freely. We hope this event help us widen our perspectives on mathematical and physical backgrounds about data analysis."

In other TDA news, there is an article on TDA published in the January issue of Physics Today which gives an overview of applications to condensed matter and soft matter physics using the "shape" of Jigglypuff as a pedagogical example!