<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Musty Thoughts</title>
		<description>Personal blog of Michał Stęchły about quantum computing and more.</description>
		<link>https://github.com/zxixia/jekyll-xixia</link>
		<atom:link href="https://github.com/zxixia/jekyll-xixia/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>Quantum Software Newsletter</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;Today, together with my friend Konrad, we’re launching a newsletter about developing quantum software. In this post I want to tell you a bit more about this project. If you don’t want to learn more and just want to subscribe, click &lt;a href=&quot;https://www.qse-newsletter.com&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;context&quot;&gt;Context&lt;/h1&gt;

&lt;p&gt;First, let me tell you about Konrad.&lt;/p&gt;

&lt;p&gt;Konrad is a friend of mine – we’ve been working together since my first quantum job at Bohr in 2018, then Zapata and now at PsiQuantum. So we’ve been working together for ~7 years, with some brief breaks. He’s an absolute beast, I haven’t met anyone&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; in my career who came close to the level of proficiency in programming, especially in Python. I have learned soooo much from him over the years and always enjoyed our collaboration.&lt;/p&gt;

&lt;p&gt;At some point we decided that it would be nice to share some of the experience we have with other people in the community. It seemed to us that newsletter will be a good form for that:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A lot of the things we want to write about are relatively short tips, so newsletter’s short form seems appropriate.&lt;/li&gt;
  &lt;li&gt;We’ve been subscribed to some educational newsletter in the past and it’s a decent format for learning&lt;/li&gt;
  &lt;li&gt;It’s the kind of public committment that will probably force us to do it regularly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So after waaaay too long period of “We’re busy now, let’s start working on it next week”, we’re finally launching it!&lt;/p&gt;

&lt;h1 id=&quot;who-is-this-for&quot;&gt;Who is this for?&lt;/h1&gt;

&lt;p&gt;We want this newsletter to be useful for anyone working with software in the quantum computing space. We’re thinking about two main groups:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Researchers – they often have no real training in software engineering, but work with software every day. From our observations, they often require just a little nudge here and there to make their life much easier.&lt;/li&gt;
  &lt;li&gt;Software Engineers – people who are in the same boat as we are! We all work on different projects, but the problems are often very similar, so we hope our perspective might shed some new light at them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, software is software. There’s not that many problems that are specific to quantum computing, so it will be most likely widely applicable to anyone working with scientific software in general.&lt;/p&gt;

&lt;h1 id=&quot;what-to-expect&quot;&gt;What to expect?&lt;/h1&gt;

&lt;p&gt;We will be sending you one e-mail per week. Some of the topics that we have already written up or plan to do so are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Testing complex algorithms&lt;/li&gt;
  &lt;li&gt;Pros and cons of using jupyter notebooks&lt;/li&gt;
  &lt;li&gt;Basic debugging techniques&lt;/li&gt;
  &lt;li&gt;Profiling code&lt;/li&gt;
  &lt;li&gt;Managing virtual environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But we’ll also share some new tools that we just discovered or write about some ad-hoc cases that we have encountered in our daily work.&lt;/p&gt;

&lt;h1 id=&quot;whats-next&quot;&gt;What’s next?&lt;/h1&gt;

&lt;p&gt;You can find a landing page &amp;amp; subscription form &lt;a href=&quot;https://www.qse-newsletter.com&quot;&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Also, at &lt;a href=&quot;https://qce.quantum.ieee.org/2025/&quot;&gt;IEEE Quantum Week conference&lt;/a&gt; we’ll be hosting a tutorial called “10 things ruining code in your research project – do this instead!”, it’ll be on Tuesday, September 2nd. If the premise of the newsletter looks interesting to you, I’m sure this tutorial will also be!&lt;/p&gt;

&lt;p&gt;Have a great day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
Footnotes:&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Except our friend Alex, who’s also S-tier. Hi Alex! &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;
</description>
				<pubDate>Thu, 12 Jun 2025 04:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/newsletter.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/newsletter.html</guid>
			</item>
		
			<item>
				<title>IEEE Quantum Week 2024</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;I’m writing this while sitting on the train from Montreal to Toronto. Why did I visit Montreal?&lt;/p&gt;

&lt;p&gt;To attend IEEE Quantum Week 2024, also known as QCE24!&lt;/p&gt;

&lt;p&gt;This was my 3rd Quantum Week and I was looking forward to it! It’s a big conference (~1500 participants) with up to 14 tracks happening simultaneously. So obviously I couldn’t keep track of everything that was going on and my perspective is biased, but I hope this will be useful for some people nonetheless. So here are some of my main takeaways from the conference.&lt;/p&gt;

&lt;h2 id=&quot;need-for-better-abstraction-hierarchy&quot;&gt;Need for better abstraction hierarchy&lt;/h2&gt;

&lt;p&gt;Given that we’ve recently published &lt;a href=&quot;https://arxiv.org/abs/2405.13918&quot;&gt;a paper about abstraction hierarchy&lt;/a&gt; that I was presenting at the conference, I’ve been vigilant about the topic. However, the need for better abstraction layers and separation of concerns in quantum software was a common theme in many sessions I attended:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Quantum Algorithm Design Automation Workshops&lt;/li&gt;
  &lt;li&gt;Keynote by Jay Gambetta&lt;/li&gt;
  &lt;li&gt;Workshop on Intermediate Representations&lt;/li&gt;
  &lt;li&gt;Munich QS Software Stack Workshop&lt;/li&gt;
  &lt;li&gt;Keynote by Margaret Martonosi&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ll write more about our paper and this problem in general in a separate blogpost, so here I’m just mentioning it as it’s clearly becoming an important topic in the community.&lt;/p&gt;

&lt;h2 id=&quot;standardization&quot;&gt;Standardization&lt;/h2&gt;

&lt;p&gt;Another important topic that was coming up over and over in many sessions and discussions was standardization. This allowed me to learn more about it and refine my view.&lt;/p&gt;

&lt;p&gt;There are basically two positions in the community, which seem to be at odds with each other.&lt;/p&gt;

&lt;p&gt;Some people say that it’s too early to standardize. We are still experimenting with many different conventions, abstractions, formats and in general ways to write software for quantum computers. The hardware landscape also changes very quickly. If we try to standardize too early, we’ll stifle the progress and we increase the risk of some nasty technology lock-in.&lt;/p&gt;

&lt;p&gt;On the other hand, other people say that it’s really hard to collaborate and make progress. Everyone’s software is special in its own way, people are using competing conventions. Even if someone else solved your problem, then they most likely use a different format and different toolset and it might be faster to reproduce their code rather than to integrate with it.&lt;/p&gt;

&lt;p&gt;However, after talking with various people it turns out that these two positions can be reconciled. You see, the problem is the word “standard”. When most people hear “standard”, they think “IEEE-level standard, that will take a whole committee and a thousand meetings over 3 years to come up with”. That’s also what I was thinking, but I changed my perspective after I talked with someone from NIST (which is an organization that surely treats standards seriously). She said that “standards” are basically just “agreements” and it’s all about people reaching a consensus rather than necessarily going through a formal committee. Sure, the formal standards also have their place, but in some cases, they’re an overkill.&lt;/p&gt;

&lt;p&gt;So if instead of saying “We need standardization” we would start saying “As a community we need to agree on certain things, such as conventions and dataformats”, then I think this is a very different discussion, where we could get many more people on board. I like to use the word “community standard” for such agreements to indicate their informal character.&lt;/p&gt;

&lt;p&gt;I’ve been working on such a “community standard” for the format to write fault-tolerant quantum algorithms for resource estimation. If this is something of interest to you, please reach out to me at &lt;a href=&quot;mailto:mstechly@psiquantum.com&quot;&gt;mstechly@psiquantum.com&lt;/a&gt;!&lt;/p&gt;

&lt;h2 id=&quot;darpa-qb-program&quot;&gt;Darpa QB program&lt;/h2&gt;

&lt;p&gt;In the past, I was involved in DARPA’s Quantum Benchmarking program. For those who don’t know about it, the goal of the program is to do a rigorous search for promising applications of fault-tolerant quantum computers and estimate the resources needed to run them when we finally have these machines. I see this program as pivotal for accelerating the progress in the field as well as guiding policymakers. For me personally, participation in this program has been one of the greatest professional experiences I had.&lt;/p&gt;

&lt;p&gt;Therefore, it was a pleasure to see either the program itself (or the research coming out of it) mentioned several times across the conference! 
For those of you who’re not familiar with it, you can find more information, including the papers and tools that are output of the program &lt;a href=&quot;https://www.darpa.mil/work-with-us/publications-highlighting-potential-impact-of-quantum-computing-in-specific-applications&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;qre-workshops&quot;&gt;QRE workshops&lt;/h2&gt;

&lt;p&gt;One of the events I’ve organized was a workshop focused on Quantum Resource Estimation. I won’t write a detailed summary similarly &lt;a href=&quot;/qre-workshops.html&quot; target=&quot;_blank&quot;&gt;as I did last year&lt;/a&gt;, so here’s a quick recap.&lt;/p&gt;

&lt;p&gt;We had three sessions.&lt;/p&gt;

&lt;p&gt;In the “Tools and Methods” session Mariia Mykhailova from Microsoft gave an overview of Azure Quantum Resource Estimator. It was cool to see how this tool became more extensible in the last year. In particular, Mariia showed an example of doing resource estimation for the hardware by Alice &amp;amp; Bob.&lt;/p&gt;

&lt;p&gt;Then Arianna Van de Griend presented work by Alexandru Paler and Ioanna Moflic (who unfortunately couldn’t join) about the compilation of really large circuits. Representing circuits as tables in the PostgreSQL database? Wow, this was something new for me!&lt;/p&gt;

&lt;p&gt;Lastly, Murphy Niu from UC Santa Barbara presented her work with Daniel Bochen Tan and Craig Gidney on the compilation of lattice surgery operations (e.g. those described in &lt;a href=&quot;https://arxiv.org/abs/1808.02892&quot;&gt;Game of Surface Codes&lt;/a&gt;). They took those operations, translated them into the “crazy pipeline diagrams from Craig Gidney’s papers” and then optimized them. Impressive!&lt;/p&gt;

&lt;p&gt;Then we had an “Applications and Algorithms” session, where we had:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Sophia Simon (University of Toronto): “Superpolynomial improvement in precision for quantum simulations of coupled quantum-classical dynamics”&lt;/li&gt;
  &lt;li&gt;Fionn Malone (Google): “Resource estimation for the quantum computation of stopping power”&lt;/li&gt;
  &lt;li&gt;Amara Katabarwa (Zapata): “Feasibility of accelerating incompressible computational fluid dynamics simulations with fault-tolerant quantum computers”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think an important part of these talks was in 2 out of 3 talks, the authors relied heavily on the software tools to perform resource estimation, and not just mathematical analysis. This is important since the constant factors can sometimes be much more important than the theoretical scaling. Actually, Eleanor Rieffel (NASA) made a good comment on this in her keynote – for one algorithm she worked on, the scaling is better, but the threshold for utilizing this gain is \(n=10^{18}\) !&lt;/p&gt;

&lt;p&gt;Lastly, we had a presentation of the projects coming from the QRE Challenge that we had organized prior to the workshops by Petra Brčić and Walden Killick. And then a panel with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Matt Harrigan (Google)&lt;/li&gt;
  &lt;li&gt;Antonio Corcoles (IBM)&lt;/li&gt;
  &lt;li&gt;Athena Caesura (PsiQuantum)&lt;/li&gt;
  &lt;li&gt;Neil Gillespie (Riverlane)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;lead by Kevin Obenland (MIT LL)&lt;/p&gt;

&lt;p&gt;Some highlights from the panel:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Making tools amenable to different computational models would be really important. For example, there are cases where counting Clifford operations is important and some, where they aren’t.&lt;/li&gt;
  &lt;li&gt;Our tools need to be able to make use of algorithm structure and not just work on bare circuits.&lt;/li&gt;
  &lt;li&gt;The QRE tools will keep evolving as we get closer to the actual working machine. It’s ok for them to be somewhat rough today, as before we get to the FT computer, a lot of the methods and assumptions will change.&lt;/li&gt;
  &lt;li&gt;In order to make sure that people who are not QC domain experts will not get scared of the outrageous numbers that we produce today, we should accompany them with a clear plan on what we plan to do to bring them down.&lt;/li&gt;
  &lt;li&gt;What we have now can be treated as 1st generation QRE tools, now we see that we’re slowly getting into 2nd generation. Maybe it’s somewhat trivial to say this, but it is a useful framing for me.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;how-to-make-things-happen&quot;&gt;How to make things happen&lt;/h2&gt;

&lt;p&gt;One of the complaints I heard was that there was a lot of NISQ-related activity at the conference and not enough FTQC-related. Indeed – quickly scanning the list of workshops, I found only 3 out of 36 workshops, which were specifically focused on FTQC-related topics: one on Quantum Error Correction (QEC), one on decoding and ours on QRE.&lt;/p&gt;

&lt;p&gt;However, this conference is a community effort. If you think a particular topic is important and underrepresented, please propose a session on the topic! It can be a workshop, panel, birds of feather session or something else.&lt;/p&gt;

&lt;p&gt;Since I’ve been involved in organizing a few of these already, I could write a blogpost that explains how to approach it – if this would be useful to people, please let me know, either through a comment or e-mail!&lt;/p&gt;

&lt;h2 id=&quot;closing&quot;&gt;Closing&lt;/h2&gt;

&lt;p&gt;These are some of my main takeaways. I hope this has been an interesting perspective for you. If so, please leave a comment or &lt;a href=&quot;mailto:michal@mustythoughts.com&quot;&gt;let me know&lt;/a&gt;, cause if no one reads it, I won’t be writing another one next year :)&lt;/p&gt;

&lt;p&gt;Have a great day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;
</description>
				<pubDate>Mon, 14 Oct 2024 10:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/quantum-week-2024.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/quantum-week-2024.html</guid>
			</item>
		
			<item>
				<title>QRE workshops summary</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;together with a group of people (see at the end) we have organized workshops about Quantum Resource Estimation at IEEE Quantum Week 2023 in Seattle.
We had a set of amazing speakers who talked about the topic from various perspectives and in this post, I would like to summarize their talks.&lt;/p&gt;

&lt;p&gt;We have grouped the workshop into three sessions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Grand Challenges&lt;/li&gt;
  &lt;li&gt;Machinery&lt;/li&gt;
  &lt;li&gt;Tools demonstrations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While writing this post I realized the style of each section is a bit inconsistent. That’s because the talks had different formats, so in some cases it felt more appropriate to follow the narrative of the talk closely, in other just provide a summary of their points. Hope it works well :)&lt;/p&gt;

&lt;p&gt;As it took me long to write this blog post, I didn’t want to delay publishing it, so I have not asked any of the speakers to authorize the text! I hope I have not misrepresented anything, but if something seems suspicious, this might be the reason why.&lt;/p&gt;

&lt;p&gt;Ok, let’s dive in!&lt;/p&gt;

&lt;h1 id=&quot;grand-challenges&quot;&gt;Grand Challenges&lt;/h1&gt;

&lt;h2 id=&quot;travis-humble&quot;&gt;Travis Humble&lt;/h2&gt;

&lt;p&gt;Travis Humble – director of Quantum Science Center at Oak Ridge National Laboratory.&lt;/p&gt;

&lt;p&gt;Travis started from talking about four characteristics of quantum computers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Area: footprint of the algorithm, in the circuit model that would be depth * width.&lt;/li&gt;
  &lt;li&gt;Error: drives how well the machine can operate and how much overhead is needed for error mitigation/correction.&lt;/li&gt;
  &lt;li&gt;Latency: not a bottleneck right now, but might be important in the future. I think it could be related to the reaction depth problem that others mentioned in their talks.&lt;/li&gt;
  &lt;li&gt;Accuracy: being able to quantify whether the answers are accurate is an important aspect of performing resource estimates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From the perspective of applications it’s also important to estimate what is time-to-solution and power needed to run particular program.&lt;/p&gt;

&lt;p&gt;He also mentioned some key challenges present in quantum computing now.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Managing diversity – there are many platforms and all of them change rapidly. In the context of QRE, you need to take into account the constraints and capabilities of a particular system.&lt;/li&gt;
  &lt;li&gt;Noise and errors – error mitigation and correction consume a lot of resources. It’s interesting to see how these methods develop (e.g.: &lt;a href=&quot;https://www.nature.com/articles/s41586-023-06096-3&quot;&gt;Y. Kim et al&lt;/a&gt; ).&lt;/li&gt;
  &lt;li&gt;Model validation – we need to make sure that the model we use (either for performing error mitigation/correction or QRE) is valid. This is not trivial, as the characteristics of the devices today can change drastically over time. (see below, it’s Fig. 1 from &lt;a href=&quot;https://arxiv.org/abs/2309.06327&quot;&gt;Zhu et al.&lt;/a&gt; ).&lt;/li&gt;
  &lt;li&gt;Reproducibility – given the point above, being able to reproduce any results is also not trivial and something we don’t think about enough as a community.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Travis spent significant time talking about the last one. He defined reproducibility as the ability to reproduce the results from an experiment under identical conditions (within statistical confidence).&lt;/p&gt;

&lt;p&gt;It is a grand challenge in part because it sets expectations for behavior we really can’t meet. We can’t create identical conditions to meet the point-model estimates and we need to figure out the way to connect those point-models.&lt;/p&gt;

&lt;p&gt;I think it’s important to talk a bit about models at this point. One of the problems with QRE is that in order to get any hardware-aware numbers, you need to have some model of the hardware that you use to produce those estimates. Therefore, your estimates will be only as good as the model you use. In this context “point-model” means “model of your hardware at a given point in time”. So my interpretation of what Travis said, is that rather than relying on point models, we need to figure out a way to build more realistic models and characterize the hardware better.&lt;/p&gt;

&lt;p&gt;He also said that understanding how variation in hardware, different noise models, etc. influence the metrics we actually care about (accuracy and time-to-solution) will be an important task.&lt;/p&gt;

&lt;p&gt;The whole talk focused on near-term devices, but many wondered how this maps to the FTQC regime. Travis admitted, that this might be just a phase in the development of the hardware and perhaps this problem will not exist in the FTQC regime. However, it might also be true that even with error correction models for various parts of the systems are different and unstable over time, which might affect the performance and resources needed for the calculation.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2024-01-12-qre-workshops/01_zhu_et_al.png#center&quot; alt=&quot;Zhu et al.&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;wim-van-dam&quot;&gt;Wim van Dam&lt;/h2&gt;

&lt;p&gt;Wim van Dam – Principal Researcher at Microsoft.&lt;/p&gt;

&lt;p&gt;This talk was based on some of the research Wim and his team did in the past. Some of it has not been yet published, I’ll link to it when it’s out. Here’s &lt;a href=&quot;https://arxiv.org/abs/2211.07629&quot;&gt;a paper&lt;/a&gt; he was referring to, as well as &lt;a href=&quot;https://learn.microsoft.com/en-us/azure/quantum/intro-to-resource-estimation&quot;&gt;Azure Quantum Resource Estimator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Wim started his talk strong: 
What’s the purpose of talking about QRE? Given how big those numbers are, is it just to get depressed?&lt;/p&gt;

&lt;p&gt;Well – no. We should take QRE seriously right now. Why?
Because they will help us find good applications for QC.&lt;/p&gt;

&lt;p&gt;What applications are we talking about? Something that’s actually important, classically amenable, and can be solved within weeks, not years. A good rule of thumb for the target execution time is a million seconds (which is roughly 12 days). A “practical quantum solution”.&lt;/p&gt;

&lt;p&gt;Next, Wim talked a bit about the model of the stack they’ve been using for their QRE:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Error rates per gate: \(10^{-11}\) to \(10^{-16}\). This implies that we need QEC.&lt;/li&gt;
  &lt;li&gt;The error correction code used is planar, but it can be either surface code or Floquet code.&lt;/li&gt;
  &lt;li&gt;Given the choice of code, you choose the type of instructions (either gate or Majorana-based) and then the type of hardware.&lt;/li&gt;
  &lt;li&gt;Stack is divided into three levels: logical qubits, QEC and physical qubits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using this model, they’ve chosen various sets of parameters: optimistic, pessimistic and based on Majorana (if you’re not sure what that means, but there’s explanation in &lt;a href=&quot;https://arxiv.org/abs/2211.07629&quot;&gt;the paper&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;After getting QREs, the problem is that some of the estimates they got take more than 2 weeks. However, having these numbers (even if they’re a bit depressing) allows us to better articulate the needs of the application.&lt;/p&gt;

&lt;p&gt;Then they asked, whether there’s a single number, that summarizes the core strength of the hardware and they came up with rQOPS (reliable Quantum Operations Per Second):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;R = Q * f&lt;/code&gt; at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;P_l&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;f&lt;/code&gt;: logical clock speed&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Q&lt;/code&gt;: the number of reliable logical qubits&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;P_l&lt;/code&gt;: error rate of logical qubits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They have analyzed many use cases and broke them down in three categories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;First Scientific Applications: Dynamic properties of Ising models: ~kilo rQOPS at \(10^{-8}\) error rate.&lt;/li&gt;
  &lt;li&gt;More Scientific Applications: Groundstate properties of Fermi-Hubbard or Heisenberg model: ~Mega rQOPS at \(10^{-12}\) error rate.&lt;/li&gt;
  &lt;li&gt;Practical Chemistry Applications: Quantum chemistry with 30-40 molecular orbitals: ~Giga rQOPS at \(10^{-18}\) error rate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end, Wim commented that it’s important to have a link between algorithm and hardware developers:
Big O notation is nice, but metrics such as rQOPS allow you to be physics-aware while being an algorithm designer.
But also, they allow experimentalists to easily answer questions such as: “If I improve this aspect, what are the algorithmic consequences?”&lt;/p&gt;

&lt;p&gt;Regardless of where you work in the stack, resource estimation is a compass that tells you what to work on.&lt;/p&gt;

&lt;h1 id=&quot;panel&quot;&gt;Panel&lt;/h1&gt;

&lt;p&gt;For the panel, apart from Travis and Wim, we also had:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Oliva Crawford from Riverlane&lt;/li&gt;
  &lt;li&gt;Will Zeng from Quantonation&lt;/li&gt;
  &lt;li&gt;Dave Clader from BQP Advisors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some of my favorite insights.&lt;/p&gt;

&lt;p&gt;Question: What are the biggest challenges in QRE?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;QRE is a process composed of many steps and at each step one needs to make a choice. Many of the components don’t exist yet. This makes making reasonable assumptions and approximations difficult.&lt;/li&gt;
  &lt;li&gt;Communicating the results so they are reproducible and meaningful.&lt;/li&gt;
  &lt;li&gt;Building tools is critical.&lt;/li&gt;
  &lt;li&gt;Making the optimism concrete is important.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Question: What is the right approach to attack the scalability problem?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Try to be as accurate as possible at the abstract circuit level. Ignore QEC, routing layouts, etc., just deal with the gates. This is a very useful place to start.&lt;/li&gt;
  &lt;li&gt;We can have the best QRE but there is still a question of whether this is even the right program to run. Verification is an important open problem and gets harder as the system scales.&lt;/li&gt;
  &lt;li&gt;Getting precise numbers takes time, and immediate feedback is super important. There’s a tradeoff between being precise and being fast about it.&lt;/li&gt;
  &lt;li&gt;You need to have libraries to do fixed-point arithmetics and other basic subroutines to speed up the research&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Question: How to communicate very big numbers (months of runtimes, billions of T-gates) in a way that’s productive and doesn’t scare people?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;We need to have metrics that we can work towards which will remain valid metrics all the way to the utility. Otherwise, from the outside, it looks like changing the goalpost.&lt;/li&gt;
  &lt;li&gt;It’s also important that people get used to those numbers. We need to make it clear that we’re a long way from the FTQC calculations.&lt;/li&gt;
  &lt;li&gt;The real value of doing concrete resource estimates is that once someone produces those resource estimates, the community jumps in and the numbers get improved. At some point we’ll hit some asymptotic barriers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Extra quotes worth mentioning:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Often we find that when you look at all the details you find out that the algorithms actually don’t give you any speedup.&lt;/li&gt;
  &lt;li&gt;Arguably this is the most important workshop of the week &amp;lt;3&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;machinery&quot;&gt;Machinery&lt;/h1&gt;
&lt;h2 id=&quot;sam-jacques&quot;&gt;Sam Jacques&lt;/h2&gt;

&lt;p&gt;After a break we got into the “QRE Machinery” sessions. We started with a talk by Sam Jacques who’s Assistant Professor at the University of Waterloo.&lt;/p&gt;

&lt;p&gt;The talk was about Sam’s experiences working on multiple projects, during his time at Microsoft, Oxford, and Waterloo. Sometimes it got pretty detailed, so rather than trying to reproduce the whole reasoning and story, I’ll just cover the main points:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A huge cost driver in Shor’s algorithm is performing arithmetics&lt;/li&gt;
  &lt;li&gt;You can either use low, assembly-level languages (like qiskit) or high-level (like Q#), but there’s nothing in between right now.&lt;/li&gt;
  &lt;li&gt;Apart from calculating resources for a particular algorithm, we also need to check for its correctness.&lt;/li&gt;
  &lt;li&gt;Fixing compilation bugs is extremely hard – Sam talked about a story of a particular bug in Q#, which took about 2 years to properly fix, as it was coming back in various flavors.&lt;/li&gt;
  &lt;li&gt;Introducing feedback loops with classical measurements leads to new level of bugs in the algorithms and compilation.&lt;/li&gt;
  &lt;li&gt;If one breaks a couple of abstraction layers and implements the algorithm at the level of surface codes, it allows for a whole new level of optimizations. However, it’s extremely tedious and manual, there are absolutely no tools to do this.&lt;/li&gt;
  &lt;li&gt;People focus too much on T-count, and in some cases, T-depth and reaction speed are the real bottlenecks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Summary slide from Sam:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Automating resource estimations is hard&lt;/li&gt;
  &lt;li&gt;No perfect trade-off between generality and accuracy&lt;/li&gt;
  &lt;li&gt;It’s too early to pick architectures or assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sam’s QRE wishlist:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Software to work with 2D surface codes&lt;/li&gt;
  &lt;li&gt;More attention to routing and physical layout problems&lt;/li&gt;
  &lt;li&gt;Free your minds from reversible classical computation&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;daniel-litinski&quot;&gt;Daniel Litinski&lt;/h1&gt;

&lt;p&gt;Daniel Litinski is a Quantum Architect at PsiQuantum.&lt;/p&gt;

&lt;p&gt;Daniel talked about his &lt;a href=&quot;https://arxiv.org/abs/2306.08585&quot;&gt;recent paper about elliptic curves&lt;/a&gt;, but &lt;a href=&quot;https://arxiv.org/abs/2211.15465&quot;&gt;this paper about active volume&lt;/a&gt; also provides a lot of relevant background.
So if you’d like to get into real technical details, that’s where you should go. Here I’ll try to get across some major points from the talk.&lt;/p&gt;

&lt;p&gt;Daniel started from talking about the differences between “active volume (AV) architecture” and “baseline architecture”. The two main points for me:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;In baseline architecture the speed of performing T gates is constant, but in AV architecture, thanks to non-local connections, speed can be increased by adding more qubits.&lt;/li&gt;
  &lt;li&gt;In the baseline architecture our primary resources are T/Toffoli gates, in AV architecture our primary resource is, well, Active Volume. The ratio for AV to Toffoli counts differs from subroutine to subroutine. In general, it’s favorable for arithmetic, but it can be quite costly for lookup tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After this, he talked more about various compilation optimizations for the elliptic curve algorithm. Some of them are asymptotic in nature – they come from parallelization and would not apply if we wanted to break only one key at a time.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Given that the first half of the computation will be the same for many keys, we can reuse it to break multiple keys (2x reduction).&lt;/li&gt;
  &lt;li&gt;You only need to generate 208 out of 256 bits on a quantum computer, as the other 48 can be brute-forced on a classical computer. It costs less than a million CPU hours (also see &lt;a href=&quot;https://arxiv.org/abs/1905.09084&quot;&gt;Martin Ekera’s paper&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;Spread the cost of modular inversion (the most expensive operation in the algorithm) over multiple instances (~2.5 reduction).&lt;/li&gt;
  &lt;li&gt;There’s a trick called “windowing” where we precompute some values classically and put them in a lookup table, which is cheaper to implement on a QC than calculating them on the fly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each instance of the algorithm uses about 3k logical qubits &amp;amp; 100m Toffoli gates / 7b blocks of AV. But the more keys we calculate in parallel, the smaller the number of Toffoli gates per key (see tricks above). Asymptotically it gets to about 50m Toffoli gates per key (at around 50k logical qubits). To put it in context, this is a relatively small number – RSA 2048 requires over a billion Toffoli gates and FeMoCo 10 billion Toffolis.&lt;/p&gt;

&lt;p&gt;However, it’s worth noting, that some of these tricks only make sense in AV architecture – in baseline architecture such parallelization may increase overall computation cost.&lt;/p&gt;

&lt;p&gt;At the end Daniel talked about physical resources from this table from his paper – no comments from me, just take a look at it:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2024-01-12-qre-workshops/03_daniel.png#center&quot; alt=&quot;Daniel Litinski&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I really encourage you to read Daniel’s papers – all his papers are very well written and pretty approachable (given the complexity of the topics), he’s definitely one of my top favorite paper authors (and was even before I started working with him!)&lt;/p&gt;

&lt;h1 id=&quot;thomas-alexander&quot;&gt;Thomas Alexander&lt;/h1&gt;

&lt;p&gt;Thomas Alexander is a Quantum Solutions Developer at IBM. For the last 5 years he worked on putting quantum systems online.&lt;/p&gt;

&lt;p&gt;In contrast with previous talks, Thomas focused more on software-hardware interface. He was referring to some of the concepts from &lt;a href=&quot;https://arxiv.org/abs/2211.07629&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s a bunch of very good points he made during the talk:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;As the systems scale up, so does the complexity, and building a quantum computer requires connecting many subsystems.&lt;/li&gt;
  &lt;li&gt;QRE is a tool that allows us to predict application requirements. In turn, application requirements allow us to predict system and subsystem requirements.&lt;/li&gt;
  &lt;li&gt;There’s a co-design loop in designing a quantum computer – saying “I want to run this application” forces a series of design decisions down the stack. This is a hard optimization problem with tradeoffs everywhere.&lt;/li&gt;
  &lt;li&gt;There is no “quantum computer” today. There is just a device. What turns it into a QC is plenty of calibration and characterization routines that bootstrap this device into a quantum computer.&lt;/li&gt;
  &lt;li&gt;In the near term, you need to really optimize all the elements to make things work, so you need to understand many subsystems, which is hard.&lt;/li&gt;
  &lt;li&gt;Today most QRE focus on circuits (logical or physical), but enabling higher-level abstractions will allow to reduce the information flow throughout the system. For example, when you’re sending info about expectation value instead of all the measurements, there’s much less info to be passed between subsystems.&lt;/li&gt;
  &lt;li&gt;We need to start introducing reusable subroutines.&lt;/li&gt;
  &lt;li&gt;Right now we use a small number of inputs for doing QRE, but from the perspective of operating the system, the number of parameters is much higher. However, on the existing devices each qubit is a special snowflake and to get any performance you need to finetune using knowledge about each qubit. We need to get to a world where all the qubits are fungible and we don’t need to worry about their individual characteristics.&lt;/li&gt;
  &lt;li&gt;Quantum IRs – compilation should scale at most polynomially, but ideally linearly in terms of numbers of gates or qubits. Right now it’s pretty slow, we need to introduce better IRs to make this process more efficient.&lt;/li&gt;
  &lt;li&gt;Most representations don’t support non-linear control flow, which will be a problem as we start thinking about more advanced protocols.&lt;/li&gt;
  &lt;li&gt;To get the most out of the device it’s important to understand how your big program is being distributed among multiple smaller devices which control different aspects of the overall QC.&lt;/li&gt;
  &lt;li&gt;To run those weeks-long algorithms, we will need to keep the devices up for days.&lt;/li&gt;
  &lt;li&gt;Reliability and efficiency of machines are critical for long-running applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;tools&quot;&gt;Tools&lt;/h1&gt;

&lt;p&gt;The last part of the workshops was a session where various people gave 5-10 minute presentations on the tools they’re developing and then some time for having discussions with the developers.&lt;/p&gt;

&lt;p&gt;We had:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Athena Caesura from Zapata AI presenting &lt;a href=&quot;https://github.com/zapatacomputing/benchq&quot;&gt;Bench-Q&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Matt Harrigan from Google presenting &lt;a href=&quot;https://github.com/quantumlib/Qualtran&quot;&gt;Qualtran&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Mariia Mykhailova from Microsoft presenting &lt;a href=&quot;https://learn.microsoft.com/en-us/azure/quantum/intro-to-resource-estimation&quot;&gt;Azure Quantum Resource Estimator&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Kevin Obenland from MIT Lincoln Lab presenting &lt;a href=&quot;https://github.com/isi-usc-edu/pyLIQTR&quot;&gt;pyLiqtr&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Michał Stęchły presenting PsiQuantum’s symbolic QRE tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While this section is short, I recommend checking out all of these tools and seeing if there’s anything useful there for you. If the topic of QRE is of interest to you, I really think it’s crucial to get acquainted with at least some of them!&lt;/p&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;

&lt;p&gt;There have been a couple of points that appeared in multiple places throughout the workshops, so I think it’s worth putting them all in one place:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;QRE is important, but it’s equally important to be confident that the programs we’re running are correct.&lt;/li&gt;
  &lt;li&gt;We need better tools for performing QRE – and in the last part of the workshop we have seen that some of those tools are being created right now, hurray!&lt;/li&gt;
  &lt;li&gt;We also need better abstractions and data formats.&lt;/li&gt;
  &lt;li&gt;QRE is an important bridge between applications and hardware development.&lt;/li&gt;
  &lt;li&gt;There are plenty of optimizations at the level of compilation that we still need to work out.&lt;/li&gt;
  &lt;li&gt;There are many, many assumptions being made while running QREs, which undermines their reliability. But also given where we are, that’s the best we can get and it constantly gets better.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;closing-notes&quot;&gt;Closing notes&lt;/h1&gt;

&lt;p&gt;Overall, I am really happy with how the workshops went! It spurred a lot of interesting discussions, I hope we’ll organize another one in 2024. It’s great to see forming of the community around QRE!
There was so much good energy around it, that I thought it would be good to help with the “community forming”. That’s why I’ve created a Discord server to facilitate discussions on the topic and perhaps spur some future projects. We even had our &lt;a href=&quot;https://youtu.be/uPX1q3VU18s?si=JQJtGR4e8Ik01zHb&quot;&gt;first talk&lt;/a&gt;. 
If you’d like to join it, &lt;a href=&quot;https://discord.gg/z5HUdXbq&quot;&gt;this link&lt;/a&gt; will be active for 7 days after publication of the blog post. After that, please send me &lt;a href=&quot;mailto:michal@mustythoughts.com&quot;&gt;an e-mail&lt;/a&gt; to get an invite :)&lt;/p&gt;

&lt;p&gt;And once again, huge kudos to the people who helped organize the workshop:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Peter Johnson&lt;/li&gt;
  &lt;li&gt;Simon Tsang&lt;/li&gt;
  &lt;li&gt;Kevin Obenland&lt;/li&gt;
  &lt;li&gt;Omar Shehab&lt;/li&gt;
  &lt;li&gt;Mathias Soeken&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have a great day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Fri, 12 Jan 2024 10:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/qre-workshops.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/qre-workshops.html</guid>
			</item>
		
			<item>
				<title>Random acts of kindness</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;My main motivation for doing most things I do in my life is that I want to make the world a better place. And as much cliche as it is, well, it is what it is.&lt;/p&gt;

&lt;p&gt;I’ve recently watched a clip from &lt;a href=&quot;https://www.youtube.com/watch?v=xY48e1oDXSU&quot;&gt;Jordan Peterson’s lecture&lt;/a&gt; and something that really resonated with me was the following quote (even though that wasn’t the main point of the talk):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;You’re a node in a network. (…) You’ll know a thousand people at least, over the course of your life. (…) And the things you do, they’re like dropping a stone in the pond. The ripples move outwards and they affect things in ways you can’t fully comprehend. And it means that the things that you do and the things that you don’t do are far more important than you think.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We all have an impact on the world around us. It doesn’t always have to be a big impact, but sometimes small things matter and can just create a little bit more happiness out of thin air.&lt;/p&gt;

&lt;p&gt;I think the culture we live in has a lot of issues, social alienation and lack of trust being one of them. And it is our actions, which on aggregate, create culture. So why don’t we change that bit by bit?&lt;/p&gt;

&lt;p&gt;I personally have experience of living in two countries – Poland and Canada. In Poland, our national pride is in complaining, and so, the negative attitude is the default. Canadians on the other hand, are most well-known for being nice. And the fact that by default, strangers are nice to each other rather than by default being neutral (with a splash of distrust) really makes a difference in the quality of life.&lt;/p&gt;

&lt;p&gt;So here’s a list of things which I sometimes do. Things that require minimal effort and are directed towards people I don’t know. Acts of kindness to random strangers. I hope it will inspire you to do them as well.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Compliment people whose work usually goes unnoticed. Or even better – people who, by design, go unnoticed if they’re good at their job. A couple of months ago I was at an event where a string orchestra was playing on a street. Getting the sound right in such settings is not simple, there are plenty of things that can go wrong. But everything sounded great so after they were finished I went to thank the sound technician for doing a good job. Another example – at the conference during a coffee break there were a couple of servers who were bringing food, taking dirty cups, etc. I stopped one of them and thanked one of them for doing his job well.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Smile at people. Whether on a street, on a bus, in a store, whenever you make eye contact, remember to smile.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;When something you read on the Internet was really good, send an e-mail to the author saying: “Hey, I really liked your article. It was a good read, it really made me think!”. You don’t need to elaborate on how it changed your life or anything like that. Just letting someone know you read and liked it is a super nice thing already! &lt;a href=&quot;https://cotejer.github.io/reach-out&quot;&gt;Don’t take my word on it&lt;/a&gt;!&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you ride on a full bus and the stops are frequent, if you’re not in a rush you can get off one stop earlier and just walk those extra 5-10 minutes. This extra breathing space that you’ll create is not much, but it always makes it a tiny bit more comfortable!&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Pick up trash from the ground. Our streets (and forests) sometimes look really terrible. It doesn’t take much to pick up stuff and throw it in a garbage bin. Also, when I see someone throwing a cigarette on the ground I pick it up and tell them that it should go to trash. Well, perhaps not the kindest thing to the person, but I find it kind to society.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Be patient. Sometimes there’s a long line in some office and the clerk tries their best but it’s not their fault things go slowly. And people in the line get angry, cause it takes so much time. Relax, notice that they try to do their best and even if you’re in a rush and annoyed, don’t lash out at them. Sometimes the system is broken, sometimes it’s bad luck, not necessarily their fault.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;When I used to work at the office, when I was taking a break I sometimes just took a couple of apples, cut them in pieces, and offered them to the people I was passing in the office on my way back to my desk.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you have stuff you no longer need, give it away. There are plenty of apps that allow you to do that. You gain some extra space and one less thing to worry about and perhaps someone will get what they need. I recently gave away a bunch of Polish books my kids outgrew and someone from Alberta wanted them, so I sent them a parcel. Win-win!&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;When you are in a supermarket and you see that the person behind you has only two items, while you have a full cart, just let them go first. Or in any other place where someone is nervous and seemingly in a rush – let them pass.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Hold the door for someone when you’re entering/exiting the public space. And if that’s a lot of people, just stand there for a minute until all the people leave.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;When the airplane lands, if you don’t have a good reason, don’t rush to the exit. There’s a good chance that some people in that plane have a good reason to rush out. Also, plane boarding &lt;a href=&quot;https://www.youtube.com/watch?v=oAHbLRjF0vo&quot;&gt;is already inefficient enough&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are a lot of other things you can do to make the world a slightly better place for others and I encourage you to do them! These were only some that:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;I’ve personally did&lt;/li&gt;
  &lt;li&gt;Truly don’t require much effort nor any money&lt;/li&gt;
  &lt;li&gt;You can do for strangers, not your friends or family&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another good source of inspiration is &lt;a href=&quot;https://www.randomactsofkindness.org&quot;&gt;Random Acts of Kindness website&lt;/a&gt;. If this blogpost inspires you to do sth kind to a stranger, please let me know at &lt;a href=&quot;mailto:michal@mustythoughts.com&quot;&gt;michal@mustythoughts.com&lt;/a&gt;! And if this resonates with you, perhaps the idea of &lt;a href=&quot;https://www.effectivealtruism.org&quot;&gt;Effective Altruism&lt;/a&gt; will also resonate with you :)&lt;/p&gt;

&lt;p&gt;And for any Poles reading it, &lt;a href=&quot;https://www.youtube.com/watch?v=RBxNTWIFsAU&quot;&gt;here’s a song by Łona&lt;/a&gt; which particularly resonates with me on this topic.&lt;/p&gt;

&lt;p&gt;Have a nice day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Sat, 21 Oct 2023 10:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/random-acts-of-kindness.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/random-acts-of-kindness.html</guid>
			</item>
		
			<item>
				<title>QAOA - challenges and state of research</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;Today we will delve into the details of QAOA – variational quantum algorithm for solving combinatorial optimization problems.&lt;/p&gt;

&lt;p&gt;We already covered a lot in previous articles in this series, so I highly recommend going through that first, especially articles 2, 3 and 4, as they are all very relevant.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;/Variational-Quantum-Eigensolver-explained.html&quot; target=&quot;_blank&quot;&gt;VQE — how it works&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/Quantum-Approximate-Optimization-Algorithm-Explained.html&quot; target=&quot;_blank&quot;&gt;QAOA — how it works&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/VQAs-how-do-they-work.html&quot; target=&quot;_blank&quot;&gt;VQAs - how do they work&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/vqas-challenges.html&quot; target=&quot;_blank&quot;&gt;VQAs – challenges and progress&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/vqe-challenges.html&quot; target=&quot;_blank&quot;&gt;VQE — challenges and progress&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;QAOA — challenges and progress (this is the one you’re reading)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Update: about a month after writing this a review paper on the topic came out by &lt;a href=&quot;https://arxiv.org/abs/2306.09198&quot;&gt;Blekos et al.&lt;/a&gt;. I don’t refer to it in the blogpost, but it covers many of the variants of QAOA and is much more comprehensive than this blogpost could ever be! I recommend reading it to anyone interested!&lt;/p&gt;

&lt;h1 id=&quot;qaoa-vs-qaoa&quot;&gt;QAOA vs QAOA&lt;/h1&gt;
&lt;p&gt;Before we even get into a detailed discussion about the algorithm itself, let’s first talk about naming.
The original QAOA algorithm presented by &lt;a href=&quot;https://arxiv.org/abs/1411.4028&quot;&gt;Farhi et al.&lt;/a&gt; is called Quantum Approximate Optimization Algorithm. However, in 2018 &lt;a href=&quot;https://www.mdpi.com/1999-4893/12/2/34&quot;&gt;Stuart Hadfield et al.&lt;/a&gt; presented a more general algorithm which is called Quantum Alternating Operator Ansatz. Which also spells “QAOA”.
You might have a couple of questions now:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Why would they do that?&lt;/li&gt;
  &lt;li&gt;What’s the difference between these two?&lt;/li&gt;
  &lt;li&gt;If I hear “QAOA” what exactly do people mean by it?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me quote the Hadfield’s paper:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;We reworked the original acronym so that “QAOA” continues to apply to both prior work and future work to be done in this more general framework. More generally, the reworked acronym refers to a set of states representable in a certain form, and so can be used without confusion in contexts other than approximate optimization, e.g., exact optimization and sampling.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This means that “the original QAOA” is just a subset of “a more general QAOA”. One of the differences is that in the original QAOA the Hamiltonians which we use are defined in a specific way, while the more general framework allows for much more flexibility. Plus the more general framework is not designed specifically for “approximate optimization” but also for other uses.&lt;/p&gt;

&lt;p&gt;So if you hear “QAOA” which one people mean? Well, I’d argue that most of the time people mean the “more general QAOA”, even if they don’t necessarily realize that or what’s the actual difference. I think that most of the time if someone means “original QAOA” specifically they refer to it as “vanilla QAOA”, “basic QAOA”, “Farhi’s QAOA” or something similar.&lt;/p&gt;

&lt;h1 id=&quot;problem-related-issues&quot;&gt;Problem-related issues&lt;/h1&gt;

&lt;p&gt;There are three topics I wanted to talk about, which are more about the problems we’re trying to solve rather than the QAOA algorithm itself. Dealing with these challenges is important for any algorithm which tries to solve optimization problems, quantum or classical. Some are more apparent in one class of algorithms, some in others, but over the years I learned that they all can heavily influence the results of your optimization routine, so I think it’s worth discussing them here.&lt;/p&gt;

&lt;p&gt;These are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Problem formulation&lt;/li&gt;
  &lt;li&gt;Constraints&lt;/li&gt;
  &lt;li&gt;Problem encoding&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;problem-formulation&quot;&gt;Problem formulation&lt;/h2&gt;
&lt;p&gt;In general, when you try to solve optimization problems, there is a huge payoff for understanding your problem better and coming up with a better formulation. By formulation I mean understanding the real-world problem and expressing it in a way that an algorithm can solve and maybe adding some problem-specific improvements to the algorithm. This is in opposition to coming up with a better optimization method for a given class of problems, fine tuning it, etc.&lt;/p&gt;

&lt;p&gt;Let’s take a look at the following problem – you are in charge of IT infrastructure at a campus. You have a team of 5 people and you have to service equipment in various buildings at the campus. Every day you get calls from people around the campus about the issues that your team needs to solve. For each request you:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;identify where the issue happened&lt;/li&gt;
  &lt;li&gt;estimate how long it will take to solve it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problem is how to assign your team in an optimal way?&lt;/p&gt;

&lt;p&gt;One approach would be to model this as Capacitated Vehicle Routing Problem (CVRP, it’s a more complicated variant of Traveling Salesman Problem).&lt;/p&gt;

&lt;p&gt;In such formulation you can say that:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The capacity of each person is 6 hours per day&lt;/li&gt;
  &lt;li&gt;Each person shouldn’t spend more than 1 hour driving around the campus, which translates into a constraint that the route itself needs to be under 1 hour.&lt;/li&gt;
  &lt;li&gt;You are fine with not solving all the requests every day (i.e. not visiting all the cities)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You also decide that your cost function is the number of issues you can solve per day.&lt;/p&gt;

&lt;p&gt;Do you think it’s a good formulation?&lt;/p&gt;

&lt;p&gt;Well, it depends. Below you can find a couple of questions that one needs to ask in order to model this specific problem better:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Are all the people on the team equally skilled? If one of them is new to the job and another one is a veteran, you should probably start expressing the time estimates differently, e.g. depending on one’s experience or in abstract “points” rather than time. In the latter case, the expert person would have higher capacity.&lt;/li&gt;
  &lt;li&gt;How accurate are your time estimates for solving those problems? If they’re not very accurate, the mathematical model might have a huge mismatch with reality. If they’re not very accurate, can you model how inaccurate they are, perhaps using a normal distribution?&lt;/li&gt;
  &lt;li&gt;How much time does it take to travel between different buildings on campus? If there are 3 buildings which are all 5 minutes apart, perhaps it’s worth modeling them as one node – that would decrease the complexity of the graph. If getting from one building to another takes less than 10 minutes, perhaps it’s negligible and you would be better off modeling it as a scheduling problem and not CVRP?&lt;/li&gt;
  &lt;li&gt;Do issues have different importance?&lt;/li&gt;
  &lt;li&gt;Given that your cost function depends on the number of problem solved per day, it might lead to a situation where one 6-hour long problem never gets scheduled, because there are always multiple 1-hour problems popping everywhere. Is that acceptable?&lt;/li&gt;
  &lt;li&gt;Can some problems be solved remotely? If so, how would you model that?&lt;/li&gt;
  &lt;li&gt;What if a particular problem takes more than a day to solve?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope that’s enough to make this point, perhaps the most important from the whole blogpost:&lt;/p&gt;

&lt;p&gt;You can have the absolutely best algorithm for solving combinatorial optimization problems, but in the end, if your problem model doesn’t match reality well, who cares?&lt;/p&gt;

&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;

&lt;p&gt;Imagine you have a store and you sell two products: X and Y. 
You want to maximize the profits from selling them. Profit equals revenue minus cost:&lt;/p&gt;

\[P = R - C\]

&lt;p&gt;Revenue is equal to the amount of X sold times its price and same for Y.&lt;/p&gt;

\[R = p_x x + p_y y\]

&lt;p&gt;The costs are trickier, as the more products you have, the pricier it is to store it:&lt;/p&gt;

&lt;p&gt;\(C = c_x x^2 + c_y y^2\).&lt;/p&gt;

&lt;p&gt;Your goal is to order the optimal amount of X and Y so that you can maximize your profit.&lt;/p&gt;

&lt;p&gt;Well – that’s a simple quadratic function. You can solve it analytically or just use a simple gradient descent optimizer and find it in no time. But let’s add some constraints to make it more realistic. Let’s say you have a limited capacity of your storage, so:&lt;/p&gt;

\[0 &amp;lt; x + y &amp;lt; C_1\]

&lt;p&gt;Also, they shouldn’t be negative: \(x &amp;gt;= 0\) and \(y &amp;gt;= 0\).&lt;/p&gt;

&lt;p&gt;On top of that, your supplier tells you that process for creating X and Y is correlated and you can’t just buy only X or only Y, but there’s also some upper cap on their production in relation to each other, so you need to add the following constraint:&lt;/p&gt;

\[C_2 &amp;lt;= x * y &amp;lt;= C3\]

&lt;p&gt;Oh, and on top of that, X is sold in discrete quantities (\(x\) is an integer), but Y is a liquid so you can buy any quantities (\(y\) is a real number).&lt;/p&gt;

&lt;p&gt;Well, now our problem is much more interesting and it’s not immediately obvious how to solve it. As you might guess, people came up with some techniques to deal with such constraints. Unfortunately not all of these methods are applicable to all types of cost functions, all types of constraints or all types of optimizers. As it’s quite a broad topic, here I’ll focus only on two methods that you might encounter in QAOA-related literature problems.&lt;/p&gt;

&lt;p&gt;First of them works by using something called a “penalty function”. It is a way of modifying your cost function, by introducing some artificial terms which would “penalize” if the variables don’t meet the constraint. Let’s use our favorite MaxCut. As you might recall from previous parts, the cost function of MaxCut is:&lt;/p&gt;

&lt;p&gt;\(C = \sum_{(i,j) \in E } w_{ij} (1-x_i x_j)\),&lt;/p&gt;

&lt;p&gt;where \(E\) is a set of all the edges in the graph.&lt;/p&gt;

&lt;p&gt;But what if we had a constraint that one group needs to consist of exactly 5 elements? How could we express it mathematically? 
Since \(x_i\) is either 0 or 1, we can arbitrarily say that we want the group represented by ones to have exactly 5 elements. 
In such a case we know that \(\sum x_i = 5\). We can also rewrite it as: \(5 - \sum x_ii = 0\). 
How do we incorporate this in our cost function? Well, here’s the trick. We transform it into the following term:&lt;/p&gt;

\[P = P_1 (5 - \sum x_i)^2\]

&lt;p&gt;and then just add it to the cost function:&lt;/p&gt;

\[C_{new} = C + P\]

&lt;p&gt;Since we want to minimize the value of \(C_{new}\), any solution \(x\) which doesn’t meet the constraint will make the value of \(C_{new}\) higher, so it will be a worse solution. Since \(P_1\) is an arbitrary constant which doesn’t have any real-world meaning, we can select it to be arbitrarily high. E.g. if our values C are usually in the range of 0-10, we can set \(P_1=100\), so that any minor violation of the constraint would result in an extremely high penalty to the cost&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;.
Basically what we did is we transformed a constrained problem (cost function C and our constraint) into an unconstrained one (just cost_function \(C_{new}\) without any constraints).&lt;/p&gt;

&lt;p&gt;This method has some pros and cons – it’s relatively simple and it works for basically any problem, as you can always modify your cost function. However, it doesn’t work well with all types of optimization methods and is a little bit more tricky to use with inequality constraints (i.e. \(\ge, \le\)).
You can find examples of this being incorporated into the cost function in everyone’s favorite &lt;a href=&quot;https://www.frontiersin.org/articles/10.3389/fphy.2014.00005/full&quot;&gt;“Ising formulations of many NP problems” by Andrew Lucas&lt;/a&gt;, see e.g.: section 7.1 . Another example of how to do that is in section 3.1 of &lt;a href=&quot;https://arxiv.org/abs/1804.09130&quot;&gt;this paper&lt;/a&gt; (again by Stuart Hadfield)&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;There is another way to avoid getting solutions you don’t want, and it works particularly well with problems where solutions have some inherent structure, as is the case for many combinatorial optimization problems.
Let’s take the Traveling Salesman Problem (TSP) as an example&lt;sup id=&quot;fnref:3&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;. For 5 cities the solution can look like this: [5, 2, 3, 1, 4], which specifies in what order we visit cities.
An incorrect solution might look like this: [5, 2, 3, 1, 2] – as you can see we’re visiting city 2 twice in this case, but we’re missing city 4, which violates the constraints.&lt;/p&gt;

&lt;p&gt;How can we ensure our solution is always correct? There are two components to the solution:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Start from a valid solution (i.e. one doesn’t violate constraints)&lt;/li&gt;
  &lt;li&gt;Create new solutions by performing only operations which transform a valid solution into another valid solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the case of TSP such operations would be swapping elements in the list. So we could transform [5, 2, 3, 1, 4] into [4, 2, 3, 1, 5], which is also a valid solution, but with this method we would never get anything like [5, 2, 3, 1, 2].&lt;/p&gt;

&lt;p&gt;Easy to do with lists, but how does one do that with quantum states?
I talk more about it in &lt;a href=&quot;#quantum-alternating-operator-ansatz&quot;&gt;the section about alternative QAOA ansatz&lt;/a&gt;!&lt;/p&gt;

&lt;h2 id=&quot;encoding&quot;&gt;Encoding&lt;/h2&gt;

&lt;p&gt;Another important topic is how do you encode your problem to fit a particular algorithm. Let’s think about how to describe the TSP problem in a mathematical form and different ways to encode solutions to it.&lt;/p&gt;

&lt;p&gt;The most natural (at least for me) way is to define a distance matrix. It is a matrics which tells us what’s a difference between each pair of cities. For three cities it can look like this:&lt;/p&gt;

&lt;style type=&quot;text/css&quot;&gt;
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
.center {
  margin-left: auto;
  margin-right: auto;
}
&lt;/style&gt;

&lt;table class=&quot;tg center&quot;&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;A&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;B&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;C&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;A&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;5&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;7&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;B&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;5&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;10&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;C&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;7&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;10&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;0&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;We know that the distance from A to B is 5km, from B to C is 10km and from A to C is 7km. 
How would we encode the solution?
Simply as: [A, B, C], [B, C, A] etc.&lt;/p&gt;

&lt;p&gt;We can easily switch to integer labels (A=&amp;gt;1, B=&amp;gt;2, C=&amp;gt;3), which will make some math down the road easier (like indexing rows and columns of the distance matrix).&lt;/p&gt;

&lt;p&gt;Ok, but what if our machine has a limited number of integers it can work with for expressing the solution. In the case of a quantum computer it’s actually just 0 or 1. So how would we encode the solution to our 3-city problem?&lt;/p&gt;

&lt;p&gt;Well, there are multiple ways to do this. The simpler one (perhaps) is called “one-hot encoding” or “unary encoding”. In this encoding, we encode each city like this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A -&amp;gt; 100&lt;/li&gt;
  &lt;li&gt;B -&amp;gt; 010&lt;/li&gt;
  &lt;li&gt;C -&amp;gt; 001&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now if we want to represent a route: A -&amp;gt; C -&amp;gt; B, we can write it as “100 001 010”. Each bistring will consist of three blocks, each represent one moment in time. And then each block will consist of three bits, each representing a city. So in this case having “001” in the middle means, that we visit city “C” in the second time step. This allows us to easily encode constraints, such as “you can be only in one city at the time”, as you just need to check if any given block contains only a single 1.&lt;/p&gt;

&lt;p&gt;However, one thing people often say when looking at the unary encoding is that it’s very space inefficient. Indeed, it will take you \(n^2\) bits to encode a solution for the problem with \(n\) cities. So perhaps we could use binary encoding. In this case we will have:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A -&amp;gt; 00&lt;/li&gt;
  &lt;li&gt;B -&amp;gt; 01&lt;/li&gt;
  &lt;li&gt;C -&amp;gt; 10&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, we use only 6 bits to encode the solution and it actually scales as $n \cdot log(n)$, which is pretty good!&lt;/p&gt;

&lt;p&gt;There are, however, a couple of issues here. First, the bitstring “11” is undefined. You can write a route containing it, but it doesn’t mean anything. One way to deal with it is to add a constraint that will prohibit its occurrences, but it adds more complexity. Second, encoding the “basic constraints” of the problem, like “each city needs to be visited only once” is more involved than in the previous case.&lt;/p&gt;

&lt;p&gt;There’s plenty of trade-offs when it comes to choosing encoding, and you can come up with many different variants (or even combining multiple encoding at the same time). I won’t get into any details, but if you are interested, I recommend reading &lt;a href=&quot;https://www.nature.com/articles/s41534-020-0278-0&quot;&gt;this paper by Nicholas Sawaya et al.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We didn’t even discuss how those encodings impact the construction of the cost Hamiltonian for our problem, as it would be rather tedious. I just wanted to signal this as another important decision which you need to think about when you try to solve optimization problems, especially with quantum computers.&lt;/p&gt;

&lt;h1 id=&quot;parameter-concentration&quot;&gt;Parameter concentration&lt;/h1&gt;

&lt;p&gt;Ok, now we’re done with those “general optimization topics”, let’s get into some QAOA-specific topics.
Let’s start with a very interesting phenomenon first described by &lt;a href=&quot;https://arxiv.org/abs/1812.04170&quot;&gt;Brandao et al&lt;/a&gt;. Consider a class of problems: MaxCut on 3-regular graphs&lt;sup id=&quot;fnref:4&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:4&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;. Let’s take one problem instance (i.e. one specific graph) and find good parameters for it. And now let’s take 100 other graphs of the same size and see how well these parameters would do?&lt;/p&gt;

&lt;p&gt;It turns out that good parameters for one instance work very well on 100 other similar instances of the same size. But that’s not everything – they also work very well on graphs of different sizes, but of the same type. So for example a graph with 10 nodes and the other one with 20 nodes. Also, good parameters work equally well and bad parameters work equally badly. This inspired us to do a little bit of investigation with the visualization package we developed at Zapata, &lt;a href=&quot;https://github.com/zapatacomputing/orqviz&quot;&gt;orqviz&lt;/a&gt;. As you can see in the plots below, for several graphs from the same family which differ in size, the cost landscapes look very similar around the same parameters. I’m skimming over a lot of details here, see &lt;a href=&quot;https://arxiv.org/abs/2111.04695&quot;&gt;the paper&lt;/a&gt; for details.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2023-05-09-qaoa-challenges/orqviz_plots.png#center&quot; alt=&quot;orqviz plot&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It’s pretty crazy if you think about it – we can take one graph, find good parameters for QAOA and just use them for another graph and it just works. For now this has been investigated only for simple types of problems and I don’t think this will hold for much bigger real-world problems, but it’s still an extremely interesting phenomenon to investigate. I think &lt;a href=&quot;https://link.aps.org/accepted/10.1103/PhysRevA.103.042612&quot;&gt;this paper by Jonathan Wurtz&lt;/a&gt; gives some insight on what might be going on, especially for 3-regular graphs.&lt;/p&gt;

&lt;h1 id=&quot;modified-cost-functions&quot;&gt;Modified cost functions&lt;/h1&gt;

&lt;p&gt;In many VQAs we are interested in calculating the expectation value of a particular operator. This is a very reasonable thing to do if the expectation value is what we’re looking after.
While using QAOA the expectation value corresponds to the value of the cost function. However, we don’t really care about the value of the cost function. Sure, it would be nice to get to the minimum, but its numerical value is usually not what we’re after. What we are after is the solution of our problem which gives us this low cost function value.&lt;/p&gt;

&lt;p&gt;Before we go further let’s revisit a basic question: how do we use quantum computers to calculate the expectation value?&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;We run a particular circuit and obtain a bitstring.&lt;/li&gt;
  &lt;li&gt;We use this bitstring to calculate the energy value based on some Hamiltonian.&lt;/li&gt;
  &lt;li&gt;And since quantum computers are probabilistic, we need to run it N times to get good statistics.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let’s imagine that we have an ansatz and two sets of parameters. Here are two tables, one shows the energy of each bistring and the other one the measurements we get when we run the circuits with those two sets of params:&lt;/p&gt;

&lt;style type=&quot;text/css&quot;&gt;
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
.tg .tg-0lax{text-align:left;vertical-align:top}
.center {
  margin-left: auto;
  margin-right: auto;
}

&lt;/style&gt;

&lt;table class=&quot;tg center&quot;&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;Energy&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;bitstring_1&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;10&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_2&lt;/span&gt;&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;1&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_3&lt;/span&gt;&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;0&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_4&lt;/span&gt;&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;1000&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;style type=&quot;text/css&quot;&gt;
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
.tg .tg-0lax{text-align:left;vertical-align:top}
.center {
  margin-left: auto;
  margin-right: auto;
}
&lt;/style&gt;

&lt;table class=&quot;tg center&quot;&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;bitstring_1&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_2&lt;/span&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_3&lt;/span&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_4&lt;/span&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;expectation value&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;params_1&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;900&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;100&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;9.1&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;params_2&lt;/span&gt;&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;900&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;100&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;900&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Which set of params is better?&lt;/p&gt;

&lt;p&gt;Well, if we just look at the expectation value, the first one is much better. But if we also look at the quality of the bitstrings we obtained – that’s a different story. Second set of parameters gives us bitstring_3. And bitstring_3 has the lowest energy value from all the bitstrings we’ve seen for this problem – perhaps it’s even the best possible solution to our problem? And, as we mentioned, in the optimization problems we are more interested in obtaining the best possible solution to our problem, rather than obtaining the best expectation value.&lt;/p&gt;

&lt;p&gt;The phenomenon we see here is a result of superposition. In the case of Ising Hamiltonians representing combinatorial optimization problems, there is a quantum state which gives you a particular bitstring (representing your solution) with 100% probability. But since we have superposition, we can have states which represent more than one solution at once (as seen above). This results in this somewhat unintuitive situation, where we have a state with higher expectation value which provides a much better solution than another state with lower expectation value. Can we do something about it? Sure we can!&lt;/p&gt;

&lt;p&gt;What if we simply discarded 50% percent of measurements with the highest cost value? This is how our table would look like:&lt;/p&gt;

&lt;style type=&quot;text/css&quot;&gt;
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
.tg .tg-0lax{text-align:left;vertical-align:top}
.center {
  margin-left: auto;
  margin-right: auto;
}
&lt;/style&gt;

&lt;table class=&quot;tg center&quot;&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;bitstring_1&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_2&lt;/span&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_3&lt;/span&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;bitstring_4&lt;/span&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0lax&quot;&gt;expectation value&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;params_1&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;400&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;100&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;8.2&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;&lt;span style=&quot;font-weight:400;font-style:normal;text-decoration:none&quot;&gt;params_2&lt;/span&gt;&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;500&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
    &lt;td class=&quot;tg-0lax&quot;&gt;0&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;
This technique is called CVaR and has been proposed by &lt;a href=&quot;https://quantum-journal.org/papers/q-2020-04-20-256/&quot;&gt;Barkoutsos et al.&lt;/a&gt;. It can also be applied to other VQAs, I recommend checking out the paper as it’s a really good read. Results  in &lt;a href=&quot;https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.023225&quot;&gt;this follow-up work&lt;/a&gt; suggests that CVaR is a must-have tool in anyone’s QAOA’s toolbox.
It’s worth mentioning that apart from CVaR, there is another method which works similarly, called “Gibbs Objective Function”. In this case the cost function is defined as:&lt;/p&gt;

\[f = - log(e^{-\eta E})\]

&lt;p&gt;By using such a cost function instead of a standard one, we increase the weight of the low-energy samples. The &lt;a href=&quot;https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.2.023074&quot;&gt;original paper by Li et al.&lt;/a&gt; provides a good intuition about how and why it works, so if you’re interested, I recommend reading section III of it.&lt;/p&gt;

&lt;h1 id=&quot;other-ansatzes&quot;&gt;Other ansatzes&lt;/h1&gt;

&lt;p&gt;One of the fundamental building blocks of VQAs is ansatz. We discussed its importance in detail in &lt;a href=&quot;/vqas-challenges.html&quot; target=&quot;_blank&quot;&gt;the post about VQAs&lt;/a&gt; and what are some considerations in using one versus another.&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;/Quantum-Approximate-Optimization-Algorithm-Explained.html&quot; target=&quot;_blank&quot;&gt;the first QAOA post&lt;/a&gt; we have described the most basic version of the ansatz for QAOA, let’s do a quick recap here.&lt;/p&gt;

&lt;p&gt;QAOA ansatz is generated by two Hamiltonians, summarized by the following table:&lt;/p&gt;

&lt;style type=&quot;text/css&quot;&gt;
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
.center {
  margin-left: auto;
  margin-right: auto;
}
&lt;/style&gt;

&lt;table class=&quot;tg center&quot;&gt;

&lt;thead&gt;
  &lt;tr&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;&lt;b&gt;H&lt;sub&gt;B&lt;/sub&gt;&lt;/b&gt;&lt;/th&gt;
    &lt;th class=&quot;tg-0pky&quot;&gt;&lt;b&gt;H&lt;sub&gt;C&lt;/sub&gt;&lt;/b&gt;&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;Associated with the angle beta&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;Associated with the angle gamma&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;Independent of the cost function&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;Is defined by the cost function&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;Called “Mixing Hamiltonian”&lt;/td&gt;
    &lt;td class=&quot;tg-0pky&quot;&gt;Called “Cost Hamiltonian”&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;QAOA creates the state: 
\(| \gamma, \beta \rangle = U(H_B, \beta_p) U(H_C, \gamma_p) … U(H_B, \beta_1) U(H_C, \gamma_1) | s \rangle\), where \(U(H_B, \beta) = e^{-i \beta H_B}\) and \(U(H_C, \gamma) = e^{-i \gamma H_C}\) and \(|s \rangle\) is the starting state.&lt;/p&gt;

&lt;p&gt;There can be a lot of variation in how you construct the circuit within this framework, here I will go through two of them: Warm-start QAOA ansatz and Hadfield’s QAOA.&lt;/p&gt;

&lt;p&gt;These are by no means the best possible ansatzes, but I think they show well how one can approach constructing new ansatzes.&lt;/p&gt;

&lt;h2 id=&quot;warm-start-qaoa&quot;&gt;Warm-start QAOA&lt;/h2&gt;

&lt;p&gt;In optimization we have a concept of “warm-starting” the optimization process. It happens when we use information from previous optimization runs to start with some reasonable initial parameters.
In QAOA we can use some classical optimization process to get some reasonable solutions. Then we can inject this information into our ansatz, which hopefully will work better now.
How does it work in practice?&lt;/p&gt;

&lt;p&gt;Let’s say we have a problem, for which the solution is a binary string, and a classical solver which can solve a “relaxed version” of this problem. “Relaxation” here means that instead of limiting ourselves to integers, our solution can contain any real number between 0 and 1. This is reasonable, as often continuous versions of a problem are simpler to solve than discrete ones. 
We denote our classical solution as \(|c|^*\) and based on this we construct a vector \(\theta\) for which every i-th element is defined as: \(\theta_i = 2 \arcsin{(\sqrt{c_i^*})}\). 
Now for the initial state we use state, where each qubit is set to \(|i \rangle = RY(\theta_i) |0 \rangle\). In this state the probability to measure given qubit in state \(|1 \rangle\) is equal to \(c_i^*\).
On top of that, we also modify the mixing Hamiltonian to the following form:&lt;/p&gt;

\[H_M^{ws} = \sum_{i=0}^{n-1} H_{M,i}^{ws}\]

&lt;p&gt;where&lt;/p&gt;

\[H_{M,i}^{ws} = -\sin{\theta_i} X - \cos{\theta_i} Z\]

&lt;p&gt;and \(X, Z\) are Pauli operators. This is easily implementable using \(R_Y\) and \(R_Z\) gates.&lt;/p&gt;

&lt;p&gt;There is a lot more to this, so if you’re interested I recommend &lt;a href=&quot;https://arxiv.org/abs/2009.10095&quot;&gt;Egger et al&lt;/a&gt; which shows how this basic idea can be extended and elaborate much more on why these choices have been made. Also, it’s worth noting that there are other approaches to warm-starting QAOA, such as &lt;a href=&quot;https://dl.acm.org/doi/10.1145/3549554&quot;&gt;Tate et al&lt;/a&gt; (and &lt;a href=&quot;https://arxiv.org/abs/2112.11354&quot;&gt;the follow-up work&lt;/a&gt;).&lt;/p&gt;

&lt;h2 id=&quot;quantum-alternating-operator-ansatz&quot;&gt;Quantum Alternating Operator Ansatz&lt;/h2&gt;

&lt;p&gt;This section is about the framework that was proposed by Stuard Hadfield (&lt;a href=&quot;https://academiccommons.columbia.edu/doi/10.7916/D8X650C9&quot;&gt;his thesis&lt;/a&gt; and &lt;a href=&quot;https://www.mdpi.com/1999-4893/12/2/34&quot;&gt;Hadfield et al.&lt;/a&gt;). I won’t go into too many technical details about it, as it’s described very well in there, with examples for specific problems and reasoning behind it.
Here I would like to just give you a general understanding of how this family of ansatzes work. As initially proposed, it was intended to be used with constrained problems (please read &lt;a href=&quot;#constraints&quot;&gt;the section about constraints&lt;/a&gt; first if you haven’t already).&lt;/p&gt;

&lt;p&gt;The main idea is as follows:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Start from a quantum state which represents a valid solution.&lt;/li&gt;
  &lt;li&gt;Use mixing Hamiltonian which allows you to evolve your state only within feasible subspace. Which means it transforms quantum states representing valid solutions into other quantum states representing other valid solutions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Therefore a circuit here is built from three elements:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Initial state – we need to start in a state which represents a feasible solution to the problem. Not the optimal one (this would pretty much kill the purpose), but just some which doesn’t violate any constraints. This can also be a superposition of multiple feasible states, which usually gives better results.&lt;/li&gt;
  &lt;li&gt;Mixing Hamiltonian – this Hamiltonian is responsible for changing the provided state. So it can be implemented in such a way, that we only allow for the operations that transform feasible states into feasible states. For example in the case of TSP this means having a Hamiltonian which represents list permutation. It also gives a more flexible framework for constructing these operators, as they no longer need to necessarily be exponentials of a single Hamiltonian, as in regular QAOA.&lt;/li&gt;
  &lt;li&gt;Cost Hamiltonian – this is our old good cost Hamiltonian, no changes here :)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As I’ve learned in some of my own projects, implementing an ansatz from this class can give you a significant boost in the quality of the results. However, it comes at a price – those circuits are usually deeper than the alternatives. Let’s discuss such tradeoffs in the next section!&lt;/p&gt;

&lt;h1 id=&quot;implementation-tradeoffs&quot;&gt;Implementation tradeoffs&lt;/h1&gt;

&lt;p&gt;As we discussed, solving a problem using QAOA requires making several decisions – how to formulate the problem, how to encode it into an Ising Hamiltonian, what ansatz to choose, which cost function to use, etc.&lt;/p&gt;

&lt;p&gt;Each of these comes at a certain cost – let’s look at the choice of the ansatz. When we consider different options it seems that Hadfield’s ansatz looks like a decent idea. However, it incurs some extra costs – first, we need to create the initial state. Depending on the particular case, it might be either easy and cheap (in terms of number of required gates) or very non-trivial, especially if we want to create a superposition of many feasible initial states. Another hurdle is implementing the mixing Hamiltonian. The standard “all-X” mixing Hamiltonian can be implemented by a single layer of RZ gates. On the other hand, some of the Hamiltonians proposed in the paper are pretty complicated and implementing them might require creating a circuit with hundreds of gates. Fortunately, the cost Hamiltonian will be the same most of the time.&lt;/p&gt;

&lt;p&gt;Let’s say that for the particular problem that we want to solve, the circuit using Hadfield’s ansatz is 10x longer than the basic one. This means that it will run 10x longer. Can this be even worth it?
Well, it might turn out that our ansatz gives us the correct answer with 10% probability, while using vanilla ansatz it would be 0.1%. So even though we need 10x more time to run our circuit, we need to run it only 100 times, to get 10 good samples, while with the basic version, we would need to run it 10000 times. Therefore, using a more expensive ansatz would still give us an order of magnitude improvement in the runtime.&lt;/p&gt;

&lt;p&gt;Obviously, this is an overly simplified toy example – in the real case the analysis would be much, much more difficult to do – we would need to model how different circuits are susceptible to noise, try to estimate how fast the optimization of the parameters converges in various cases etc. Taking all of those factors and various combinations into account is impossible and requires extensive experimentation to come up with the set of methods that will be appropriate for solving the problem at hand.&lt;/p&gt;

&lt;p&gt;However, certain calculations can be done relatively quickly – for example, if we have some theory to back up a claim that a particular method would require getting 1000 more samples than another one, or if one circuit is 1000x longer than the other one, we can probably rule them out, cause it’s unlikely, they will yield enough benefits, given that they already have 3 orders of magnitude longer runtime. Therefore, it’s always good to look critically at the methods we plan to use – even if it’s not possible to get the precise numbers, we might still get some good insight about the tradeoffs.&lt;/p&gt;

&lt;h1 id=&quot;parameter-initialization&quot;&gt;Parameter initialization&lt;/h1&gt;

&lt;p&gt;Imagine two people are looking for treasure on an island. One is a 9 years old girl with a broken leg, walking with crutches. The other one is a 30-years old commando who spends two months a year on survival trips to the Amazon jungle. They both have the same map to the treasure and both start the treasure hunt from different places on the map.&lt;/p&gt;

&lt;p&gt;Who is more likely to win?&lt;/p&gt;

&lt;p&gt;Well, I wouldn’t bet too much on a girl.&lt;/p&gt;

&lt;p&gt;However, what if I told you that the girl was lucky enough to start 10 meters away from the treasure chest, while the guy starts on the opposite side of the island, behind 2 rivers and an active volcano?&lt;/p&gt;

&lt;p&gt;This changes the picture.&lt;/p&gt;

&lt;p&gt;It’s similar to optimization – you will spend much less time looking for optimal parameters if the initial parameters are close to optimal. And starting from a bad place will make things so much harder for you. Since VQAs are all about finding optimal parameters for a given problem, it’s no surprise that people spend a lot of time trying to find a way for good parameter initialization.&lt;/p&gt;

&lt;p&gt;Here I will cover a couple of methods for parameter initialization – layer-by-layer optimization (LBL), INTERP and schedules. One thing before we start – even though I call them “parameter initializations” strategies, they are sometimes tightly related to the optimization process.&lt;/p&gt;

&lt;p&gt;The simplest one is LBL – here we start from a small number of layers which is easy to optimize due to the small number of parameters. Once we have found optimal params, we keep them, add a new layer, initialize it with random parms and repeat the process. And again, and again until we reach our target number of layers. 
There are different variants of this approach, but you can see that it’s pretty resource-intensive, as we have to basically run about N optimization loops, where N is the target number of layers.&lt;/p&gt;

&lt;p&gt;This has been improved by introducing a method called INTERP. It’s based on the observation that gammas and betas seem to increase monotonically (see fig. 2 from &lt;a href=&quot;https://journals.aps.org/prx/abstract/10.1103/PhysRevX.10.021067&quot;&gt;Zhou et al.&lt;/a&gt;). Therefore, we don’t have to initialize the new layer randomly – if we have good parameters for layer N-1, we can predict what would be good parameters for N, tune all the params a little bit and repeat the process.  This can be done using a straightforward interpolation, but the authors also suggested a more sophisticated method called “FOURIER” – I recommend reading the original paper, it’s extremely interesting. There is also &lt;a href=&quot;https://arxiv.org/abs/2209.01159&quot;&gt;a recent work by Sack et al&lt;/a&gt;, which provides some more theoretical background and intuition why and how INTERP works.&lt;/p&gt;

&lt;p&gt;Methods like this will work well for a relatively small number of layers, but what if we talk about the future where we could have thousands of layers? It turns out that in this limit we might be able to get decent results by using something called “schedules”. In &lt;a href=&quot;https://arxiv.org/abs/2108.13056&quot;&gt;this paper&lt;/a&gt; the authors decided that they’ll choose values for betas and gammas defined by: \(\gamma(f) = \Delta f\) and \(\beta(f) = (1- \Delta) f\). Here \(f\) has values from 0 to 1 and for a case with a total of \(p\) layers, we substitute \(f\) with \(f_j = \frac{j}{p+1}\) for a \(j\)-th layer. \(\Delta\) is a free parameter we need to pick ourselves. Therefore schedule is basically a curve from which we take our parameters. This work by &lt;a href=&quot;https://quantum-journal.org/papers/q-2021-07-01-491/&quot;&gt;Sack and Serbyn&lt;/a&gt; also discusses similar ideas.&lt;/p&gt;

&lt;p&gt;I like how these methods fit together – we’ve seen in the INTERP paper that the parameters change monotonically, so why not just make a simple assumption that the change is linear and see where it leads us? Since finding optimal parameters is an extremely computationally expensive problem, it would be great if using schedules like this (or more involved) would spare us optimizing parameters or provide us with really good initial params. But to see how this will play out in practice, I think we need to start running more of these on real devices.&lt;/p&gt;

&lt;h1 id=&quot;closing-notes&quot;&gt;Closing notes&lt;/h1&gt;

&lt;p&gt;There are a lot of other developments in the QAOA space. &lt;a href=&quot;https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.125.260505&quot;&gt;RQAOA&lt;/a&gt;, &lt;a href=&quot;https://arxiv.org/abs/2109.11455&quot;&gt;Multi-angle QAOA&lt;/a&gt;  and &lt;a href=&quot;https://arxiv.org/abs/2005.10258&quot;&gt;ADAPT-QAOA&lt;/a&gt; to name a few. However, if I tried to cover all these topics, this would soon become a review paper and not a blogpost, so I had to stop somewhere :)&lt;/p&gt;

&lt;p&gt;I hope you found this blogpost helpful in understanding some more advanced concepts around QAOA and now it will be easier for you to explore these concepts by yourself.&lt;/p&gt;

&lt;p&gt;And of course, I wanted to thank to people that helped me with writing this blogpost, namely:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Matt Kowalsky&lt;/li&gt;
  &lt;li&gt;Stuart Hadfield&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since this is the last blogpost in my series about variational quantum algorithms, I just wanted to say that I’m really grateful for all the positive feedback I got from various people who read these articles over the years. When I started writing it 3.5 years ago, I didn’t know it would take me so long to finish it. But here we are! Thank you for joining me on this VQA journey, I learned a lot in the process and I hope you did as well. You can  find &lt;a href=&quot;https://arxiv.org/abs/2402.15879&quot;&gt;a PDF-version of the whole series on arXiv&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And if you want to know about other projects I’ll be working on, please &lt;a href=&quot;https://mailchi.mp/eaffe4a3a59a/mustythoughts&quot; target=&quot;_blank&quot;&gt;subscribe for the newsletter&lt;/a&gt; :) I have one cool paper on QAOA coming out very soon and some good content about quantum software.&lt;/p&gt;

&lt;p&gt;Have a nice day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
Footnotes:&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;In practice, tuning the values of the penalties constants might be a significant problem in itself. Too small and it doesn’t serve its function. Too high and it might lead the optimizer to behave in unexpected ways. Not to mention interplay between multiple penalties! &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;It also shows how to map real functions to Ising Hamiltonians – something I didn’t know is possible and find it pretty cool! &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;If you are not familiar with it, you can find an explanation &lt;a href=&quot;https://en.wikipedia.org/wiki/Travelling_salesman_problem&quot;&gt;on wiki&lt;/a&gt;. &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:4&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;3-regular means that each node connects to exactly three other nodes. So each node has exactly 3 neighbours. &lt;a href=&quot;#fnref:4&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Tue, 09 May 2023 10:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/qaoa-challenges.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/qaoa-challenges.html</guid>
			</item>
		
			<item>
				<title>Perfect Quantum Resource Estimation Software</title>
				<description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;For over a year now I’ve been working on software to do resource estimation (RE) for fault tolerant quantum computation (FTQC). I’ve been working on this as a part of &lt;a href=&quot;https://www.darpa.mil/program/quantum-benchmarking&quot;&gt;the Quantum Benchmarking program funded by DARPA&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Being part of this program was an amazing experience, I had an opportunity to work with many great people from all around the world. But this is a story for another time.&lt;/p&gt;

&lt;p&gt;In this post I wanted to summarize my thoughts on what would make an &lt;strong&gt;ideal software for resource estimation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Notes before we start:
I’ll use “QRE” as shorthand for “Quantum Resource Estimation”. And by “quantum” here I really mean FTQC – nothing I’ll write about has anything to do with NISQ. It might apply, but it’s never my intent.
This post is not an introduction to QRE. It’s targeted at people who are working on QRE or related topic and are already familiar with some parts of the stack we’ll be using here. But even so – if you’ll get lost at any point, please let me know in the comments!
There are a few tools for resource estimation out there already – &lt;a href=&quot;https://learn.microsoft.com/en-us/azure/quantum/intro-to-resource-estimation&quot;&gt;Azure QRE&lt;/a&gt; or &lt;a href=&quot;https://github.com/quantumlib/OpenFermion/tree/master/src/openfermion/resource_estimates&quot;&gt;resource estimation module in OpenFermion&lt;/a&gt;. They have some of the characteristics of “my dream QRE tool”, but not the others.I won’t mention them anywhere in the text, as I haven’t worked with them enough to be able to do them justice. However, if you’re interested in the topic and haven’t seen them yet, absolutely please check them out :)&lt;/p&gt;

&lt;p&gt;Ok, so let’s start!&lt;/p&gt;

&lt;h1 id=&quot;what-is-qre-and-why-is-it-hard&quot;&gt;What is QRE and why is it hard?&lt;/h1&gt;

&lt;p&gt;Let’s start by briefly explaining what do we mean by QRE? Let’s say you want to know how long it will take to run an algorithm which solves a certain problem on a quantum computer.&lt;/p&gt;

&lt;p&gt;I’ll start by making a horrible oversimplification, which sweeps under a rug A TON of problems – you already have a quantum circuit that you want to run on your quantum computer. What to do about it?&lt;/p&gt;

&lt;p&gt;Well, since we need to account for error correction overhead, this is not as simple as calculating the depth of the circuit and then multiplying it by gate time. You need to understand how this circuit would be implemented on a real quantum computer, which might require the following reasoning (in the Q&amp;amp;A format):&lt;/p&gt;

&lt;p&gt;Q: What gates do I have in my circuit?&lt;/p&gt;

&lt;p&gt;A: I have Clifford gates and Pauli rotations&lt;/p&gt;

&lt;p&gt;Q: Are these gates something that my error correction method can directly use?&lt;/p&gt;

&lt;p&gt;A: Method I’m using can handle only Clifford+T gates, so we need to do something about rotations.&lt;/p&gt;

&lt;p&gt;Q: What can I do about rotations?&lt;/p&gt;

&lt;p&gt;A: You can either translate each rotation into a sequence of Clifford + T (i.e. gate synthesis), or estimate how many T gates each rotation gate will translate to.&lt;/p&gt;

&lt;p&gt;Q: Let’s say we can compile it to Clifford+T. What resources do we even want to estimate?&lt;/p&gt;

&lt;p&gt;A: Let’s estimate how much time the calculation will take and how many physical qubits it will take.&lt;/p&gt;

&lt;p&gt;Q: Don’t these numbers depend on the characteristics of the physical hardware? For example gate time and gate fidelity?&lt;/p&gt;

&lt;p&gt;A: That’s true – we can model the hardware by parameterizing these quantities.&lt;/p&gt;

&lt;p&gt;Q: Do we want to distinguish between one-qubit gates and two-qubit gates?&lt;/p&gt;

&lt;p&gt;A: For now we can treat them the same.&lt;/p&gt;

&lt;p&gt;Q: Ok, how much does it take to implement each gate in a fault tolerant way?&lt;/p&gt;

&lt;p&gt;A: It depends on the type of the gate and the failure rate of the whole circuit we want to achieve. You can never have a 0% failure rate, even on classical computers. So you need to specify what failure rate you’re willing to tolerate. In the surface code, for example, you can achieve a lower failure rate by increasing the code distance.&lt;/p&gt;

&lt;p&gt;Q: Let’s assume we know the target failure rate. What resources are needed for each gate?&lt;/p&gt;

&lt;p&gt;A: Each T gate might require thousands of Clifford gates itself, so as a first approximation we can cost out just them…&lt;/p&gt;

&lt;p&gt;Let’s finish it here, as I really don’t want to spend this time getting into the details of how to build a T-gate factory. And how to implement this with the surface code. And how to calculate resources for it. And how those resources depend on the parameters of the hardware (quality of qubits, connectivity, architecture…). And how to take the decoding process into account. And that you can get other resources, such as energy needed or the physical area of the machine you need. Oh, not to mention dealing with space-time tradeoffs…&lt;/p&gt;

&lt;p&gt;The main points I’ve tried to make are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;When trying to perform resource estimation, there are a huge number of considerations and assumptions that go into making a particular estimate.&lt;/li&gt;
  &lt;li&gt;Some of the assumptions depend on the compilation you’re using, some on the fault-tolerant protocols you’re considering, some on the hardware and some others depend on how accurate you want to be.&lt;/li&gt;
  &lt;li&gt;It’s pretty complex.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Final note – I’m not super happy about the section that you’ve just read. But I really don’t have time to write a 3-part blogpost explaining all the nuances in detail right now, so I’ll just leave it as it is.&lt;/p&gt;

&lt;p&gt;Ok, let’s now talk about how these translate into challenges for building a software that performs all of this automatically.&lt;/p&gt;

&lt;h1 id=&quot;main-challenges&quot;&gt;Main challenges&lt;/h1&gt;

&lt;p&gt;My focus is on challenges on the software level – not what makes QRE hard in general, but what makes it hard to write software for QRE.&lt;/p&gt;

&lt;h2 id=&quot;many-assumptions&quot;&gt;Many assumptions&lt;/h2&gt;

&lt;p&gt;Performing resource estimates comes with many assumptions about the future hardware. The problem is that some of the assumptions might turn out to be incorrect in the future, so you don’t want to hardcode too many of them. Sometimes it’s hard to say what is an assumption and what is not, as some assumptions are not really being stated explicitly (e.g.: “we use surface codes” or “Clifford gates are cheap”). It’s unreasonable to write software without making any kind of assumptions, but managing them is a big challenge in QRE.&lt;/p&gt;

&lt;h2 id=&quot;science-is-changing&quot;&gt;Science is changing&lt;/h2&gt;

&lt;p&gt;QRE as a subfield of quantum computing is a relatively young and small niche, which touches on many adjacent subfields (such as quantum algorithms, compilation, error correction, quantum hardware), all of which are developing rapidly. This means that every year there are many new improvements, algorithms and breakthroughs being made and it’s hard to keep up or have expertise in all of them.
It’s very, very hard to find people who have a good, holistic understanding of all the concepts involved  – I guess it’s under 100 people in the world, and that might be generous already. Therefore there are not many learning materials on the topic and good knowledge is very scarce. Fortunately it’s easier to find people who have deep understanding on particular parts of the QRE pipeline, but still – this knowledge is very specialized.&lt;/p&gt;

&lt;p&gt;Another issue is that there’s no well-established language. It’s common that across many groups people use different words for the same thing or one word has different meaning for each group. This is typical for QC in general and I’ve been complaining about it for years, but it is definitely more acute when it comes to QRE because doing it properly requires input from each group.&lt;/p&gt;

&lt;p&gt;A couple of mundane examples of why it makes writing software harder:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;we had too many meetings where it took us up to an hour to just understand that we’re talking about two things that were similar, but distinct in important ways. Both sides used the same word for it.&lt;/li&gt;
  &lt;li&gt;imagine how the code looks like after you rename each variable 3 times…&lt;/li&gt;
  &lt;li&gt;I think I’ve never worked on a project that had such a steep learning curve – onboarding new people to the project was taking a lot of time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;ill-defined-abstractions&quot;&gt;Ill-defined abstractions&lt;/h2&gt;

&lt;p&gt;This one is a derivative of the previous point, but it’s particularly problematic when it comes to writing software, so I think it’s worth discussing it separately.
In order to do resource estimation you’ll have to go through multiple layers of abstractions (e.g.: quantum algorithms, quantum subroutines,  arbitrary logical circuit, transpiled logical circuit (e.g.: Clifford+T), error correction codes, logical qubits, physical qubits). Many of these abstraction layers are neither well defined nor is there common software describing them. It’s also not entirely clear what’s the coupling between all of them, as they seem to be distinct on the paper, until you start writing code. And then it turns out that you actually need to exchange information between them, the boundary is fuzzy and as a cherry on the top, there are some feedback loops.&lt;/p&gt;

&lt;p&gt;I’ve been working on designing software abstractions for quantum computing for a couple of years now, and every single time getting it right takes months (if not years) from the first prototypes to actually making things run smoothly. Creating software is an iterative process after all, and since some of the ideas really live only in scientific papers or people’s heads, putting them into code properly is really challenging.&lt;/p&gt;

&lt;h1 id=&quot;target-group&quot;&gt;Target group&lt;/h1&gt;

&lt;p&gt;Given how important the topic is and how many parts of the quantum computing stack it spans, it’s no surprise that there are many potential users of such software. Let’s take a look at who they are and why they are interested in it.&lt;/p&gt;

&lt;h2 id=&quot;decision-makers&quot;&gt;Decision makers&lt;/h2&gt;

&lt;p&gt;This group contains people who need to make strategic decisions about investing their time and money in quantum computing, when they can expect it to be useful and for what type of problems. They might need to decide, for example, “which quantum computing hardware do I invest in?”&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;They want reliable numbers, but are not necessarily able to check their correctness – they need to trust the software.&lt;/li&gt;
  &lt;li&gt;They care mostly about solving a particular problem – an “application instance”.&lt;/li&gt;
  &lt;li&gt;They don’t care what algorithm or particular error correction method has been used.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;application-scientists--algorithm-researchers&quot;&gt;Application scientists / algorithm researchers&lt;/h2&gt;

&lt;p&gt;These are people who are researchers, but do not specialize in error correction, compilation or any of these. They want to solve a particular problem or design a new algorithm and they want to make sure that it uses a reasonable amount of resources.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;They want something that’s fast, as they use this tool to get feedback and iterate.&lt;/li&gt;
  &lt;li&gt;Tool will be integrated into their current workflow, so it needs to be easy to integrate with.&lt;/li&gt;
  &lt;li&gt;They might use the tool as a profiler, so it would need to have good visualization capabilities.
While not being an expert, they might be knowledgeable about various tradeoffs present in the system, so they want to be able to play with various parameters much more than the previous group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As an example, of this type of usage Microsoft recently posted a &lt;a href=&quot;https://cloudblogs.microsoft.com/quantum/2022/09/15/using-q-to-estimate-resources-needed-for-quantum-advantage-in-derivative-pricing/&quot;&gt;blog post&lt;/a&gt; where Goldman Sachs researchers used their resource estimation tool in this way.&lt;/p&gt;

&lt;h2 id=&quot;resource-estimation-related-researchers&quot;&gt;Resource-estimation-related researchers&lt;/h2&gt;

&lt;p&gt;This is a group whose main interests intersect with how the resource estimation pipeline works &lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. They want to see how it works, they want to tinker with it and they want to test their own ideas and see if they improve the performance of the system.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;They don’t want to use the tool to get the final results. They want to use it as a way to improve their own research.&lt;/li&gt;
  &lt;li&gt;They are potential contributors to the tool.&lt;/li&gt;
  &lt;li&gt;They will try to break the system and prove that it actually doesn’t work as well as you claim it works. In the end they’re scientists at heart, right? ;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;hardware-providers&quot;&gt;Hardware providers&lt;/h2&gt;

&lt;p&gt;Hardware providers are also interested in this kind of tools, as it allows them to model how changes in their architecture impact the capacity to solve utility scale problems.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;They need to be able to use sophisticated models of the hardware in conjunction with the resource estimation tools.&lt;/li&gt;
  &lt;li&gt;Given how many different hardware modalities are there, they might need a lot of flexibility when it comes to manipulating assumptions. For example, the assumption “a quantum computer is just a huge grid of qubits connected to their nearest neighbors” might not allow certain hardware developers to make progress.&lt;/li&gt;
  &lt;li&gt;They might be interested in estimating resources much different than the other users – amount of materials needed to build, amount of power needed for specific components, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;ideal-resource-estimation-software&quot;&gt;Ideal resource estimation software&lt;/h1&gt;

&lt;p&gt;Given all these, let’s get back to the question – what should be the characteristics of the ideal resource estimation software?
To put it differently – if I had a team of 100 people and 5 years to build it, how would I build it?&lt;/p&gt;

&lt;h2 id=&quot;modularity&quot;&gt;Modularity&lt;/h2&gt;

&lt;p&gt;I think such software should be modular as hell! In order to deal with multiple, constantly changing assumptions, you need to have a very modular system.
It would be lovely if the modules were all independent software packages which can serve their purpose without relying on other modules, but I think that’s too much to ask, as I don’t think it’s possible to escape some coupling.&lt;/p&gt;

&lt;p&gt;Modularity itself is not enough though, it also needs to have well established interfaces, so one can plug-in those modules. This way you can tame the proliferation of the assumptions, as you can always check which assumptions have been used by just inspecting what was the input data and which modules were used for computation.&lt;/p&gt;

&lt;h2 id=&quot;future-compilation-chain&quot;&gt;Future compilation chain&lt;/h2&gt;

&lt;p&gt;I think that a resource estimation system of today should be the compilation toolchain of tomorrow.&lt;/p&gt;

&lt;p&gt;In order to run something on a quantum computer, we will have to compile the “high level algorithm” into some “quantum machine code”. There’s no doubt about that. 
Machine code would be a source of truth about executing a given program – the only thing that will allow us to have a more precise view of how much resources would the execution take is the execution itself.&lt;/p&gt;

&lt;p&gt;So “in the limit”, if we had a resource estimator that work on the machine code level, we could compile everything to the machine code and then we would have perfect resource estimates – beautiful! Even better – such an approach would allow us to take advantage of various hardware-level optimizations, which are not possible when we’re operating on a more abstract level.
However, this introduces a whole host of technical difficulties and is definitely not very practical in the short term. It would be overly complex and resource intensive, not to mention that we don’t really even have a good idea of how such machine code would look like&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;Still, I think striving for this is a useful approach, as it forces you to make the resource estimates more realistic.&lt;/p&gt;

&lt;p&gt;This approach stands in opposition to what we internally call “footprint analysis” – i.e. an approach where you only count the number of T gates, see how much “footprint” each T gate has (in terms of space and time) and then calculate the resources based on that. I think both approaches have pros and cons, but I believe in the long run the more detailed one will turn out to be more useful.&lt;/p&gt;

&lt;h2 id=&quot;well-defined-abstraction-layers&quot;&gt;Well defined abstraction layers&lt;/h2&gt;

&lt;p&gt;I think that it’s impossible to build a system which is modular and flexible without defining what are the abstraction layers, what are the basic data structures and interfaces and how they interact.
Today abstractions all float around the concept of “quantum circuit”, and this is not a good abstraction for multiple reasons (see: &lt;a href=&quot;/beyond-circuits.html&quot; target=&quot;_blank&quot;&gt;my previous post&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;We need both better higher level abstractions (quantum programming languages really) and lower level abstractions.&lt;/p&gt;

&lt;h2 id=&quot;multiple-entrypoints&quot;&gt;Multiple entrypoints&lt;/h2&gt;

&lt;p&gt;As mentioned before, different users have different needs and different goals. Therefore, we would need to allow different users to use it differently.&lt;/p&gt;

&lt;p&gt;Non-quantum domain experts don’t want to deal with details of specifying quantum algorithms. They want to know how long it will take for a quantum computer to perform simulation of the dynamics of a particular molecule. So they should be able to specify what molecule they care about, what properties and what they want to do with it (e.g.: find ground state, excited state, or just evolve it over time).&lt;/p&gt;

&lt;p&gt;Quantum algorithm researchers might want to work at the level of an algorithm, see how costly different pieces of the algorithm are in practice and how to optimize them to get better results.&lt;/p&gt;

&lt;p&gt;Compilation researchers might totally not care about the problem they are solving – they just want to know if their particular new compilation technique works well across a wide range of algorithms.&lt;/p&gt;

&lt;p&gt;It might be similar for hardware providers – they would care most whether their hardware is modeled accurately in the software and less about the choice of the active spaces that’s used in order to prepare the molecule’s Hamiltonian.&lt;/p&gt;

&lt;p&gt;I think it’s also important that such software would have a library of “ready-to-go” components that new users can immediately start experimenting with. Some high-level instances, some algorithms, some hardware models etc.&lt;/p&gt;

&lt;h2 id=&quot;high-quality-results&quot;&gt;High quality results.&lt;/h2&gt;

&lt;p&gt;The numbers that we get at the end of the resource estimation process need to have a couple of qualities.&lt;/p&gt;

&lt;p&gt;First, they need to be correct – i.e. we want to make sure that the formulas we’re using to obtain them are correct and that there were no mistakes in how they have been calculated.&lt;/p&gt;

&lt;p&gt;Second, we want them to be realistic – it’s great that we have a number which has been calculated correctly. However, if it came from using unrealistic assumptions, it doesn’t really provide much value. And believe me, making sure your assumptions are realistic is by no means simple.&lt;/p&gt;

&lt;p&gt;Third, we want them to be optimized – it’s nice that we got some numbers using realistic assumptions. However, realistic assumptions don’t ensure that we have optimized different parts of our system. Perhaps we used an old algorithm for gate synthesis and we have an unnecessarily high T-gate count? Or we didn’t make use of the fact that qubits have all-to-all connectivity and we just assumed nearest neighbors? Well, it’s not “incorrect” to do that, but it leaves a lot of room on the table for getting even lower numbers once you optimize things like this.&lt;/p&gt;

&lt;p&gt;Fourth – I want my dream QRE software to produce numbers which have error bars. Error bars are important!&lt;/p&gt;

&lt;h2 id=&quot;scalability&quot;&gt;Scalability&lt;/h2&gt;

&lt;p&gt;At some point the scale of the calculation cannot be done on your laptop, the problem size just gets too big. In such a case, I’d love to be able to seamlessly switch to some distributed computing system that handles all the scaling for me.&lt;/p&gt;

&lt;p&gt;I might be biased, but it sounds like a perfect usecase for the &lt;a href=&quot;https://www.orquestra.io&quot;&gt;Orquestra platform&lt;/a&gt; that’s being built at Zapata…&lt;/p&gt;

&lt;h2 id=&quot;visualization&quot;&gt;Visualization&lt;/h2&gt;

&lt;p&gt;I think that the software should have some good way of visualizing the outputs. Different things might be important for different types of users, e.g.:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Showing how many resources each part of the algorithm uses.&lt;/li&gt;
  &lt;li&gt;Plotting multiple problem instances on one chart to see how various resources scale with changing size of the problem or target accuracy.&lt;/li&gt;
  &lt;li&gt;I could even imagine visualization for a given hardware model which would show which parts of the hardware has been underutilized, which might hint at where it can be further optimized.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’m a big believer in good visualization making making huge difference, so I really think this shouldn’t be overlooked!&lt;/p&gt;

&lt;h2 id=&quot;hosting&quot;&gt;Hosting&lt;/h2&gt;

&lt;p&gt;I think that the system like this should be available in at least a couple of flavors – again, this will allow to meet needs of different users.&lt;/p&gt;

&lt;p&gt;Standalone library – I think plenty of researchers and developers will prefer to like to play with such tool locally at first. It’s just so much more convenient to test things on your own machine.&lt;/p&gt;

&lt;p&gt;Rest API – on the other hand, there are plenty of scenarios, where you might want to have access to an easy to use API. It allows to offload some of the calculations to external server and makes it easy to integrate with certain services.&lt;/p&gt;

&lt;p&gt;Web App – I think for the most high-level users a web app with an intuitive interface is something that would fit their needs best. No installation, easy access, no need to see what’s inside.&lt;/p&gt;

&lt;h2 id=&quot;open-source&quot;&gt;Open-source&lt;/h2&gt;

&lt;p&gt;Damn, I just believe in open-source, so if this is my list I’ll just throw it in ;)&lt;/p&gt;

&lt;p&gt;But more seriously – obviously various organizations will have different concerns about open-source so it’s not that simple. 
But apart from all the benefits and challenges associated with OSS, here are some points that are particularly important in this area:&lt;/p&gt;

&lt;p&gt;Reliability – the problem is quite complex. Therefore, the transparency and the ability to inspect the code and let the users find potential issues is really important in this case. Especially if your users are world-class experts.
Easier to collaborate – if there are 20 people in the world who understand a particular algorithm you’re using (most probably based on one of their old papers in one way or another), then it will be great if you discuss it with them. Much easier with OSS.&lt;/p&gt;

&lt;p&gt;Obviously, not all parts of the system make sense to be open-source for every player. For example, the hardware providers might very much not like to make detailed models of their hardware public.
However, I still think that an “open-core” model would be the best approach. I believe things such as:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;interfaces&lt;/li&gt;
  &lt;li&gt;datastructures&lt;/li&gt;
  &lt;li&gt;basic flow&lt;/li&gt;
  &lt;li&gt;API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;should be open, as they will make it easier for various people to cooperate and integrate with the system, while specific implementations of some of the interfaces can well be closed-source proprietary black boxes.&lt;/p&gt;

&lt;h2 id=&quot;well-documented&quot;&gt;Well documented&lt;/h2&gt;

&lt;p&gt;This one’s pretty obvious. Things just need to be well documented and given the complexity it needs to have multiple layers of documentation:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Very basic “intro to the topic” tutorials&lt;/li&gt;
  &lt;li&gt;Code examples for the most common use cases&lt;/li&gt;
  &lt;li&gt;Deep scientific dives explaining in details the methods being used&lt;/li&gt;
  &lt;li&gt;API docs&lt;/li&gt;
  &lt;li&gt;Probably many others I didn’t think about at the moment ;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;well-tested&quot;&gt;Well tested&lt;/h2&gt;

&lt;p&gt;It goes without saying, but a system like this needs to be well tested. And with different modes of testing – unit tests, end-to-end tests, integration tests, performance tests.&lt;/p&gt;

&lt;h1 id=&quot;benchq&quot;&gt;BenchQ&lt;/h1&gt;

&lt;p&gt;I think it’s not surprising that the reason why I have so many thoughts on the topic is because for more than a year I’ve been developing such software. It’s called BenchQ and we’ve been developing it at Zapata in collaboration with people from University of Technology Sydney, Aalto University, University of Texas at Dallas, Keio University, IonQ and Rigetti Computing. This has been done as a part of the &lt;a href=&quot;https://www.darpa.mil/program/quantum-benchmarking&quot;&gt;DARPA’s Quantum Benchmarking program&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We tried to get a lot of the points that I listed above right. However, since in real life there are plenty of constraints, it doesn’t fit perfectly into the picture I’ve just painted. If anyone is interested in learning more, please let me know in the comments – I could write a “case-study” blogpost where I show how various design choices we made fit into the framework above.&lt;/p&gt;

&lt;p&gt;If you’re interested, please feel free to try it out, as it’s open-source: &lt;a href=&quot;https://github.com/zapatacomputing/benchq&quot;&gt;benchq&lt;/a&gt;. It’s still very much in development, not very well documented, so please don’t be too harsh – rather create a GitHub issue or contact the developers&lt;sup id=&quot;fnref:3&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;h2 id=&quot;closing-notes&quot;&gt;Closing notes&lt;/h2&gt;

&lt;p&gt;I hope that someone managed to get through this wall of text :)&lt;/p&gt;

&lt;p&gt;Huge thanks to Peter Johnson, who reviewed this post on an extremely short notice. And who is the most brilliant, most awesome and most handsome PI that this program ever had or ever will have ;) 
And also to everyone we worked with on in this project, definitely one of the most intense learning experiences in my career so far! Unfortunately that’s too many people to list here.&lt;/p&gt;

&lt;p&gt;Have a wonderful day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;p&gt;Footnotes:&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;This includes specialties such as error correction, compilation, decoding, etc. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Perhaps some people do! Though I really think we’re not there yet. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Since I’m no longer involved in this project, no point in contacting me, cause I’ll redirect you to other people anyway :) &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Sun, 30 Apr 2023 17:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/perfect-qre-sw.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/perfect-qre-sw.html</guid>
			</item>
		
			<item>
				<title>Let's move beyond circuits</title>
				<description>&lt;h1 id=&quot;lets-move-beyond-circuits&quot;&gt;Let’s move beyond circuits!&lt;/h1&gt;

&lt;p&gt;Last week I attended IEEE Quantum Week conference in Colorado. Out of all the wonderful conversations, presentations and discussions, there is one thought that felt particularly important, which I encapsulated in this tweet:&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Before Quantum Week:&lt;br /&gt;&amp;quot;I have this idea, that perhaps circuits are not a good abstraction for QC. Maybe I&amp;#39;m wrong I hope it&amp;#39;s not too controversial.&amp;quot;&lt;br /&gt;After Quantum Week:&lt;br /&gt;&amp;quot;Hell yeah, circuits are terrible! Everyone thinks so, let&amp;#39;s figure out something better!&amp;quot;&lt;/p&gt;&amp;mdash; Michał Stęchły (@mstechly) &lt;a href=&quot;https://twitter.com/mstechly/status/1573034502137552897?ref_src=twsrc%5Etfw&quot;&gt;September 22, 2022&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;There was some discussion in the comments and obviously Twitter is not best place for having a nuanced discussion, so let me write explain where does it come from.&lt;/p&gt;

&lt;p&gt;Before we start, I want to make a couple of things clear: contrary to most of my blogposts, this one is a hot take. I’m writing it as I sit on the airport and airplane back from the conference, trying to give some structure to the thoughts I have. I’m probably wrong about a lot of things. I’m no expert in compilation, I don’t understand how hardware operates, my quantum information knowledge is pretty rudimentary. I have not researched yet what are the alternatives, who else worked on some solutions to this and what that could possibly be.&lt;/p&gt;

&lt;p&gt;But I am a software engineer (doing some research on the side), who tries to create better tools for people to interface with quantum computers. I think a lot about abstractions, interfaces, integrations and this is where I’m coming from – the “algorithms development”, “software tools” and “QC applications” part of the stack. I want to get this out while it’s still fresh in my mind to keep the momentum going – as I feel there’s a lot of momentum in the community to push this topic forward.&lt;/p&gt;

&lt;p&gt;I cannot acknowledge all the people who contributed to this blogpost through the discussions, as I have talked with so many people about it. However, I need to make one exception – huge kudos to Yuval Sanders. We started talking about related issues months ago and all the discussions with him were eye-opening!&lt;/p&gt;

&lt;p&gt;OK, after this overly lengthy introduction, let’s get into the details.&lt;/p&gt;

&lt;h1 id=&quot;problems-with-circuits&quot;&gt;Problems with circuits&lt;/h1&gt;
&lt;p&gt;The problems stated below are in no particular order.&lt;/p&gt;

&lt;h2 id=&quot;problem-1--expressivity&quot;&gt;Problem 1 – expressivity&lt;/h2&gt;

&lt;p&gt;Let’s say I want to start my algorithm from a state that’s equal superposition of all possible states. How do I do that? I put Hadamard gates at the beginning of my circuit.
Ok, now let’s say I want to change the basis in which I measure from Z to X&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. What do I do? I put Hadamard gates at the end of my circuit!&lt;/p&gt;

&lt;p&gt;So when someone looks at my circuit and they see “H”, this could mean a lot of different things. The fact that you use Hadamards to create equal superposition, should be an implementation detail, not how you express your intent. You can argue that most of the time it’s obvious from the context what author meant. But that’s true only if you have significant amount of experience, and you can “read between the lines”. This definitely creates a barrier (not a huge one, but still) for new people and adds unnecessary cognitive load for everyone. In the end, my intention is not to use a Hadamard gate. My intention is to create equal superposition. Writing down a circuit with particular gates is not an effective way to communicate this intention.&lt;/p&gt;

&lt;h3 id=&quot;side-note-on-cognitive-load&quot;&gt;Side note on cognitive load&lt;/h3&gt;

&lt;p&gt;If you’re not familiar with it, let me introduce you to the concept of “cognitive load”.&lt;/p&gt;

&lt;p&gt;Cognitive load is basically the work that our brain needs to put in order to perform our task. Imagine having a conversation with someone while you are walking through an empty park on a sunny day. And now imagine having the same conversation in a crowded room, with loud music. One of the reason why it’s harder to have conversation in the latter situation is that your brain needs to ignore all the extra signals and focus only on what’s relevant for the conversation. All the noise adds the cognitive load.&lt;/p&gt;

&lt;p&gt;Similarly in the data visualization – a good data visualization doesn’t have plenty of unnecessary details, it only has what’s necessary to convey the message. The more elements there are, the more our brain has to process. Which means that processing is slower and less efficient.&lt;/p&gt;

&lt;p&gt;So in our case, the fact that someone needs to look at the circuit and figure out what we meant by the Hadamard gates in this specific context adds some unnecessary cognitive load.&lt;/p&gt;

&lt;h2 id=&quot;problem-2--circuits-are-too-low-level-for-many-algorithms&quot;&gt;Problem 2 – Circuits are too low level for many algorithms&lt;/h2&gt;

&lt;p&gt;When you want to tell microprocessor which diode to light when you hit a button, you can write this program using assembler. When you want to create a web form that takes some data, sends it to a server, stores in a database and sends an e-mail notification, you can write this in, let’s say, Django (Python).&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Cause depending on the task at hand, it’s better to work at different layers of abstractions. Sure, your Python code will in the end get compiled to assembler, but you, as a web developer, can live your whole life and never think about this fact.
Sure, you can try writing the whole web app in assembler – good luck! And what if your server breaks and you get a new one that uses different architecture? Rewriting the whole thing from scratch sounds fun, right?&lt;/p&gt;

&lt;p&gt;What language we speak influences how we think – for better or worse. So back to quantum – thinking about algorithms in terms of circuits definitely is useful in some contexts, but is limiting in others. And actually, many people don’t think about algorithms in terms of circuits. They write equations, make operations on unitary matrices, use block diagrams. But often in the end, they need to express these ideas in terms of circuits, which as Yuval pointed out in &lt;a href=&quot;https://www.youtube.com/watch?v=qYuxOx4Z8Yk&quot;&gt;this talk&lt;/a&gt;, is somewhat painful.&lt;/p&gt;

&lt;p&gt;And the fact, that we don’t have a common way of expressing algorithms at higher level through software makes it harder to move field forward. Speaking from my own experience.&lt;/p&gt;

&lt;h2 id=&quot;problem-3--compilation&quot;&gt;Problem 3 – Compilation&lt;/h2&gt;

&lt;p&gt;Let’s say I want to run QAOA. I can express QAOA with the following equations (details in my &lt;a href=&quot;/Quantum-Approximate-Optimization-Algorithm-Explained.html&quot; target=&quot;_blank&quot;&gt;QAOA blogpost&lt;/a&gt; ):&lt;/p&gt;

\[| \gamma, \beta \rangle = U(H_B, \beta_p) U(H_C, \gamma_p) … U(H_B, \beta_1) U(H_C, \gamma_1) | s \rangle\]

&lt;p&gt;Does this expresses exactly my intent? Yeah. Is this unambiguous? Sure.&lt;/p&gt;

&lt;p&gt;Now I want to run it on some hardware. So I express it as a circuit – let’s say I use CNOTs, RXs, H and whatever else I need. I want to send this to hardware, but my hardware uses a different gate set. Ok, I can compile it to that gate set and we’re good to go.&lt;/p&gt;

&lt;p&gt;So I have two steps:&lt;/p&gt;

&lt;p&gt;“Mathematical formulation” -&amp;gt; “Abstract circuit” -&amp;gt; “Physical circuit”&lt;/p&gt;

&lt;p&gt;Now what if we had some better representation?&lt;/p&gt;

&lt;p&gt;We would get:&lt;/p&gt;

&lt;p&gt;“Mathematical formulation” -&amp;gt; “Better representation” -&amp;gt; “Physical circuit”.&lt;/p&gt;

&lt;p&gt;Still the same number of steps, so we’re kinda in the same place. But we already get some minor benefits – it’s way easier to do the first transition in the second case, as “better representation” is much closer to the “mathematical formulation”. And the other part is automated anyway.&lt;/p&gt;

&lt;p&gt;But actually “better representation” might make the second transition easier as well. QAOA is pretty structured – I basically repeat the same operations over and over again, just with different parameters. In the “abstract circuit” representation I don’t have a way to express that, so if I have 1000 layers, I’ll create a very long circuit and them I’m forced to perform basicalyl the same compilation operations 1000 times. But if you have a better representation, you can do this better.&lt;/p&gt;

&lt;p&gt;You can say that “better representation” could be simply “circuits with for loops” – I agree with that, this already would be an improvement in this case!&lt;/p&gt;

&lt;p&gt;Another example, this time very close to my heart. In &lt;a href=&quot;https://www.darpa.mil/news-events/2021-04-02&quot;&gt;one project I’m working on&lt;/a&gt;, we’re building a pipeline that takes a “Quantum program”, compiles it to a set of fault tolerant operations and then performs resource estimation.
Ok, so how does the process looks like in our case?&lt;/p&gt;

&lt;p&gt;Logical circuit -&amp;gt; “Clifford + T” circuit -&amp;gt; ICM Circuit -&amp;gt; Graph state -&amp;gt; Some FTQC operations&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Details about this method has been described in &lt;a href=&quot;https://arxiv.org/abs/2209.07345&quot;&gt;this recent paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The point is, that (as far as I can tell), performing the first three transitions is not super important from the point of view of the algorithm. It’s just necessary evil, which is introduced because we express our algorithms as circuits.&lt;/p&gt;

&lt;p&gt;Perhaps (pure speculation on my end) there is a more direct mapping from higher level algorithm primitives like “QFT” to the “Graph state”, which doesn’t require going through circuits. Maybe not, I have no idea. But isn’t it worth exploring such possibility more?&lt;sup id=&quot;fnref:3&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;h2 id=&quot;problem-4--classical-control-flow&quot;&gt;Problem 4 – classical control flow&lt;/h2&gt;
&lt;p&gt;It’s really hard, perhaps even impossible, to express certain “classical flow” operations with circuits.Things like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Repeat until success&lt;/li&gt;
  &lt;li&gt;Conditional execution based on mid-circuit measurements&lt;/li&gt;
  &lt;li&gt;For loops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not to mention quantum error correction (QEC) instructions – but I leave this out as I would consider these “low level” – see section about QIR for more discussion.&lt;/p&gt;

&lt;p&gt;As far as I remember QASM 3.0 gives you some of these things and I consider QASM 3.0 to be “extended circuits”, so I guess it kind of can be done, but I’m not sure to what extent.&lt;/p&gt;

&lt;h2 id=&quot;problem-5--non-gate-based-computation&quot;&gt;Problem 5 – non-gate based computation&lt;/h2&gt;
&lt;p&gt;Another issue (brought to my attention by &lt;a href=&quot;https://www.linkedin.com/in/jonathan-wurtz-7a4855181/&quot;&gt;Jonathan Wurtz&lt;/a&gt; from &lt;a href=&quot;https://www.quera.com&quot;&gt;QuEra&lt;/a&gt;, thanks man!) is that prevalence of circuits limits the usage of alternative approaches.&lt;/p&gt;

&lt;p&gt;From what I understand about QuEra’s approach, they have analog machines. With these machines you can simulate the evolution of some Hamiltonian – which allows you to solve a wide variety of problems.&lt;/p&gt;

&lt;p&gt;So you could implement QAOA on such machine – but the fact that you usually express them as circuits makes it harder. Sure, you can do some reverse-engineering, but it takes time and introduces friction. Having a better representation could makes it much easier to work with non-circuit-based platforms. (Probably missed out a lot of details, sorry for that! But I hope the point still holds.)&lt;/p&gt;

&lt;p&gt;Another example – much more mundane, but affected me personally. Again – QAOA-centric. Most of the integrations with hardware/simulators we have at Zapata are circuit-centric. But there are very efficient ways of simulating QAOA (under certain conditions) that don’t require using circuits. For example, you can use &lt;a href=&quot;https://arxiv.org/abs/2012.03421&quot;&gt;analytical equations&lt;/a&gt; to simulate 1-layer QAOA for certain Hamiltonians. But I don’t do that, because the way I express QAOA ansatz is tied directly to circuits. And adding such option would be too much refactoring to be worth the effort for the project I’m working on.&lt;/p&gt;

&lt;p&gt;Another paradigm that might suffer from circuits’ prevalence is Measurement-Based Quantum Computing (MBQC). MBQC is a very different way to think about quantum computation that I have not fully grasped yet, so I might be wrong here, but that’s my hunch.&lt;/p&gt;

&lt;h1 id=&quot;mid-blogpost-remarks&quot;&gt;Mid-blogpost remarks&lt;/h1&gt;

&lt;h2 id=&quot;remark-on-qaoa&quot;&gt;Remark on QAOA&lt;/h2&gt;
&lt;p&gt;I’m using QAOA as example so much, for several reasons:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;I’m very familiar with this algorithm&lt;/li&gt;
  &lt;li&gt;It has very good high-level representation and structure&lt;/li&gt;
  &lt;li&gt;It’s relatively simple, which makes discussion more approachable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think that a lot of these points could be made with other algorithms – I don’t think that the fact that QAOA is variational algorithm has any importance here.&lt;/p&gt;

&lt;h2 id=&quot;remark-on-circuits-usefulness&quot;&gt;Remark on circuits usefulness&lt;/h2&gt;
&lt;p&gt;I don’t say the circuits are terrible abstraction that we should get rid off. No, they have their uses. I think the closer you’re to the hardware the more sense there is to use them.
They are also very useful for optimizing performance of your algorithm if you want to run your algorithm in 2022.&lt;/p&gt;

&lt;p&gt;My point is – they have limitations, let’s acknowledge them as a community and come up with a better abstractions that works for higher-level users as well.&lt;/p&gt;

&lt;h2 id=&quot;remark-on-breaking-abstraction&quot;&gt;Remark on breaking abstraction&lt;/h2&gt;
&lt;p&gt;In his presentation at IEEE Quantum Week 2022, &lt;a href=&quot;http://people.cs.uchicago.edu/~ftchong/index.html&quot;&gt;Fred Chong&lt;/a&gt; mentioned that in their group, rather than building more abstractions, they are breaking the existing abstractions. I find their approach very appealing, but what I propose is building more abstractions. How do I reconcile this?&lt;/p&gt;

&lt;p&gt;I think that breaking abstractions has two uses:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;It allows you to build a better one&lt;/li&gt;
  &lt;li&gt;It allows you to increase efficiency of your program&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In classical computing automated tool for compilation are so advanced that no human is able to beat it&lt;sup id=&quot;fnref:3:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;. However, we’re not at this stage with QC and, at least for the next couple of years, researchers will have to do low-level tinkering with circuits in order to get best results. 
However, keep in mind, that not all the researchers work on algorithms that they want to run today – for them breaking the abstractions might not be as useful&lt;/p&gt;

&lt;h1 id=&quot;solutions&quot;&gt;Solutions&lt;/h1&gt;
&lt;p&gt;Ok, I ranted on circuits for a bit. So what’s my idea to make it better?&lt;/p&gt;

&lt;p&gt;Well…&lt;/p&gt;

&lt;p&gt;I don’t have a good idea!&lt;/p&gt;

&lt;p&gt;I feel the pain, I see the problem, but I don’t have a solution. Even more – I’m pretty sure I don’t have the expertise to come up with such solution myself. But please bear with me for a couple minutes more, as while I don’t have solutions, I have some thoughts about how to get one..&lt;/p&gt;

&lt;h2 id=&quot;existing-tools&quot;&gt;Existing tools&lt;/h2&gt;
&lt;p&gt;I think there are many people who came up with solutions to tackle some of these problems. I have very vague idea about what they do and how they work, but from my brief interactions with them it seems to me that they extend / build on top of circuits and attempt to solve some of the issues listed above.&lt;/p&gt;

&lt;p&gt;I might be wrong – one of these might have already solved all the issues! But I don’t know that and researching that would delay me releasing this by weeks, so I just expect other people to tell me what are the pros and cons of these solutions. Given my ignorance, I’ll just throw the names here without any commentary:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/quil-lang/quil&quot;&gt;Quil&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Q_Sharp&quot;&gt;Q#&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.mathstat.dal.ca/~selinger/quipper/&quot;&gt;Quipper&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://zxcalculus.com&quot;&gt;ZX calculus&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/qir-alliance&quot;&gt;QIR&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/openqasm/openqasm&quot;&gt;Open QASM 3.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are all very different, but I think they all have some elements that might be useful/inspiring for the end solution.&lt;/p&gt;

&lt;h2 id=&quot;quantum-intermediate-representation&quot;&gt;Quantum Intermediate Representation&lt;/h2&gt;
&lt;p&gt;There is this thing called &lt;a href=&quot;https://github.com/qir-alliance&quot;&gt;Quantum Intermediate Representations (QIR)&lt;/a&gt;, which looked very promising to me at first. It solves a lot of problems with compilation of quantum programs into instructions that are executable on hardware. It tackles issues with inter-platform compatibility and control flow – I’m pretty sure it has been designed to be QEC-compatible, at least to some extent.&lt;/p&gt;

&lt;p&gt;However, from my superficial understanding of what QIR is, I think that it does’t actually solve the problems that I’m mostly concerned with – the problem of expressibility, of traversing layers of abstractions in the graph-state compilation process, or being good tool for thinking about the algorithms.&lt;/p&gt;

&lt;p&gt;QIR is designed more to be a “machine-to-machine” representation, and not something that’s human readable.&lt;/p&gt;

&lt;p&gt;QASM 3.0 on the other hand is much more human readable. But it’s still gates and circuits centric, which also doesn’t make it a good solution to the problems that I think about.
QIR and QASM people – feel free to argue! As I said, this is all just my perspective.&lt;/p&gt;

&lt;p&gt;Oh, and huge thanks to &lt;a href=&quot;https://twitter.com/cgranade&quot;&gt;Cassandra Granade&lt;/a&gt; for the discussions on the topic and explaining me what QIR does a couple of times now ;)&lt;/p&gt;

&lt;h3 id=&quot;sidenote-on-naming&quot;&gt;Sidenote on naming&lt;/h3&gt;
&lt;p&gt;One of the issues I have with QIR is the matter of naming. As we can read in &lt;a href=&quot;https://en.wikipedia.org/wiki/Intermediate_representation&quot;&gt;Wikipedia&lt;/a&gt;, “intermediate representation” (IR) is: “the data structure or code used internally by a compiler or virtual machine to represent source code”&lt;/p&gt;

&lt;p&gt;So in my “Graph state compilation” example, my graph state is an IR. If you do Lattice Surgery, your time-space slices (or whatever that thing is called) is IR.&lt;/p&gt;

&lt;p&gt;What QIR alliance is doing (unintentionally I guess) is owning the name “intermediate representation” for the IR that exists at the level of the stack that they have defined – which is somewhere between circuits and hardware. I might be totally wrong here and perhaps the examples I have given shouldn’t fall under “IR”. Again – people who are more experienced, please tell me!&lt;/p&gt;

&lt;h2 id=&quot;blocks&quot;&gt;Blocks&lt;/h2&gt;
&lt;p&gt;I have one idea for a representation which has the following pros:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;It’s slightly higher level than circuits (so we don’t risk getting too far from current state of affairs ;) )&lt;/li&gt;
  &lt;li&gt;People are already using it&lt;/li&gt;
  &lt;li&gt;Is pretty flexible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s called “Using blocks that are higher level than gates”, or UBTAHLTG.&lt;/p&gt;

&lt;p&gt;OMG, I just laughed on my own joke :D&lt;/p&gt;

&lt;p&gt;How would such blocks look like?&lt;/p&gt;

&lt;p&gt;Well, you could have a block called “prepare equal superposition” or “QFT” or “Grover’s oracle” and then you could construct your quantum program from these blocks. It’s basically how people write algorithms in their papers.&lt;/p&gt;

&lt;p&gt;And if you want classical control flow, let’s express it as workflows (&lt;a href=&quot;https://www.zapatacomputing.com/orquestra-platform/&quot;&gt;at Zapata we have love workflows&lt;/a&gt; ;) ). Or maybe computational graphs, whatever you want to call them. I’m not a computer scientists.&lt;/p&gt;

&lt;p&gt;I don’t think it’s particularly revolutionary or novel, but I haven’t seen it widely used or expressed in software (though I bet people already did it). So maybe worth giving it some more attention and maybe coming up with some common conventions how to do this?&lt;/p&gt;

&lt;p&gt;Here are some nice visualizations of how one can build circuits from blocks by &lt;a href=&quot;https://twitter.com/novemberlyd&quot;&gt;Yidong Liao&lt;/a&gt; from UTS:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2022-09-26-beyond-circuits/qaoa_blocks.png#center&quot; alt=&quot;Visualization 1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2022-09-26-beyond-circuits/LCU_blocks.jpeg#center&quot; alt=&quot;Visualization 2&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;note-on-standardization&quot;&gt;Note on standardization&lt;/h3&gt;

&lt;p&gt;In order for this to be useful and not introduce more friction, we would need it to be standardized to some level, we would need to have some common conventions. 
However, since we will still be experimenting with all this, we definitely don’t want to create poor standards and then force people to follow.&lt;/p&gt;

&lt;p&gt;Not sure what’s a good way to deal with that.&lt;/p&gt;

&lt;h2 id=&quot;this-will-be-messy&quot;&gt;This will be messy!&lt;/h2&gt;

&lt;p&gt;I don’t think anyone has a very good answer for the problems I stated. If that was the case, I think it would have already dominated the landscape&lt;sup id=&quot;fnref:4&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:4&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;. So we will do, what software developers always do - create &lt;a href=&quot;https://xkcd.com/927/&quot;&gt;another competing standard&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;But seriously – the process will be messy, there’s no doubt about it. But I think we can do it in a way that it’s not overly painful.&lt;/p&gt;

&lt;p&gt;Let’s try not to compete. Let’s not try to force people into using this or that representation. Let’s not make incompatible standards and create technological lock-ins.&lt;/p&gt;

&lt;p&gt;Instead let’s come to this with experimentation mindset. Let’s make it obvious to the users of our frameworks, that this feature is very experimental and it might change. Let’s make sure that they don’t get too attached and not build too much infrastructure around it. Let’s be nimble and collaborative. Let’s play with each other’s tools, take inspiration and ideas. Let’s be ready to ditch the projects that we’ve been working on and switch to something better than someone else designed.&lt;/p&gt;

&lt;p&gt;That sounds idealistic, right? Is that possible – honestly I don’t think so. But I believe that if we keep such principles in mind, at least the whole process will be smoother.&lt;/p&gt;

&lt;h2 id=&quot;how-are-we-going-to-work-on-this&quot;&gt;How are we going to work on this?&lt;/h2&gt;
&lt;p&gt;First things first – I’m in no position to tell people what to do with all this. I just have some frustrations, talked with a bunch of people, listened to their frustrations and then decided to write it down. I just want to spur some discussion about the topic and hope that something will come out of this. I love my job, I love this community, but not enough to cut down my family and sleep time ;) Therefore this blogpost is not my declaration that I’ll come forward and lead the way.&lt;/p&gt;

&lt;p&gt;I think we need to talk more – IEEE Quantum Week was a great place to start these discussions and I think we could use some other major conferences to advance it even further. If someone feels like organizing some virtual workshops on the topic – let me know, I’d be glad to participate.&lt;/p&gt;

&lt;p&gt;Maybe more people should write what they think about it? Maybe even papers if someone feels like it? Maybe some conference talks, I don’t know.&lt;/p&gt;

&lt;p&gt;Another extremely useful thing – if you know how this kind of “experimenting with new abstractions and driving community consensus” has been done in other industries, please share this knowledge with others! I think we, as a quantum community, sometimes try to reinvent the wheel, while there are already battle tested solutions.&lt;/p&gt;

&lt;p&gt;Also, I’d be really glad if we could have some discussions in the comment section under this blogpost – I’ve read some really good discussion under some Scott Aaronson blogposts, so I think this is not a bad way to have a discussion.&lt;/p&gt;

&lt;p&gt;Speaking of Scott Aaronson – if anyone feels like asking people who have been thinking about foundational issues in quantum information for decades already, that would be great. I bet they have plenty of good thoughts on the topic.&lt;/p&gt;

&lt;h1 id=&quot;final-remarks&quot;&gt;Final remarks&lt;/h1&gt;

&lt;p&gt;I think this blogpost is good way to start discussion, but will get outdated pretty fast, as I will be getting feedback – I expect ~50% of what I stated here to be at least somewhat misguided and/or inaccurate. So I think that instead of trying to keep it updated, I’ll just write a proper version when I get enough feedback to feel confident about doing it.&lt;/p&gt;

&lt;p&gt;If you’d like to read more of my “raw thoughts” like this, please let me know. As anyone who ever talked with me would know, I have plenty of thoughts on multiple topics (especially quantum software), so perhaps it’s worth start sharing them more publicly.&lt;/p&gt;

&lt;p&gt;Please comment, please share, please argue! For me the best outcome would be if someone proved to me that circuit is the ultimate best abstraction for QC, cause then we have one less problem to worry about and I can get back to doing different things ;)&lt;/p&gt;

&lt;p&gt;And don’t forget to subscribe to the newsletter &lt;a href=&quot;https://mailchi.mp/eaffe4a3a59a/mustythoughts&quot;&gt;here&lt;/a&gt; if you’d like to stay up to date with my writing and other projects.&lt;/p&gt;

&lt;p&gt;Have a nice day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;P.S. It’s kind of refreshing feeling to know that I can write a whole blogpost in 4 hours, then spend extra 2 hours reading and editing (instead of usual 30+). And I don’t have to give it to at least 5 people to proof-read and ask Rafał to do all the editing and correction. Wow!&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Footnotes:&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;I think that actually just to change the base you need only RY(\(\frac{\pi}{2}\)), cause Hadamard adds some extra rotation to the mix. But I also think that people sometimes use Hadamard to change the basis, so feel free to correct me if I got something wrong. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;This is still at the early stage of development and I still don’t understand all the steps very well – that’s where the vague “Some FTQC operations” is coming from. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;I think Jim Keller said that in one of the interviews with Lex Fridman. Absolutely excellent interviews, highly recommend listening to them: &lt;a href=&quot;https://www.youtube.com/watch?v=Nb2tebYAaOA&quot;&gt;link 1&lt;/a&gt;, &lt;a href=&quot;https://www.youtube.com/watch?v=G4hL5Om4IJ4&quot;&gt;link 2&lt;/a&gt;). &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt; &lt;a href=&quot;#fnref:3:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:4&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;There’s also a good chance that it was just so ahead of times that the world was not ready for it and we need to revisit this idea. &lt;a href=&quot;#fnref:4&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Mon, 26 Sep 2022 12:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/beyond-circuits.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/beyond-circuits.html</guid>
			</item>
		
			<item>
				<title>Make a great first impression with your quantum computing resume</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;In the last couple of years I’ve been mentoring, educating and supporting a lot of people who were at the start of their journey with quantum computing. Apart from that, I’ve been helping with hiring for various positions at &lt;a href=&quot;https://www.zapatacomputing.com&quot;&gt;Zapata Computing&lt;/a&gt;.
In the process I’ve reviewed hundreds of CVs and given feedback on tens of them and decided that maybe instead of giving people the same advice over and over, I’ll just write a blogpost about it.&lt;/p&gt;

&lt;p&gt;I think 90% of the advice is universal regardless of the field, but I tried to add some that is relevant for the new fields with a highly scientific vibe, like quantum computing.&lt;/p&gt;

&lt;p&gt;I also gave &lt;a href=&quot;https://www.youtube.com/watch?v=9ybBw_UniMA&quot;&gt;a presentation at the Careers in Quantum conference&lt;/a&gt; in 2021 on the topic of getting a job in QC. I guess since you’re reading this article, that presentation will also be highly helpful for you.&lt;/p&gt;

&lt;p&gt;And last, but not least, keep in mind that everything I say here is my perspective. I tried to make it universal, it got reviewed by several people with different points of view, but there is probably still some bias left.&lt;/p&gt;

&lt;p&gt;So here we go!&lt;/p&gt;

&lt;h2 id=&quot;what-does-the-hiring-process-look-like&quot;&gt;What does the hiring process look like?&lt;/h2&gt;

&lt;p&gt;Before we get into the details of the CV itself, it’s also important to understand how the hiring process itself works (especially if you don’t have much experience).&lt;/p&gt;

&lt;p&gt;So here are a couple of rules that I didn’t realize before I got involved into hiring and that made all my future hiring processes waaaaay less stressful:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;There are people on the other side&lt;/strong&gt; – they make mistakes, they forget stuff. But they also have empathy and might bend rules a little bit in certain circumstances (e.g. you missed the deadline for application by one day because you got sick)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Hiring may be one of several competing priorities&lt;/strong&gt; – imagine a team that started the hiring process but then they discovered a critical bug in a project for a customer and had to spend 2 weeks fixing it. No surprise your hiring process got delayed.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;They have limited time to process the applications&lt;/strong&gt; – imagine getting over 200 applications for an internship position (I’ve been there!). Do you think anyone will spend 5 minutes per application (over 16 hours in total) to read the whole CV line by line? Or will they rather spend 30 seconds per application and then focus on the several really interesting ones?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Processes might look totally different from company to company, but also from team to team.&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Different positions might have very different timelines&lt;/strong&gt; – some positions need to be filled as soon a possible, for some others the team will keep waiting (even months) for someone with specific expertise to come up.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Applying through the website is only one of many channels through which a company learns about the candidates&lt;/strong&gt; – I personally never got hired just through an “application form”, it always involved some forms of personal recommendations.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The hiring process is not always static&lt;/strong&gt; – sometimes things change while you’re in the hiring process, be it the team needs, hiring managers or some other circumstances. Don’t take it as a bad sign!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To be honest – this (especially points 2 &amp;amp; 3) is not necessarily how it should look like in the real world. But often (especially at startups), people wear multiple hats, there’s a lot of hiring and things are always in flux. I guess it’s just one of those moments where reality sucks…&lt;/p&gt;

&lt;h2 id=&quot;how-to-plan-writing&quot;&gt;How to plan writing&lt;/h2&gt;

&lt;p&gt;Before you start writing your CV, you should have a plan. Here are some tips on the preparation part:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Every CV I have written in the last 5 years has been written with a specific position in mind. Read the job description, highlight key words, make sure you know exactly what the company is looking for.&lt;/li&gt;
  &lt;li&gt;Do your research about the company. Check out the website, search for interviews, see what recent projects they have done. If you can target a specific team, that’s even better.&lt;/li&gt;
  &lt;li&gt;See if you know anyone inside the company and you could ask them about the position. Maybe you met at a conference last year, maybe you have a common friend?&lt;/li&gt;
  &lt;li&gt;Just search “How to write a CV” – most of the generic advice is actually valuable and totally makes sense!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;writing-tips&quot;&gt;Writing tips&lt;/h2&gt;

&lt;p&gt;You did your research, you know what they’re looking for. Now, let’s get down to writing.&lt;/p&gt;

&lt;h3 id=&quot;be-concise&quot;&gt;Be concise&lt;/h3&gt;
&lt;p&gt;Keep your CV short. It forces you to be concise, to focus only on the relevant info. Do you really think anyone will read 5 pages of your CV in detail? No? So why don’t you save some time for the person on the other side and just put in what counts and not all your highschool awards or list of all the conferences where you presented in the last decade. You can put links to your GitHub, Google Scholar, personal website with an extended version of the CV. If your short CV will catch recruiter’s attention, then they’ll definitely want to dig in before proceeding with the process. If it doesn’t, then the long version probably also wouldn’t.&lt;/p&gt;

&lt;p&gt;I personally always make mine one page long. I’m not saying this is the solution for every person, but in most cases I’ve seen, people tend to put too much irrelevant information into their CV and limiting yourself to one page is a good way to focus on what’s important. For senior candidates, 2 pages is still fine (I guess I’m not at that level of seniority yet ;) ).&lt;/p&gt;

&lt;h3 id=&quot;be-specific&quot;&gt;Be specific&lt;/h3&gt;
&lt;p&gt;Focus on relevant info. You did your research, you know what they’re looking for. Go through all the items you highlighted earlier and make sure you include something that addresses it in your CV (if you meet the criteria, of course).&lt;/p&gt;

&lt;p&gt;Are they looking for a “team player”? Make sure to make it clear that in the last project you worked as a part of a group. Do they say they’re looking for “self-starters”? Make sure to include info about the initiative you started at your university. There’s not a single word about figure skating? Well, perhaps you don’t need to spend half a page listing all the awards you won as a figure-skater, one line will suffice.&lt;/p&gt;

&lt;p&gt;When you’re done writing, go through every single item on your CV and ask yourself – is this something that the recruiter will care about? Should I keep it or remove it? I’ve seen people including passport numbers or high-school awards they got 5 years ago, why would anyone care about that?&lt;/p&gt;

&lt;p&gt;A couple of extra tips:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Put the month and year in for dates (not just the year).&lt;/li&gt;
  &lt;li&gt;If a role is a contract or side project, make note of that next to the job title so it doesn’t look like you are job hopping.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;be-careful&quot;&gt;Be careful&lt;/h3&gt;

&lt;p&gt;Put only things that you’re comfortable talking about. Let’s say you’re in the middle of a project. It’s relevant for the job, but you have only started to set things up and you don’t have any significant results to talk about. Would you feel comfortable if they ask you about it during the interview? If so, sure, put it there. If not, please don’t.&lt;/p&gt;

&lt;p&gt;For another example: my company, Zapata, has done a lot of research in the field of variational quantum algorithms. A friend wanted to apply to Zapata and he sent me his CV for review. I noticed “variational algorithms” in the “Expert” section. I told him: “Saying that you’re an expert in VQA when you apply to Zapata is kind of risky ;)”. He moved it to the “Intermediate” section. Be aware of the context!&lt;/p&gt;

&lt;p&gt;If you want to add a skill that is new to you and relevant to the role, put it in the skills section under the title “Learning”. This says you have interest in the skills needed for the role, even if not an expert yet and it means the interviewer will have more realistic expectations when asking about it.&lt;/p&gt;

&lt;p&gt;Taking a “shotgun” approach to listing skills and experience can seriously backfire. Your designated hiring manager may believe—usually after talking to you—that you haven’t cared to distinguish your “actual” skills from those you might conceivably pick up, and will make you a very blurry and uncertain candidate.&lt;/p&gt;

&lt;h3 id=&quot;be-careful-2&quot;&gt;Be careful 2&lt;/h3&gt;

&lt;p&gt;Make sure you don’t include the info you shouldn’t include. In some countries or some companies, there might be anti-bias policies and for example including a photo might work against you.&lt;/p&gt;

&lt;h3 id=&quot;be-honest&quot;&gt;Be honest&lt;/h3&gt;

&lt;p&gt;While I admit it is the &lt;em&gt;status quo&lt;/em&gt; to embellish and sometimes slightly exaggerate the truth on one’s CV, &lt;strong&gt;absolutely do not lie&lt;/strong&gt;. I had a situation where a friend reached out to me asking about a person that did a project with me. The problem was that they actually didn’t, but they had that in their CV. We had an initial conversation, we laid out the plan for the project, but I never heard from him afterwards. I don’t have to tell you they didn’t get the job.&lt;/p&gt;

&lt;p&gt;I really mean it, don’t lie.&lt;/p&gt;

&lt;h3 id=&quot;be-accurate&quot;&gt;Be accurate&lt;/h3&gt;

&lt;p&gt;Sure, everyone might have a typo in their CV, but you really don’t want to show that you’re sloppy and so lazy that you haven’t even checked your CV against some online grammar&amp;amp;style checker (e.g. &lt;a href=&quot;https://www.grammarly.com&quot;&gt;Grammarly&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I also try to pay attention to the “brand names”. The official spelling of the &lt;a href=&quot;https://pennylane.ai&quot;&gt;“PennyLane” framework&lt;/a&gt; is, well, “PennyLane” and not “Penny Lane”, “penny lane” or “Penny-lane”. Sure it’s not the most important thing in the world and I guess most people won’t notice, but some do. It might also matter more in certain roles that include content creation, (e.g. “technical writer”) or very detail-oriented ones, (e.g. in quality assurance).&lt;/p&gt;

&lt;h3 id=&quot;be-expressive&quot;&gt;Be expressive&lt;/h3&gt;

&lt;p&gt;Text formatting is an extremely useful tool that will make your CV effective.
Use bullet points, colors, bolds and italics, font sizes, all the tools at your disposal, to make it easy to find certain information. Use it strategically, help the recruiter to find the info they’re looking for right away. Make sure that the font has high contrast compared to the white background; for example, do not use a gray font.&lt;/p&gt;

&lt;p&gt;Don’t overdo it – you don’t want your CV to stand out visually (unless you really know what you’re doing!), but rather make it easier to navigate.&lt;/p&gt;

&lt;p&gt;I learned a lot about how people process visual information from the book (and blog) &lt;a href=&quot;https://www.storytellingwithdata.com&quot;&gt;“Storytelling with Data”&lt;/a&gt; by Cole Nussbaumer Knaflic. It’s mostly about data visualization, but many points are useful also in this context as well.&lt;/p&gt;

&lt;h3 id=&quot;additional-tips&quot;&gt;Additional tips&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;I don’t understand why people don’t include their thesis’ supervisor’s name in the CV. I seriously doubt this could work against them, but if the person reading your CV knows the person, it could work in their favor. This really might be a dealmaker!&lt;/li&gt;
  &lt;li&gt;Don’t include names of your references in your CV. If the hiring manager needs to do a reference call, they will ask you for the contact info. Some people might get upset to have their name “out there”.&lt;/li&gt;
  &lt;li&gt;Use links – if you write about a project and it’s on GitHub, link it in your CV.&lt;/li&gt;
  &lt;li&gt;The job posting will soon disappear from the website, so save it to a pdf. You can keep that for future reference.&lt;/li&gt;
  &lt;li&gt;You might have done some really amazing projects, but if all I see is a project title I will never know why it’s interesting.&lt;/li&gt;
  &lt;li&gt;Many candidates have lost a job due to a bad Facebook account and did not even realize it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;qc-specific-tips&quot;&gt;QC specific tips&lt;/h2&gt;

&lt;p&gt;To make this section useful, I’ll explicitly limit myself to “entry-level positions in quantum computing companies”.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For the most part, the characteristics a hiring manager wants to see is unambiguous technical capacity. Hiring managers usually believe technically competent individuals can be appropriately trained in the multidisciplinary field of QC, and thus such managers will be looking for evidence of that on your CV.&lt;/li&gt;
  &lt;li&gt;QC-related knowledge and skills are not necessarily the most important things for the recruiting team. It should be pretty clear from the job posting. Some QC companies already have many experts on board and they actually need some other skills.&lt;/li&gt;
  &lt;li&gt;Highlighting tutorial-level projects is not very impressive. I would prefer to see a simple “Basic familiarity with qiskit” rather than a whole entry which describes that you’ve implemented the “Grover search algorithm for 5 qubits”, go to GitHub and see 30 lines of codes and one plot there.&lt;/li&gt;
  &lt;li&gt;Demonstration of skills adjacent to QC, such as in mathematics, science, computing, and/or academic research will typically be a better indicator and more valuable space on your CV than simple forays into QC.&lt;/li&gt;
  &lt;li&gt;It is better to tell a hiring manager you have either no QC knowledge, or pop-sci level, than to try to “talk the talk” and blunder (especially if you don’t even know you’re blundering).&lt;/li&gt;
  &lt;li&gt;Highlight any interesting projects that you did and if you did something novel/particularly interesting, make it clear!&lt;/li&gt;
  &lt;li&gt;Relevant online courses may be worth mentioning if other demonstrated experience is lacking, but “relevant” is key word here, and don’t expect that an “intro level QC course” will impress anyone.&lt;/li&gt;
  &lt;li&gt;It’s a small world – if someone from the field mentored you or you did a project together, please mention their name, there’s a chance that the person recruiting you knows them (if you expect they would give you a good reference of course ;)).&lt;/li&gt;
  &lt;li&gt;Mentioning your active participation in the QC community is valuable if kept brief; there is no need to spend half a page listing all your contributions, hackathons, meetups, small-scale presentations, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;after-youre-done&quot;&gt;After you’re done&lt;/h2&gt;

&lt;p&gt;Ok, you spent the whole afternoon polishing your CV, now it’s time to apply, right?&lt;/p&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;Now it’s time to do two more things.&lt;/p&gt;

&lt;p&gt;First, ask someone to review it, possibly someone more experienced than you. They’ll probably immediately spot some issues that would be hard for you to find. Remember to send them the job posting alongside the CV, so they have all the context they need. Second, get some rest, and come back to it a day or two later. Read it again and you’ll be surprised how many things you’ll find to improve.&lt;/p&gt;

&lt;h2 id=&quot;closing-notes&quot;&gt;Closing notes&lt;/h2&gt;

&lt;p&gt;Thanks for reading, I hope you found it helpful! If you did, you might find some other resources on my blog helpful as well, so feel free to explore :)
As always – consider subscribing to the newsletter: &lt;a href=&quot;https://mailchi.mp/eaffe4a3a59a/mustythoughts&quot;&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, just a couple of days ago Olivia Lanes (IBM) posted &lt;a href=&quot;https://www.livlanes.com/post/for-those-struggling-to-break-into-the-quantum-workforce&quot;&gt;her thoughts on the topic of breaking into quantum workforce&lt;/a&gt;, it might be interesting for you as well!&lt;/p&gt;

&lt;p&gt;And huge thanks to everyone who helped with writing this post. They contributed a lot of insight:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Claudia Taylor – People Operations Manager at &lt;a href=&quot;https://www.zapatacomputing.com&quot;&gt;Zapata&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Christi Amend – Senior Technical Recruiter at &lt;a href=&quot;https://lambdalabs.com&quot;&gt;Lambda&lt;/a&gt;, previously at &lt;a href=&quot;https://www.dwavesys.com&quot;&gt;D-Wave&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Peter Johnson – Lead Research Scientist at &lt;a href=&quot;https://www.zapatacomputing.com&quot;&gt;Zapata&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Robert Smith – Chief of Quantum Software at &lt;a href=&quot;https://www.hrl.com&quot;&gt;HRL Laboratories&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Rafał Ociepa – Head of Product at Droplabs and my loyal editor!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have a nice day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Mon, 02 May 2022 12:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/quantum-cv.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/quantum-cv.html</guid>
			</item>
		
			<item>
				<title>VQE - challenges and state of research</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/vqas-challenges.html&quot; target=&quot;_blank&quot;&gt;Last time&lt;/a&gt; we talked about challenges associated with Variational Quantum Algorithms in general and today we’ll focus more specifically on Variational Quantum Eigensolver (VQE). All of the things we’ve covered previously are relevant for VQE as well, but here we’ll focus on challenges and progress that are more specific for VQE.&lt;/p&gt;

&lt;p&gt;If you don’t remember exactly how VQE works, you can refresh your memory with the first article in the series – &lt;a href=&quot;/Variational-Quantum-Eigensolver-explained.html&quot; target=&quot;_blank&quot;&gt;“VQE explained”&lt;/a&gt;, which is also a good place to start if you’re new here.&lt;/p&gt;

&lt;p&gt;One more thing – while I was working on this article a new preprint came out on arxiv by &lt;a href=&quot;https://arxiv.org/abs/2111.05176&quot;&gt;Tilly et al&lt;/a&gt;. It is a really great piece of work and it made my life much easier. Therefore I consider this article a light-weight review of the current state of VQE, but if you’d prefer an actual deep scientific dive, that’s the place to go!&lt;/p&gt;

&lt;p&gt;Without further ado, let’s start with…&lt;/p&gt;

&lt;h1 id=&quot;ansatz-design&quot;&gt;Ansatz design&lt;/h1&gt;

&lt;p&gt;Ansatz design is a big part of ongoing research for VQE. However, I won’t be going into more details in this article, for a couple of reasons:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;I covered ansatz design in &lt;a href=&quot;/vqas-challenges.html&quot; target=&quot;_blank&quot;&gt;the previous part&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Reviewing various ansatzes would require some introduction to quantum chemistry, which is beyond the scope of this piece.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If anyone is interested, you can find a great review in &lt;a href=&quot;https://arxiv.org/abs/2103.08505&quot;&gt;Fedorov et al.&lt;/a&gt; or in more details in &lt;a href=&quot;https://arxiv.org/abs/2109.15176&quot;&gt;Anand et al.&lt;/a&gt; And if you need some introduction to quantum chemistry, the first part of &lt;a href=&quot;https://arxiv.org/abs/1812.09976&quot;&gt;this review by Cao et al&lt;/a&gt; is a decent starter.&lt;/p&gt;

&lt;h1 id=&quot;hamiltonian-construction&quot;&gt;Hamiltonian construction&lt;/h1&gt;

&lt;p&gt;This is a topic that requires way more quantum chemistry background than I have. I found section 3 and 4 of &lt;a href=&quot;https://arxiv.org/abs/2111.05176&quot;&gt;Tilly et al.&lt;/a&gt; covers this topic way better than I would, so if you’re looking for a good reference, that’s the place. It contains explanations of concepts such as the Jordan-Wigner or Bravyi-Kitaev transformations, which allow us to translate Hamiltonians from the realm of quantum chemistry to quantum computing and which are definitely some terms I’ve come across a lot but did not understand for quite a long time.&lt;/p&gt;

&lt;p&gt;It’s also worth checking out &lt;a href=&quot;https://warrenalphonso.github.io/qc/hubbard&quot;&gt;this tutorial&lt;/a&gt; to  the Fermi-Hubbard model by Warren Alphonso, it also explains some of these concepts very well.&lt;/p&gt;

&lt;p&gt;Ok, after these two disappointingly short sections, let’s get into concepts which do not require background in quantum chemistry!&lt;/p&gt;

&lt;h1 id=&quot;measurement-problem&quot;&gt;Measurement problem&lt;/h1&gt;

&lt;p&gt;VQE is basically an estimation problem – given a parameterized quantum circuit you want to estimate the expectation value of an operator (Hamiltonian) with certain precision. Two big issues are how to design the circuit and how to get the right parameters, but we’ve talked about them a lot in &lt;a href=&quot;/vqas-challenges.html&quot; target=&quot;_blank&quot;&gt;the previous article&lt;/a&gt;. Now let’s talk about “certain precision” – we’ll work on a concrete example of a \(CO_2\) molecule. To be clear, this problem is associated with every “cost function evaluation” in VQE that we do while optimizing parameters, not just the final result.&lt;/p&gt;

&lt;p&gt;A standard accuracy that we desire in quantum chemistry is called “chemical accuracy” and is equal to 1kcal/mol&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, which is roughly equal to 1.6 mHa&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;). But for this exampe we want to be extra safe – in the end, these quantum devices are far from perfect, so let’s aim for an accuracy of \(\epsilon = 0.5 mHa\). Fortunately, the relation between the number of measurements we need to do and the target accuracy is fairly simple: \(M = \frac{K}{\epsilon^2}\). \(K\) is a constant that depends on a molecule of interest, the estimation strategy used&lt;sup id=&quot;fnref:3&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; and certain other assumptions about the problem. In &lt;a href=&quot;https://arxiv.org/abs/2012.04001&quot;&gt;Gonthier et al&lt;/a&gt; they calculated that for \(CO_2\) it’s \(K=8000\). After substituting values in the equation above it turns out we need 32 billions measurements to properly estimate the expectation value of interest. This number seems high, but to give you a better sense of how much it actually is, this is equivalent to (given some reasonable assumptions described in &lt;a href=&quot;https://arxiv.org/abs/2012.04001&quot;&gt;Gonthier et al&lt;/a&gt; ) roughly 39 days of calculations.&lt;/p&gt;

&lt;p&gt;Let’s stop here for a moment to appreciate that.&lt;/p&gt;

&lt;p&gt;We need to run a quantum computer, for 39 days, non stop, to get a &lt;strong&gt;single&lt;/strong&gt; estimation of energy&lt;sup id=&quot;fnref:4&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:4&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;And you know how many energy estimations you need to perform to actually find good parameters for VQE if we run an optimization loop? I tried it for a simple \(H_2\) molecule with much more optimistic assumptions and got 87, but it can easily increase to thousands.&lt;/p&gt;

&lt;p&gt;Therefore, one of the biggest challenges for VQE is how to reduce this number of measurements and fortunately, there are a couple of methods to do this. I described some of them in &lt;a href=&quot;/vqas-challenges.html&quot; target=&quot;_blank&quot;&gt;the previous post&lt;/a&gt;, like “interpolating algorithms”, and below you can find the description of how grouping and measurements allocation works. They tackle different components in the “overall VQA structure” (see &lt;a href=&quot;/VQAs-how-do-they-work.html&quot; target=&quot;_blank&quot;&gt;VQA post&lt;/a&gt;), so some of these methods can be used in conjunction.&lt;/p&gt;

&lt;h1 id=&quot;grouping&quot;&gt;Grouping&lt;/h1&gt;

&lt;p&gt;VQE is all about finding the lowest eigenvalue of a given Hamiltonian, which is expressed as a sum of Pauli terms. For each term we need to run a separate circuit and perform multiple measurements. Then we combine the results of all the runs and we calculate the energy of a given state based on that.&lt;/p&gt;

&lt;p&gt;However, there’s a big problem with this naive way of using VQE. Let’s say our Hamiltonian looks like this: \(X_0 + Y_1 + Z_2\). It consists of three terms and in the most basic implementation we would just run a separate circuit for each term. However, each term affects a different qubit, and hence, you can run just one circuit and measure all of them at the same time (we say that these terms are &lt;strong&gt;co-measurable&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;Let’s consider a slightly more complicated example:&lt;/p&gt;

\[Z_0 \cdot X_1 + Y_1 \cdot X_2 + X_2 \cdot X_3 + X_0 + Z_3\]

&lt;p&gt;There are a couple of ways to gather these terms in co-measurable groups, one being:&lt;/p&gt;

&lt;p&gt;Group 1: \(Z_0 \cdot X_1 + Z_3\) &lt;br /&gt;
Group 2: \(Y_1 \cdot X_2 + X_0\) &lt;br /&gt;
Group 3: \(X_2 \cdot X_3\) &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;And another being: &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Group 1: \(Z_0 \cdot X_1 + X_2 \cdot X_3\) &lt;br /&gt;
Group 2: \(Y_1 \cdot X_2 + X_0 + Z_3\) &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Obviously the second allows us to perform a smaller number of evaluations to get the same result.&lt;/p&gt;

&lt;p&gt;It turns out that performing grouping efficiently is already a pretty hard problem – there has been a lot of research in recent years to find better algorithms to do this. You can find a summary of these methods in &lt;a href=&quot;https://www.nature.com/articles/s41534-020-00341-7/tables/1&quot;&gt;Table 1 of Huggins et al&lt;/a&gt;. Some key takeaways from this table for our discussion:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Number of groups depends polynomially on the number of qubits&lt;sup id=&quot;fnref:5&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:5&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;. While “polynomial scaling” usually means “good” in algorithms, \(N^4\) might be actually pretty brutal in practice.&lt;/li&gt;
  &lt;li&gt;There are different tradeoffs that we need to take into account when choosing grouping methods. Some work best with certain QPU topologies, some others increase the number of gates, etc.&lt;/li&gt;
  &lt;li&gt;Smaller number of groups does not necessarily imply a smaller total number of overall measurements! More groups might actually allow us to get higher precision by achieving better energy estimation per group with the same number of measurements&lt;sup id=&quot;fnref:6&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:6&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;6&lt;/a&gt;&lt;/sup&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Section 5 of &lt;a href=&quot;https://arxiv.org/abs/2111.05176&quot;&gt;Tilly et al.&lt;/a&gt; provides an introduction into some of the grouping methods, so if this topic is of interest for you, that’s where you should go.&lt;/p&gt;

&lt;h1 id=&quot;measurements-allocation&quot;&gt;Measurements allocation&lt;/h1&gt;

&lt;p&gt;Let’s say we have our groups now and we want to actually run the circuits and get some measurements. Should we just go ahead and do that? Well, not necessarily.
Let’s say we have a Hamiltonian that looks like this:&lt;/p&gt;

\[H = H_1 + H_2 + H_3 = 5 Z_0 + 3 Z_1 + 2 Z_0 \cdot Z_1\]

&lt;p&gt;And a circuit which creates a state:&lt;/p&gt;

\[| \psi \rangle = ( \cos{(\frac{\pi}{6})} |00 \rangle +  \sin{(\frac{\pi}{6})} |10 \rangle)\]

&lt;p&gt;By calculating expectation values by hand, we can see that&lt;/p&gt;

&lt;p&gt;\(\langle H_1 \rangle = 5 \langle Z_0 \rangle = 5 \cdot 0.5 = 2.5\) &lt;br /&gt;
\(\langle H_2 \rangle = 3  \langle Z_1 \rangle = 3 \cdot 1 = 3\) &lt;br /&gt;
\(\langle H_3 \rangle = 2 \langle Z_0 \cdot Z_1 \rangle = 2 \cdot 0.5 = 1\) &lt;br /&gt;
\(\langle H \rangle = 6.5\) &lt;br /&gt;
Looks easy, right?&lt;/p&gt;

&lt;p&gt;But now let’s see what happens if we try to measure these on a QPU&lt;sup id=&quot;fnref:7&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:7&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;, with 100 shots for each term&lt;sup id=&quot;fnref:8&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:8&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;\(\langle H_1 \rangle = 5 \cdot 0.66 = 3.3\) &lt;br /&gt;
\(\langle H_2 \rangle = 3 \cdot 1.0 = 3\) &lt;br /&gt;
\(\langle H_3 \rangle = 2 \cdot 0.58 = 1.16\) &lt;br /&gt;
\(\langle H \rangle = 7.46\) &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Ok, let’s try once again, now with 1000 shots:&lt;/p&gt;

&lt;p&gt;\(\langle H_1 \rangle = 5 \cdot 0.488 = 2.44\) &lt;br /&gt;
\(\langle H_2 \rangle = 3 \cdot 1.0 = 3\) &lt;br /&gt;
\(\langle H_3 \rangle = 2 \cdot 0.504 = 1.008\) &lt;br /&gt;
\(\langle H \rangle = 6.448\) &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;As we can see, the estimates we got are not exact and they depend on the number of shots. So we can increase the accuracy by increasing the number of shots, problem solved, right? Well, not really, as when we increase the number of shots, we also increase the time of running calculations.&lt;/p&gt;

&lt;p&gt;Can we be smarter about it? Absolutely…&lt;/p&gt;

&lt;p&gt;One can use a fixed total number of shots (budget) and allocate it among various groups. So let’s say we have 300 shots in our budget, how should we allocate it?
The first approach is to do a uniform allocation, i.e. 100 shots for each operator. This is what we did in the first example. But we can do better than this. We know that the operators have weights 5, 3 and 2. So it would make sense to put most shots from our budget towards the first operator and least shots towards the last one. Let’s say we do that proportionally – all weights add up to 10, so we use \(\frac{5}{10}\) shots for \(H_1\) (150), \(\frac{3}{10}\) for \(H_2\) (90) and \(\frac{2}{10}\) for \(H_3\) (60). What did we get?&lt;/p&gt;

&lt;p&gt;\(\langle H_1 \rangle = 5 \cdot 0.53 = 2.65\) &lt;br /&gt;
\(\langle H_2 \rangle = 3 \cdot 1.0 = 3\) &lt;br /&gt;
\(\langle H_3 \rangle = 2 \cdot 0.66 = 1.32\) &lt;br /&gt;
\(\langle H \rangle = 6.97\) &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;This result is better from what we got from just using 100 shots per operator. But this could be a random fluke, so in order to evaluate that, we should calculate the standard deviation (&lt;strong&gt;std&lt;/strong&gt;) of our final energies. So after repeating my experiment 10000 times, it turns out that for uniform shot allocation, std is 0.469 and for proportional shot allocation it’s 0.420.&lt;/p&gt;

&lt;p&gt;You might wonder – proportional allocation is definitely better than uniform, but what is the optimal allocation strategy? Well, as always, the answer is not simple. It will generally depend on the exact grouping method used, and getting a perfect answer is generally not possible: indeed, the number of shots necessary depends on the standard deviation of each individual term, which itself depends on the current wavefunction on the quantum computer. In some cases it is possible to mathematically solve for the optimal allocation by making some assumptions about these standard deviations, for more details see &lt;a href=&quot;https://iopscience.iop.org/article/10.1088/1367-2630/aab919&quot;&gt;Rubin et al.&lt;/a&gt; section 5.1. &lt;a href=&quot;https://arxiv.org/pdf/2004.06252.pdf&quot;&gt;Arrasmith et al.&lt;/a&gt; is also a good reference for this problem.&lt;/p&gt;

&lt;p&gt;What we did so far was allocation of shots for a single evaluation of energy. But what if we wanted to have a shot budget for the whole optimization process? Perhaps at the beginning of the optimization we don’t need as much precision as towards the end?
One approach to this has been proposed in &lt;a href=&quot;https://arxiv.org/abs/1912.06007&quot;&gt;Cade et al.&lt;/a&gt; (but also described very well in &lt;a href=&quot;https://arxiv.org/abs/2111.13454&quot;&gt;Bonet-Monroig et al.&lt;/a&gt; ), which authors call “3-stage-approach”. It works by defining a shot budget for the whole optimization process and later dividing the optimization in 3 stages. As an example, they use 100, 1000 and 10000 samples in stages 1, 2 and 3 accordingly. However, different phases have assigned different numbers of energy evaluations. The ratio they proposed is 10:3:1, so for the first phase they use \(\frac{10}{10+3+1}\) of all energy evaluations, in the second \(\frac{3}{14}\) and just \(\frac{1}{14}\) in the last.&lt;/p&gt;

&lt;p&gt;This allows for much more efficient usage of the available resources, as you can see in the plot below (it’s, fig 6 from &lt;a href=&quot;https://arxiv.org/abs/1912.06007&quot;&gt;Cade et al.&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2022-01-12-vqe-challenges/01_three_stage.png#center&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is just one way to approach this problem, you can find others in &lt;a href=&quot;https://arxiv.org/abs/2108.10434&quot;&gt;Gu et al.&lt;/a&gt; or &lt;a href=&quot;https://arxiv.org/abs/2004.06252&quot;&gt;Arrasmith et al.&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;vqe-beyond-ground-states&quot;&gt;VQE beyond ground states&lt;/h1&gt;

&lt;p&gt;VQE is usually used for finding the ground state of a given Hamiltonian. However, it could also be used to solve other problems, such as:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Finding excited states of the system&lt;/li&gt;
  &lt;li&gt;Calculating vibrational spectrum of a molecule&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;finding-excited-states-of-a-system&quot;&gt;Finding excited states of a system&lt;/h2&gt;

&lt;p&gt;In many cases we’re interested in finding the excited states of a given system, not just the ground state. For example, in order to get information about the color of a material we need to know what the energy difference between the ground stare and first excited state of the molecule is. One approach to do this has been described in &lt;a href=&quot;https://arxiv.org/abs/1603.05681&quot;&gt;McClean et al.&lt;/a&gt; and &lt;a href=&quot;https://journals.aps.org/prx/pdf/10.1103/PhysRevX.8.011021&quot;&gt;Colless et al.&lt;/a&gt; It basically boils down to the following steps:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Run a regular VQE in order to find the ground state of the system.&lt;/li&gt;
  &lt;li&gt;Once the algorithm has converged, modify the Hamiltonian in such a way that it contains information about excited states.&lt;/li&gt;
  &lt;li&gt;Measure new Hamiltonian.&lt;/li&gt;
  &lt;li&gt;Perform some classical postprocessing of the results.&lt;/li&gt;
  &lt;li&gt;Voila!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are many other variations of VQE, if this is of interest to you I recommend section 9 of &lt;a href=&quot;https://arxiv.org/abs/2111.05176&quot;&gt;Tilly et al.&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;calculating-vibrational-modes&quot;&gt;Calculating vibrational modes&lt;/h2&gt;

&lt;p&gt;Another interesting property that we might want to learn is associated with the vibrations existing in the molecule. What is it about? Well, atoms in the molecules are not rigid, they are in constant motion in respect to each other and this movement, the vibrations, can affect the properties of the molecule in non-trivial ways. 
This is important for topics such as astrochemistry or modeling fuel combustion, but also particularly useful for a class of molecules that have certain structures.&lt;/p&gt;

&lt;p&gt;In principle, we can use the old good VQE to solve it – we just need the to use a different Hamiltonian, which describes those vibrational modes. However, since this problem is different from the electronic structure problem that we usually solve, there are somewhat different considerations, e.g. we use different mappings to construct the Hamiltonian or we need to pay more attention to the excited states.&lt;/p&gt;

&lt;p&gt;If you would like to learn more about this topic, I talked about it with Nicolas Sawaya, research scientists working at Intel in &lt;a href=&quot;/episodes.html#NISP2&quot;&gt;my podcast&lt;/a&gt; and here you can find &lt;a href=&quot;https://arxiv.org/abs/2009.05066&quot;&gt;his paper&lt;/a&gt; where he describes these ideas in more details.&lt;/p&gt;

&lt;h2 id=&quot;outside-of-quantum-chemistry&quot;&gt;Outside of quantum chemistry&lt;/h2&gt;

&lt;p&gt;In principle you can use VQE for any situation where you have a matrix and you want to learn what its lowest eigenvalue is.&lt;/p&gt;

&lt;p&gt;One example can be using VQE for solving combinatorial optimization problems. Usually, we think about using QAOA for such problems, but QAOA also takes a Hamiltonian as a problem, so we could use VQE to find its ground state as well. If you’d like to better understand the difference, I have covered the difference between these two methods in my &lt;a href=&quot;/Quantum-Approximate-Optimization-Algorithm-Explained.html&quot; target=&quot;_blank&quot;&gt;“QAOA explained” article&lt;/a&gt;. An example of using VQE for combinatorial optimization problems can be found e.g.: in &lt;a href=&quot;https://arxiv.org/abs/2102.05566&quot;&gt;Liu et al.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apart from that, I have not encountered any particularly exciting or promising use cases for VQE outside of chemistry, so I’m not going to talk about it too much. However, if you know one, please leave me a comment under this article and I will be happy to include it :)&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;p&gt;As it turns out, getting to the forefront of VQE actually requires more quantum chemistry background than I expected, hence article ended up being shorter than I expected.&lt;/p&gt;

&lt;p&gt;If you’d like to get deeper into the topic, follow the references I left throughout the text and make sure to spend some time with &lt;a href=&quot;https://arxiv.org/abs/2111.05176&quot;&gt;Tilly et al&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;I wanted to thank people who helped me review the draft!&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Rafał Ociepa&lt;/li&gt;
  &lt;li&gt;Nicolas Sawaya&lt;/li&gt;
  &lt;li&gt;Jérôme Gonthier&lt;/li&gt;
  &lt;li&gt;Boniface Yogendran&lt;/li&gt;
  &lt;li&gt;Peter Johnson&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don’t want to miss the next (and the last!) part of the series on VQAs, which will be a deep dive into QAOA, &lt;a href=&quot;https://mailchi.mp/eaffe4a3a59a/mustythoughts&quot;&gt;sign up for the newsletter&lt;/a&gt;.
And since QAOA is kind of my thing, expect this to be a really deep dive – I can’t wait to write it!&lt;/p&gt;

&lt;p&gt;edit: you can find it &lt;a href=&quot;/qaoa-challenges.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;) !&lt;/p&gt;

&lt;p&gt;Have a nice day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;P.S. The graphics I used as a “thumbnail” on the main page of my blog comes from the &lt;a href=&quot;https://www.wombo.art&quot;&gt;Wombo project&lt;/a&gt;. It’s amazing!&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
Footnotes:&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Why does anyone use this particular number? As it gives you order-of-magnitude correct answers to reactions rates, based on Arrhenius equation at room temperature. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;mHa is &lt;a href=&quot;https://en.wikipedia.org/wiki/Hartree&quot;&gt;a unit of energy&lt;/a&gt; used in quantum chemistry. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;For example it might change depending on whether you group measurements or not. &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:4&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Nowadays you need to recalibrate your device every couple of hours in order to make sure its performance doesn’t degregate, &lt;a href=&quot;https://twitter.com/mstechly/status/1466883105072066561?s=20&quot;&gt;source&lt;/a&gt;. &lt;a href=&quot;#fnref:4&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:5&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;It’s actually in the number of spin orbitals, which corresponds to the number of qubits in the most commonly used Jordan-Wigner transform. &lt;a href=&quot;#fnref:5&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:6&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;For more details see &lt;a href=&quot;https://www.nature.com/articles/s41534-020-00341-7/tables/1&quot;&gt;Huggins et al&lt;/a&gt;, and section 5.3 from Tilly et al., or section V of &lt;a href=&quot;https://journals.aps.org/prxquantum/pdf/10.1103/PRXQuantum.2.040320&quot;&gt;Yen et al.&lt;/a&gt; &lt;a href=&quot;#fnref:6&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:7&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Well, to be honest with you, I have used a simulator ;) &lt;a href=&quot;#fnref:7&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:8&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;We often say “shots” instead of “measurements” in QC. &lt;a href=&quot;#fnref:8&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Mon, 10 Jan 2022 12:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/vqe-challenges.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/vqe-challenges.html</guid>
			</item>
		
			<item>
				<title>VQAs - challenges and state of research</title>
				<description>&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;This is the fourth part of my series about Variational Quantum Algorithms (VQAs). In previous parts we learned how these algorithms work in theory, now it’s time to learn more about some challenges, current research, and practical considerations about them.&lt;/p&gt;

&lt;p&gt;In this article, we’ll focus on the general issues with running VQAs on quantum computers, regardless of their specific structure. We’ll go into more detail about challenges unique (or at least more characteristic) for VQE and QAOA in the next two posts.&lt;/p&gt;

&lt;p&gt;If you haven’t read the previous parts or you’re not familiar with these algorithms, here you can find previous parts of this series:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;/Variational-Quantum-Eigensolver-explained.html&quot;&gt;VQE – how does it work?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/Quantum-Approximate-Optimization-Algorithm-Explained.html&quot;&gt;QAOA – how does it work?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/VQAs-how-do-they-work.html&quot;&gt;VQAs – how do they work?&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also, Here’s a list of the concepts that we talked about in previous posts. If you’re not sure what they mean, please stop for a moment to refresh your memory, as I won’t be explaining them here again.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Ansatz (&lt;a href=&quot;/Variational-Quantum-Eigensolver-explained.html&quot;&gt;VQE article, “What the hell is Ansatz?”&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Hamiltonian (&lt;a href=&quot;/Variational-Quantum-Eigensolver-explained.html&quot;&gt;VQE article, “What VQE does”&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Expectation values (&lt;a href=&quot;/Variational-Quantum-Eigensolver-explained.html&quot;&gt;VQE article, “The variational principle”&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Hyperparameters (&lt;a href=&quot;/VQAs-how-do-they-work.html&quot;&gt;VQA article, “Basic setup”&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While writing this article I heavily relied on two excellent review papers: &lt;a href=&quot;https://arxiv.org/abs/2101.08448&quot;&gt;from Alan Aspuru-Guzik group of University of Toronto&lt;/a&gt; and &lt;a href=&quot;https://arxiv.org/abs/2012.09265&quot;&gt;a big collaboration of various institutions&lt;/a&gt;. You can find a lot more details there!&lt;/p&gt;

&lt;p&gt;Let’s begin!&lt;/p&gt;

&lt;h2 id=&quot;hardware-related-problems&quot;&gt;Hardware-related problems&lt;/h2&gt;

&lt;p&gt;No matter what algorithm you want to run on the NISQ devices, you need to deal with the following issues:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Noise&lt;/li&gt;
  &lt;li&gt;Connectivity&lt;/li&gt;
  &lt;li&gt;Size of the device&lt;/li&gt;
  &lt;li&gt;Limited gate-set&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;noise-types&quot;&gt;Noise types&lt;/h3&gt;

&lt;p&gt;Understanding how noise and error impact quantum computation is an entire subfield known as quantum characterization, verification and validation (QCVV). We’ll stick to just a cursory description of a few important concepts.&lt;/p&gt;

&lt;p&gt;On a physical device, two important concepts involving error are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Decoherence—unwanted interaction between the qubits and their environment that causes the quantum state of the qubits to lose its purity&lt;/li&gt;
  &lt;li&gt;Control error—physical operations (e.g. laser pulses) that are not exactly as intended, causing the actual quantum gates to differ from the target quantum gates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In practice, these are quite intertwined and difficult to separate. Generally, they lead to three types of error in a quantum computation:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Coherent error—during a quantum circuit the quantum state is shifted to a different quantum state&lt;/li&gt;
  &lt;li&gt;Stochastic error—during a quantum circuit the quantum state becomes an average of different quantum states&lt;/li&gt;
  &lt;li&gt;Measurement error—you might have a perfect quantum computer with zero noise and then at the end of the circuit, your measurement procedure might assign an incorrect state when you measure it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Coherent and stochastic error differ in how they cause overall error in a quantum circuit to accrue. Coherent error accrues less favorably in that the quantum state can continue to be shifted in the wrong direction. With stochastic error there can be some canceling out of the errors so that on average they leave you close to the intended state.&lt;/p&gt;

&lt;p&gt;If you’d like to learn more, see section 8.3 of Nielsen and Chuang. For those looking for a deeper rabbit hole, here are some more papers: &lt;a href=&quot;https://arxiv.org/abs/1510.05653&quot;&gt;Kueng et al.&lt;/a&gt;, &lt;a href=&quot;https://arxiv.org/abs/2104.01119&quot;&gt;Zhang et al.&lt;/a&gt;, &lt;a href=&quot;https://arxiv.org/abs/1710.02270&quot;&gt;Bravyi&lt;/a&gt; or &lt;a href=&quot;https://arxiv.org/abs/2001.09980&quot;&gt;Geller and Sun&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To give you some ideas about how it looks like on real devices we have today, let’s take a look at the specs of the device from ETH Zurich used in &lt;a href=&quot;https://journals.aps.org/prxquantum/abstract/10.1103/PRXQuantum.1.020304&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2021-05-26-vqas-challenges/01_table_specs.png#center&quot; alt=&quot;Table with device specs&quot; /&gt;
&lt;img src=&quot;/assets/images/2021-05-26-vqas-challenges/02_layout_specs.png#center&quot; alt=&quot;Device layout and specs&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As we can see, all the qubits have very different characteristics. There’s a lot of data here, so let’s focus on the following values:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;T1 and T2—they roughly define the lifetime of a qubit. T1 defines how long does it take for the qubit to go from \(\mid 1 \rangle\) to \(\mid 0 \rangle\) and T2 measures how quickly qubit loses its phase (see &lt;a href=&quot;https://ocw.mit.edu/courses/mathematics/18-435j-quantum-computation-fall-2003/lecture-notes/qc_lec19.pdf&quot;&gt;section 1.1 here&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;Readout assignment probability—this basically defines the measurement error. As you can see it’s different for states \(\mid 0 \rangle\) and \(\mid 1 \rangle\) (you can disregard state \(\mid 2 \rangle\) ).&lt;/li&gt;
  &lt;li&gt;Gate errors—the percentage values next to nodes (green) indicate one-qubit errors and next to edges the two-qubit errors (blue). This basically tells you what’s the probability that a given gate won’t do what it’s supposed to.&lt;/li&gt;
  &lt;li&gt;Gate speed—how long it takes to execute one gate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ok, what does it all mean?
Let’s use the most optimistic values for simplicity—lifetime of the qubit equal to 27.2\(\mu s\), gate errors 0.18% and 1.7%, and gate speed 50ns (see Fig 1c from the paper).&lt;/p&gt;

&lt;p&gt;This means that we can apply at most \(\dfrac{24.5 \mu s}{50 ns} \approx 500\) gates to still be able to get reasonable results. 
What does it look like if we take gate errors into account? The probability that the result you get for a single qubit is correct is equal to (1 - gate error)^(number of gates). So if you want to be 90% sure that you got the right result, you can run 50 gates. If 80% is enough that’s about 123 gates. 
What about 2-qubit gates? Well, you can use only 6 of them for the 90% case and 13 for the 80% case.&lt;/p&gt;

&lt;p&gt;To make things even worse, once you make a measurement, some of the measurements will be wrong anyway. I couldn’t find the number in this paper, but for Google’s Sycamore chip, readout error was 3.8% (see &lt;a href=&quot;https://www.nature.com/articles/s41586-019-1666-5&quot;&gt;Fig 2.&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Btw. I highly recommend the paper that I took the data from, it shows you what’s the state-of-the-art implementation of QAOA on a real device. And here’s &lt;a href=&quot;https://arxiv.org/abs/2004.04197&quot;&gt;another good example from Google&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There’s also statistical uncertainty (sometimes also called “sampling noise”)—this is the error that we introduce into our estimates by the fact that we cannot directly measure the wavefunction, we need to sample from it. So having 100 measurements gives you results with more uncertainty than having 10,000 measurements. We’ll probably talk more about how to deal with that in the next article.&lt;/p&gt;

&lt;p&gt;A good example of how the noise affects result are the plots of the optimization landscapes of 1 layer QAOA which came from Google’s Sycamore chip (&lt;a href=&quot;https://arxiv.org/abs/2004.04197&quot;&gt;Fig 3 in this paper&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2021-05-26-vqas-challenges/03_qaoa_landscape.png#center&quot; alt=&quot;Energy landscape&quot; /&gt;&lt;/p&gt;

&lt;p&gt;One way to deal with these issues (at least some of them) is to use Quantum Error Correction (QEC). QEC is a set of techniques that allow you to correct some errors that can happen in your circuit. If you‘ve ever heard about the distinction between “physical” and “logical” qubits, then you might know that by “logical” people usually mean “perfect, error-corrected qubits”. Once we have such qubits, we will be in the realm of Fault-Tolerant Quantum Computing (FTQC) The problem is that in order to implement one error-corrected qubit you have to use a LOT of physical qubits (which also depends on the level and type of errors), as we encode one logical qubit in an entangled state shared by multiple physical qubits. We can design this state in such a way that the quantum information is protected against different types of noise. But since in this article we’re talking about variational algorithms and the NISQ era, we won’t actually go into this, if you’re interested check out chapter 10 from Nielsen and Chuang.&lt;/p&gt;

&lt;p&gt;Another, quite straightforward, way to deal with some of these issues is to simply run short circuits. The fewer gates you have, the lower the chance something will go wrong. Obviously, improving the hardware also helps (or, as it turns out, improving control software responsible for gates, as shown &lt;a href=&quot;https://arxiv.org/abs/2010.08057&quot;&gt;here&lt;/a&gt;). But let’s get into some more algorithmic techniques.&lt;/p&gt;

&lt;h3 id=&quot;error-mitigation&quot;&gt;Error mitigation&lt;/h3&gt;

&lt;p&gt;Instead of correcting the errors and getting perfect results, we can try to &lt;em&gt;mitigate&lt;/em&gt; the errors. There are many interesting techniques (see &lt;a href=&quot;https://arxiv.org/abs/2011.01382&quot;&gt;here&lt;/a&gt; for a good review), here I’ll describe one of them to give you a general idea of how it can be achieved. It’s important to mention that these methods allow us to better estimate the expectation values of some operators. This means that we’ll be talking about getting certain real numbers with a specific precision, not about getting the correct set of 0s and 1s.&lt;/p&gt;

&lt;p&gt;One of the methods is called “Zero Noise Extrapolation” (&lt;a href=&quot;https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.119.180509&quot;&gt;source&lt;/a&gt;). The main idea is that if we just run our circuit, it will be affected by a certain base level of noise. Our goal would be to know the result for the “zero noise” case, but we can’t just fix the hardware so that it doesn’t have any noise. However, we can artificially increase (scale) the level of noise. So we’ll run our circuit a couple of times, with different levels of noise, and then we’ll extrapolate it to see what happens for the “zero noise” case.&lt;/p&gt;

&lt;p&gt;Here’s a picture that shows the idea:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2021-05-26-vqas-challenges/04_zne.png#center&quot; alt=&quot;ZNE&quot; /&gt;&lt;/p&gt;

&lt;p&gt;How do you artificially increase the noise? Well, there are a couple of methods to do that, one of them involves simply duplicating gates—we replace gate G by (G, G’, G), where by G’ I mean the inverse of G.&lt;/p&gt;

&lt;p&gt;There are other error mitigation techniques, but in general, they involve running several modified versions of the original circuit and performing some post-processing to get the value we’re interested in.&lt;/p&gt;

&lt;p&gt;If you’d like to use error mitigation techniques, there’s an open-source python library called &lt;a href=&quot;https://github.com/unitaryfund/mitiq&quot;&gt;mitiq&lt;/a&gt; developed by folks from &lt;a href=&quot;https://unitary.fund&quot;&gt;Unitary Fund&lt;/a&gt;. You can learn more about ZNE and other methods, as well as about mitiq from &lt;a href=&quot;https://www.youtube.com/watch?v=5KDQtWzJcfw&quot;&gt;this talk by Ryan LaRose&lt;/a&gt;  (which is also the source of the plot you see above).&lt;/p&gt;

&lt;p&gt;There’s one more important caveat here – what I described is mitigation by “classical postprocessing”. There’s another way to achieve error mitigation by performing certain actions during the execution of the circuit which counteract the noise.&lt;/p&gt;

&lt;h3 id=&quot;compilation&quot;&gt;Compilation&lt;/h3&gt;

&lt;p&gt;Well… If noise itself wasn’t bad enough, there are other issues which make its existence even worse. It’s the device connectivity (i.e. which qubits are directly connected, so you can use a two-qubit gate between them) and gate set (i.e. which gates you can directly execute on the hardware)&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;How do you deal with these? Two basic methods are compilation and ansatz design, and in this section, we’ll talk about the first of these. To be honest—I know very little about compilation, so this section definitely doesn’t do justice to the topic, though I think it’s important to include it for the sake of completeness.&lt;/p&gt;

&lt;p&gt;What is compilation? It’s transforming one quantum circuit into another one that does exactly the same thing.&lt;/p&gt;

&lt;p&gt;Usually, we do compilation for the following reasons (in no particular order):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Our circuit doesn’t map well on the hardware architecture (dealing with connectivity)&lt;/li&gt;
  &lt;li&gt;Our circuit uses gates that are not directly implemented on the device (dealing with the native gate set)&lt;/li&gt;
  &lt;li&gt;We want to minimize the number of gates (reducing the impact of noise). Usually, we care mostly about 2-qubit gates, as they are much more noisy than 1-qubit gates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are different approaches to compilation, here I present three that I’m aware of:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Rule-based—we define a set of rules (e.g. how to decompose a gate into a set of other gates) that we then simply apply to the circuit.&lt;/li&gt;
  &lt;li&gt;We treat circuits as some mathematical structure and perform some mathmagic to simplify it, for example using ZX calculus. Don’t ask me for any more details, I’ve personally chosen to just think about it as mathmagic (though to be honest I’ve heard &lt;a href=&quot;https://arxiv.org/abs/2012.13966&quot;&gt;this review&lt;/a&gt; is a decent intro to ZX calculus, I simply never got to reading it. There’s also this &lt;a href=&quot;https://github.com/Quantomatic/pyzx&quot;&gt;open source package&lt;/a&gt;.).&lt;/li&gt;
  &lt;li&gt;Machine Learning—well, you can also just throw some machine learning at the problem, as they did in &lt;a href=&quot;https://arxiv.org/abs/2007.14608&quot;&gt;Harrigan et al.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If anyone is interested in the topic &lt;a href=&quot;https://si2.epfl.ch/~demichel/research/quantum.html&quot;&gt;this article&lt;/a&gt; might be helpful. Another important theoretical result to mention is the Solovay-Kitaev  theorem—it basically says that we can approximately compile any unitary operation into a limited set of gates quite efficiently (with some caveats, of course, more on  &lt;a href=&quot;https://en.wikipedia.org/wiki/Solovay-Kitaev_theorem&quot;&gt;wiki&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;That’s it for now, if I learn more about the topic I’ll revisit and improve this part. Let’s now get into the topic much closer to my heart. Namely…&lt;/p&gt;

&lt;h2 id=&quot;optimization&quot;&gt;Optimization&lt;/h2&gt;

&lt;p&gt;Ok, we’ve covered some general, hardware-related issues. Now it’s time to talk about the more algorithmic part. One of the central components of VQAs is the optimization loop and there’s indeed a lot of research on this topic. So let’s see what are some of the main challenges involved:&lt;/p&gt;

&lt;h3 id=&quot;barren-plateaus&quot;&gt;Barren plateaus&lt;/h3&gt;

&lt;p&gt;Imagine you want to find the lowest point in some area. How would you do that? Well, you can just look around, follow the slope and you’ll eventually get somewhere. Doesn’t sound like the best possible strategy—if you’re in the mountains you’ll soon find some valley, though not necessarily the lowest/deepest one. But at least you’re getting somewhere. Do you know what’s a nightmare scenario in such a case?&lt;/p&gt;

&lt;p&gt;A huge desert.&lt;/p&gt;

&lt;p&gt;You’re not able to see anything but flat sand all the way to the horizon and the landscape constantly changes as the wind reshapes the dunes.&lt;/p&gt;

&lt;p&gt;What’s the only chance you have of actually finding what you’re looking for? Start from a point that’s so close to the valley you’re looking for that you just can’t miss it. What’s another name for a landscape like this?&lt;/p&gt;

&lt;p&gt;A barren plateau.&lt;/p&gt;

&lt;p&gt;In 2018 &lt;a href=&quot;https://www.nature.com/articles/s41467-018-07090-4&quot;&gt;Jarrod McClean et al.&lt;/a&gt; pointed out that there are two big problems with training variational quantum circuits.&lt;/p&gt;

&lt;p&gt;The first is that you can’t just run a single circuit and learn what the value of the gradient is (we’ve discussed it in the previous &lt;a href=&quot;/VQAs-how-do-they-work.html&quot;&gt;VQA post&lt;/a&gt;). You need to repeat a certain procedure several times and the more times you do it, the better accuracy you get.
This is not a big problem if your gradient is huge; let’s say it has a value of 9001. You just repeat the procedure several times and you know the ballpark. But what if your gradient has a value of 0.00001? Well, you have to run many many more circuits (for those interested—in the best case it scales as \(O(1/ \epsilon)\), where \(\epsilon\) is desired accuracy.)&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;The second is, that for random quantum circuits the gradient is really small in most places except for some small area where it’s not. And the chance that it’s arbitrarily close to zero for a random point grows exponentially with the number of qubits and number of parameters (see &lt;a href=&quot;https://pennylane.ai/qml/demos/tutorial_local_cost_functions.html&quot;&gt;this PennyLane tutorial&lt;/a&gt; for more context).&lt;/p&gt;

&lt;p&gt;Ok, now let’s put it together in plain English.
In most places, the gradient is close to 0 and from the practical perspective, there’s a limit to the precision up to which you can estimate it. So basically unless you start close to good parameters, you have no clue how to tweak your parameters to get anything reasonable. And the more qubits or gates you have, the worse it gets.&lt;/p&gt;

&lt;p&gt;I also like the plot below (&lt;a href=&quot;https://arxiv.org/abs/2001.00550&quot;&gt;source: Cerezo et al.&lt;/a&gt;) which visualizes the problem. It shows how the landscape changes when we increase number of variables in the cost function (from 4 (blue) to 24 (orange)).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2021-05-26-vqas-challenges/05_barren_plateau.png#center&quot; alt=&quot;Barrren plateau&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As a side note, I find this problem shows quite well one of the problems with the state of quantum computing research. As long as you’re running small simulations, this effect is too small to be noticed. So some previous small experiments might be fundamentally flawed because if you tried to scale them up, you would hit the barren plateau problem. On the other hand, there might be other problems that we’ll notice only when we’ll get to hundreds of qubits. These are exciting times to be working on QC!&lt;/p&gt;

&lt;h3 id=&quot;dealing-with-barren-plateaus&quot;&gt;Dealing with barren plateaus&lt;/h3&gt;

&lt;p&gt;Not surprisingly, these findings resulted in quite some stir in the community. People started coming up with various methods to solve this issue and here we’ll go through a couple of them. Let’s look at the two common approaches for dealing with this problem.&lt;/p&gt;

&lt;p&gt;The first way is to simply initialize your parameters close enough to the minimum so that your optimizer can find its way to the minimum. This might sound like a no-brainer—sure we want to have a good way of initializing the parameters, right? Actually, it’s not that obvious, as in classical machine learning, it usually is not that big of a problem and you can get away with initializing parameters randomly. 
So how do you choose a reasonable parameter initialization? There are several methods to do that, one of them is the so-called &lt;a href=&quot;https://arxiv.org/abs/2006.14904&quot;&gt;“layer by layer” (LBL) training&lt;/a&gt;&lt;sup id=&quot;fnref:3&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Many ansatzes we use consist of layers. Basically, all the layers are identical and (at least in theory), the more layers you add, the more powerful your circuit is (QAOA is a good example). So here the idea is that we start from training our algorithm for one layer. Since barren plateaus depend on both the number of qubits and the depth of the circuit, it should allow us to avoid them. Then, once the 1st layer is optimized, we treat it as fixed and train parameters for the second layer. Once its training is finished, we proceed with the next one until we have all the layers we wanted.
Now we have some initial guesses of the parameters and we proceed to train more than one layer at a time e.g. 25% of them.&lt;/p&gt;

&lt;p&gt;So at first, we try to avoid barren plateaus by training only a handful of parameters at the time. And then, we try to avoid them by starting from a point that is already a pretty good guess.&lt;/p&gt;

&lt;p&gt;The second idea is about restricting the parameter space—if you can design your ansatz specifically for a given problem, it might be less expressible (we’ll talk about expressibility in a moment), but as long as it can find the solution to your problem, it doesn’t really matter.&lt;/p&gt;

&lt;p&gt;Just to put things in perspective, since the initial paper published in March 2018, I’ve counted 18 papers with the words “barren plateaus” in the title and the phrase was cited 263 times according to Google Scholar. If this problem sounds interesting to you, some good papers to read would be those about what are the sources plateaus (&lt;a href=&quot;https://arxiv.org/abs/2010.15968&quot;&gt;entanglement&lt;/a&gt; and &lt;a href=&quot;https://arxiv.org/abs/2007.14384&quot;&gt;noise&lt;/a&gt;), or some &lt;a href=&quot;https://www.nature.com/articles/s41467-021-21728-w&quot;&gt;mathematical ways&lt;/a&gt; to avoid them.&lt;/p&gt;

&lt;h3 id=&quot;choice-of-optimization-methods&quot;&gt;Choice of optimization methods&lt;/h3&gt;

&lt;p&gt;A question that I sometimes hear is “are there optimizers that are specific for quantum computing”?
In principle no, as you can treat the calculation of the cost function in the variational loop as a black box, and therefore you can use any optimization method for that.
However, there are certain challenges associated with our particular black box that might make some optimizers a much better fit than the others.&lt;/p&gt;

&lt;p&gt;So the first challenge is that in general, we consider the time spent running algorithms on a quantum chip much more expensive (money-wise) than on a classical one. Therefore, since we use it exclusively for calculating the value of the cost function, evaluating the cost function is the most expensive part of the algorithm. Thus, it is something we want to do as little as we can get away with (isn’t it somewhat ironic, that when we run calculations of a quantum computer, we want to use it as little as possible?).
The practical meaning of this is that we want to use optimizers that can work well while making a relatively small number of evaluations.&lt;/p&gt;

&lt;p&gt;The second challenge is the probabilistic nature of the cost function evaluation. In order to deal with it, you need to repeat your circuit more times to have better accuracy. Or using an optimizer, which works well with some level of noise/uncertainty.&lt;/p&gt;

&lt;p&gt;The third challenge is the existence of noise. Noise might have different effects on the landscape of the cost function. One is “flattening of the landscape,” another might be the existence of some artifacts. Both these effects are visible in the plot we’ve QAOA landscapes we’ve seen before.&lt;/p&gt;

&lt;p&gt;Last, but not least, it’s extremely hard to study the behavior of the optimizers. 
They often rely on hyperparameters (e.g.: step size in gradient descent), their behavior might be different for different problems. This is a problem not only for QC, this is the same for classical optimization problems or regular Machine Learning. Also, the cost of implementing and checking the performance of various optimizers is really high, so researchers usually either decide to use one that worked for them in the past or one that is commonly used or perhaps check a couple of them and pick the one that looks reasonable. Yet another issue is that sometimes these methods are studied without the noise (where they work well), but they don’t perform that well in the presence of noise.&lt;/p&gt;

&lt;p&gt;My plan was to follow this section with a selection of some widely used optimizers, and explanations why some of them are widely used. But after digging into the literature, I wasn’t able to come up with anything satisfactory. It basically looks that right now we have little to no idea why certain optimizers work while others don’t. So if you’re interested in this topic, I recommend the following papers: &lt;a href=&quot;https://arxiv.org/abs/2005.11011&quot;&gt;Sung et al.&lt;/a&gt; and &lt;a href=&quot;https://arxiv.org/abs/2004.03004&quot;&gt;Lavrijsen et al.&lt;/a&gt;. Excellent work which shows how hard it is to analyze these and how much we still need to learn.&lt;/p&gt;

&lt;h2 id=&quot;ansatz-design&quot;&gt;Ansatz design&lt;/h2&gt;

&lt;p&gt;We’ve already mentioned ansatzes in the previous section, but let’s now make them our main focus. Ansatz design is an active field of research, some of my favorite papers are those by &lt;a href=&quot;https://arxiv.org/abs/1905.10876&quot;&gt;Sukin Sim and other folks from Zapata&lt;/a&gt;, &lt;a href=&quot;https://quantum-journal.org/papers/q-2021-03-29-422/&quot;&gt;Lena Funcke et al.&lt;/a&gt; and &lt;a href=&quot;https://arxiv.org/abs/2105.01114&quot;&gt;J. Lee et al.&lt;/a&gt;. Since I like to be practical, let’s look at this from a practical perspective:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How can you tell whether an ansatz is a good one?&lt;/li&gt;
  &lt;li&gt;How to design a good ansatz?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;is-my-ansatz-any-good&quot;&gt;Is my ansatz any good?&lt;/h3&gt;

&lt;p&gt;In the NISQ world, when you have an ansatz, you want to ask yourself two questions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How powerful is my ansatz?&lt;/li&gt;
  &lt;li&gt;How much does it cost to use it?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What does powerful mean in this context? One component is its expressibility—i.e. whether we can create an arbitrary state with it. The best illustration of this concept I know is the picture below (&lt;a href=&quot;https://arxiv.org/abs/1905.10876&quot;&gt;source Sim et al.&lt;/a&gt;). It shows how changing the circuit changes the amount of the space that we can cover.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2021-05-26-vqas-challenges/06_expressibility.png#center&quot; alt=&quot;Expressibility&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Another useful metric is the entangling capability of an ansatz. We want the ansatz to be able to produce highly entangled states, as the more entanglement there is, the more “quantum” it is and potentially more useful.&lt;/p&gt;

&lt;p&gt;These metrics are the best we have, but unfortunately, they are not really very good. 
Expressibility might not be a good metric for large circuits as more expressive circuits might be also more prone to barren plateaus or have more parameters and be harder to optimize. 
Entangling capability—well, creating circuits that are hard to simulate just for its own sake doesn’t make much sense.&lt;/p&gt;

&lt;p&gt;Therefore, we can use these two metrics as something that can help us rule out bad ansatzes, but not necessarily find the best ones. Some further reading: &lt;a href=&quot;https://arxiv.org/abs/2102.01659&quot;&gt;Haug et al.&lt;/a&gt; and &lt;a href=&quot;https://arxiv.org/abs/2001.00550&quot;&gt;Cerezo et al.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it comes to cost, typical metrics to measure the cost are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Circuit depth—the more shallow the circuit, the better chance that noise won’t destroy our quantum state.&lt;/li&gt;
  &lt;li&gt;Circuit connectivity—since on many NISQ devices we cannot directly connect arbitrary qubits, it might be beneficial to have an ansatz which only requires connectivity between nearest neighbors.&lt;sup id=&quot;fnref:4&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:4&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;Number of parameters—fewer parameters mean an easier job for optimization.&lt;sup id=&quot;fnref:5&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:5&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;Number of two-qubit gates—usually two-qubit gates are much more noisy than one-qubit gates, so this number is often used to compare different circuits.&lt;/li&gt;
  &lt;li&gt;Gate types—it’s a little bit more indirect, but if we have an ansatz which uses gates that are not available on our hardware, we will need to decompose gates, which increases circuit depth.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;how-to-design-a-good-ansatz&quot;&gt;How to design a good ansatz&lt;/h3&gt;

&lt;p&gt;Now we want to have an ansatz for which expressibility and entangling capabilities are high, while we keep all the associated costs to a minimum, right?&lt;/p&gt;

&lt;p&gt;Easier said than done :) How do you come up with the idea for the ansatz in the first place? At the moment there are two main schools: problem-motivated and hardware-motivated ansatz design.&lt;/p&gt;

&lt;p&gt;To design a problem-motivated ansatz, you do things like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Thinking hard about the problem you want to solve&lt;/li&gt;
  &lt;li&gt;Analyzing whether there is any structure in the problem you can exploit&lt;/li&gt;
  &lt;li&gt;Reading existing literature on “classical” (meaning not QC) methods for solving this problem to get inspired.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To design a hardware-motivated ansatz, you do things like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Memorizing technical specs of the device you have&lt;/li&gt;
  &lt;li&gt;Figuring out how to make maximally expressive ansatz given the hardware constraints&lt;/li&gt;
  &lt;li&gt;Reading existing literature on this type of hardware to find some tricks you can exploit or traps you can fall into.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As always, both methods have some pros and cons that I’ve summarized below, and combining both of them probably is the best solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem-motivated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Can exploit problem structure&lt;/li&gt;
  &lt;li&gt;Can be used with different devices&lt;/li&gt;
  &lt;li&gt;Doesn’t require intricate knowledge about the hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Might not be implementable on specific hardware&lt;/li&gt;
  &lt;li&gt;Might perform poor on real hardware while working perfectly in theory&lt;/li&gt;
  &lt;li&gt;Probably will work only for a narrow class of problems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hardware-motivated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Allows to squeeze the most out of the device&lt;/li&gt;
  &lt;li&gt;Doesn’t require intricate knowledge about the problem domain&lt;/li&gt;
  &lt;li&gt;Can be used for solving multiple problems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Might not take advantage of the problem’s structure&lt;/li&gt;
  &lt;li&gt;Is probably useful only for a very specific device&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One consequence of coming from the problem-focused approach is that you don’t necessarily want to have the maximally expressible ansatz. While such an ansatz would by definition cover your solution, it will also cover all the solutions that you might a priori know are useless. Often we have some knowledge about the problem and we know that a certain family of states does not contain the ground state, so we can make our ansatz simpler (and hence lower the cost) by designing it in a way that excludes such states.&lt;/p&gt;

&lt;h3 id=&quot;how-to-get-a-good-ansatz-without-designing-it&quot;&gt;How to get a good ansatz without designing it?&lt;/h3&gt;

&lt;p&gt;There’s yet another method for finding a good ansatz—let the algorithm figure it out. To do that, we use what are called “adaptive” algorithms. The main idea is that we modify not only the parameters of the circuit, but also the structure of the circuit itself during the optimization.&lt;/p&gt;

&lt;p&gt;One example of such a method and the first such algorithm proposed is a method called ADAPT-VQE. Here’s a general description of how it works:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Define an “operator pool”—this basically contains the bricks that you’ll be building your algorithm from.&lt;/li&gt;
  &lt;li&gt;Create some initial reference state as the first iteration of your ansatz.&lt;/li&gt;
  &lt;li&gt;Calculate the gradient of the expectation value for each operator in the pool using your ansatz.&lt;/li&gt;
  &lt;li&gt;Add the operator with the biggest gradient to the ansatz (along with a new variational parameter).&lt;/li&gt;
  &lt;li&gt;Run “regular VQE” with this ansatz to optimize all the parameters of the ansatz.&lt;/li&gt;
  &lt;li&gt;Go to step 3.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a more detailed description please see &lt;a href=&quot;https://www.nature.com/articles/s41467-019-10988-2&quot;&gt;Grimsley et al.&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Another example of an adaptive method is &lt;a href=&quot;https://arxiv.org/abs/2010.00629&quot;&gt;PECT&lt;/a&gt;, which I have mentioned in the &lt;a href=&quot;/VQAs-how-do-they-work.html&quot;&gt;previous article&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;Here are some comments about these methods:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;These algorithms are usually more difficult to implement on the classical side, as they involve more than just taking a parametrized circuit and adjusting the parameters, but also changing its structure.&lt;/li&gt;
  &lt;li&gt;It’s not obvious whether such an approach actually yields better results or produces them faster. There are two effects that are at play—on one hand, the algorithm should need more time than a conventional one because it needs to find the correct structure of the ansatz and optimize its parameters at the same time (in point 5 of ADAPT-VQE we’re running a full, regular VQE!). On the other hand, doing both at the same time makes the optimization process actually simpler as it doesn’t introduce (or gets rid of) parameters that are useless. In principle it should find better solutions, however, it might take longer—it’s hard to say before actually running it for a specific problem.&lt;/li&gt;
  &lt;li&gt;These algorithms seem especially promising for NISQ devices, as they produce ansatzes that are shallower than those designed by hand (and hence there’s less room for noise), but also they naturally find circuits that take into account all the quirks of a specific device. For example, in ADAPT-VQE you can create an operator pool in such a way that it leads to hardware-efficient ansatzes (see &lt;a href=&quot;https://journals.aps.org/prxquantum/abstract/10.1103/PRXQuantum.2.020310&quot;&gt;Tang et al.&lt;/a&gt; ).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to learn more about ADAPT-VQE and the problem of ansatz design in general, Sophia Economou (one of the authors of ADAPT-VQE) gave an excellent 25-minute talk about these during one of Quantum Research Seminar Toronto (QRST).&lt;/p&gt;

&lt;p&gt;As a side note, this approach reminds me of a NEAT (&lt;a href=&quot;http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf&quot;&gt;Neuroevolution of Augmenting Topologies&lt;/a&gt;) algorithm used for classical neural networks. You can find &lt;a href=&quot;https://www.youtube.com/watch?v=qv6UVOQ0F44&quot;&gt;an excellent video&lt;/a&gt; showing how a NEAT algorithm learns to play Mario.&lt;/p&gt;

&lt;h2 id=&quot;interpolating-algorithms&quot;&gt;Interpolating algorithms&lt;/h2&gt;

&lt;p&gt;The approach which makes me particularly excited is something I’ll call “interpolating algorithms.”&lt;sup id=&quot;fnref:6&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:6&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;6&lt;/a&gt;&lt;/sup&gt; What do we mean by “interpolating”? The fact that the performance of these algorithms can interpolate between that of near-term and far-term algorithms. You can adjust some hyperparameters of the algorithm depending on what hardware you’re running on, so no matter what stage of development of quantum hardware we’re currently at (from now to perfect qubits), you can find hyperparameters that will allow you to actually run the algorithm within the limitations of the hardware and squeeze most out of it.&lt;/p&gt;

&lt;p&gt;Imagine you have circuit A that allows you to estimate the ground state of some Hamiltonian. If you want to estimate it to precision \(\epsilon\), you would need to run circuit A \(N_A=\frac{1}{\epsilon^2}\) times. You also have circuit B, that allows you to get the same precision, but you only need to run it \(N_B = log(\frac{1}{\epsilon})\) times. However, circuit B is \(\frac{1}{\epsilon}\) times longer and hence not very practical for the devices we have today. But what if we had some way to interpolate between these two approaches so that we would have a parameter that makes the circuit longer, but also decreases the number of samples needed?&lt;/p&gt;

&lt;p&gt;Let’s see what it could look like in practice. Let’s say \(\epsilon=10^{-3}\). This means we need to run circuit A 1,000,000 times and each execution of circuit A takes 1ms. So the total runtime will be 1,000s. For circuit B we need to run it log(1000) times, which is just 3 times (sic!), though each execution takes 1 second. Hence we would get our result in just 3 seconds. Unfortunately, as we have seen earlier, our circuit probably won’t be able to run for as long as 1 second anytime soon. However, this class of algorithms gives us a way to construct such a circuit that it requires less measurements but its execution time still fits our hardware.&lt;/p&gt;

&lt;p&gt;While this explanation is &lt;strong&gt;oversimplified&lt;/strong&gt; , going into more details is, again, way beyond the scope of this article. If you’d like to learn more, three examples of similar approach are &lt;a href=&quot;https://arxiv.org/abs/1802.00171&quot;&gt;“alpha-VQE”&lt;/a&gt;, &lt;a href=&quot;https://arxiv.org/abs/2012.03348&quot;&gt;“Power Law Amplitude Estimation”&lt;/a&gt; and 
&lt;a href=&quot;https://www.zapatacomputing.com/publications/juice/&quot;&gt;“Bayesian Inference with Engineered Likelihood Functions for Robust Amplitude Estimation”&lt;/a&gt; by my colleagues from Zapata . (I strongly recommend watching &lt;a href=&quot;https://www.youtube.com/watch?v=RifDO1zBYjI&quot;&gt;this 3.5-minute video&lt;/a&gt; explaining the gist of it).&lt;/p&gt;

&lt;h2 id=&quot;other-issues&quot;&gt;Other issues&lt;/h2&gt;

&lt;p&gt;This article has been quite dense, so here I wanted to just point to some other final issues that are prevalent in contemporary research, without spending too much time on any of them:&lt;/p&gt;

&lt;h3 id=&quot;lack-of-common-benchmarks-and-standardization&quot;&gt;Lack of common benchmarks and standardization&lt;/h3&gt;

&lt;p&gt;As you could see from the section about optimizers, it’s really hard to benchmark certain solutions. It’s not only extremely costly to compare multiple methods, but it’s also really hard to design such an experiment in a way that makes the comparison fair and broadly useful.&lt;/p&gt;

&lt;p&gt;On top of that, as can be expected for a discipline at such an early stage, we lack standardization. This is healthy, as it allows for more experimentation and exploration, but it makes it much harder to compare results, as you basically never compare apples to apples.&lt;/p&gt;

&lt;h3 id=&quot;we-have-no-idea-what-were-doing&quot;&gt;We have no idea what we’re doing&lt;/h3&gt;

&lt;p&gt;The truth is that QC is a totally new paradigm of computation that we don’t comprehend. I‘ve had the opportunity to talk with some excellent researchers in the field and while their level of understanding and intuition about these matters is far beyond my reach, they’re quite open about the fact that we all just started scratching the surface. There are some fundamental questions that no one knows the answers to, which is both a challenge and a source of excitement.&lt;/p&gt;

&lt;h3 id=&quot;scaling-for-bigger-devices&quot;&gt;Scaling for bigger devices&lt;/h3&gt;

&lt;p&gt;In most of our research, we’re limited in what we can analyze by the size of the devices we’re able to simulate with computers (rarely beyond 30 qubits). Bigger devices are extremely scarce—there is literally a handful of them in the world—so we have very little understanding of how these methods will scale beyond 50 qubits. And while some results seem independent of size or we have some theory that explains how they will behave, for many we don’t. And right now there’s no other way of knowing other than building bigger devices and trying them out.&lt;/p&gt;

&lt;h2 id=&quot;closing-notes&quot;&gt;Closing notes&lt;/h2&gt;

&lt;p&gt;Thank you for going through this whole article! If this was of interest for you, you’ll definitely like &lt;a href=&quot;/vqe-challenges.html&quot;&gt;the next part, where I focused on VQE&lt;/a&gt;. The best way not to miss any future articles is to subscribe to &lt;a href=&quot;https://mailchi.mp/eaffe4a3a59a/mustythoughts&quot;&gt;the newsletter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So just in case you have missed them, I recommend checking out:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.mustythoughts.com/podcast.html&quot;&gt;My podcast&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/qosf/monthly-challenges/&quot;&gt;QOSF monthly challenges&lt;/a&gt;—especially if you’d like to hone both your coding skills and learn some interesting QC concepts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Last, but not least, I wanted to thank all the people that helped me write this article. And this time that was more people than usually:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://twitter.com/dallairedemers&quot;&gt;Pierre-Luc Dallaire-Demers&lt;/a&gt; for being an infinite well of knowledge and references. His help reduces the complexity of looking for references from \(O(n)\) (searching through \(n\) papers) to \(O(1)\) (asking one Pierre-Luc).&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.linkedin.com/in/rafal-ociepa-39713499/&quot;&gt;Rafał Ociepa&lt;/a&gt; for all editing and stylechecks.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://albacl.github.io&quot;&gt;Alba Cervera-Lierta&lt;/a&gt;, &lt;a href=&quot;https://github.com/ntwalibas&quot;&gt;Ntwali Bashige&lt;/a&gt; and  &lt;a href=&quot;https://scholar.google.com/citations?user=O3R-_YEAAAAJ&amp;amp;hl=pl&amp;amp;oi=ao&quot;&gt;Peter Johnson&lt;/a&gt; for reviewing the whole thing with their eagle eyes and making sure I’m not saying something stupid.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.linkedin.com/in/amfa-darwish&quot;&gt;Ahmed Darwish&lt;/a&gt; and &lt;a href=&quot;https://github.com/alexjuda&quot;&gt;Alex Juda&lt;/a&gt; also for reviewing the whole thing and being my test “target audience”.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www1.phys.vt.edu/~economou/&quot;&gt;Sophia Economou&lt;/a&gt; and &lt;a href=&quot;https://twitter.com/sukin_sim&quot;&gt;Sukin Sim&lt;/a&gt; for reviewing specific sections associated with their research.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have a nice day!&lt;/p&gt;

&lt;p&gt;Michał&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
Footnotes:&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;For explanation why these are problematic please see &lt;a href=&quot;/VQAs-how-do-they-work.html&quot;&gt;VQA blogpost&lt;/a&gt;. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Numbers here are totally fake, I’m just making a point. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Another example: &lt;a href=&quot;https://quantum-journal.org/papers/q-2019-12-09-214/&quot;&gt;E. Grant et al.&lt;/a&gt; &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:4&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;This depends on the hardware type, as it’s a much bigger issue for superconducting qubits rather than ion traps. &lt;a href=&quot;#fnref:4&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:5&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Though there are some counterarguments, see &lt;a href=&quot;https://arxiv.org/abs/2010.00157&quot;&gt;Kim et al&lt;/a&gt; or &lt;a href=&quot;https://arxiv.org/abs/2105.01114&quot;&gt;Lee et al.&lt;/a&gt; &lt;a href=&quot;#fnref:5&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:6&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;There’s no proper name for this class of algorithms in the literature yet. &lt;a href=&quot;#fnref:6&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
&lt;script&gt;

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www-mustythoughts-com.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
&lt;/script&gt;

&lt;noscript&gt;Please enable JavaScript to view the &lt;a href=&quot;https://disqus.com/?ref_noscript&quot;&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;

</description>
				<pubDate>Thu, 27 May 2021 12:30:00 +0000</pubDate>
				<link>https://github.com/zxixia/jekyll-xixia/vqas-challenges.html</link>
				<guid isPermaLink="true">https://github.com/zxixia/jekyll-xixia/vqas-challenges.html</guid>
			</item>
		
	</channel>
</rss>
