<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Qiskit on Medium]]></title>
        <description><![CDATA[Stories by Qiskit on Medium]]></description>
        <link>https://medium.com/@qiskit?source=rss-12b2fb01d834------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gfuVobqPE1C06yJwyAi2Qg.png</url>
            <title>Stories by Qiskit on Medium</title>
            <link>https://medium.com/@qiskit?source=rss-12b2fb01d834------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:07:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@qiskit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[The Qiskit blog is moving!]]></title>
            <link>https://medium.com/qiskit/the-qiskit-blog-is-moving-0e7fa442c00c?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e7fa442c00c</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[qiskit]]></category>
            <category><![CDATA[ibm]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Thu, 25 Jan 2024 15:24:02 GMT</pubDate>
            <atom:updated>2024-01-25T15:24:02.776Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>That’s right, folks—we’re saying goodbye to our longtime home here on Medium.com. Check our new space at </em></strong><a href="https://www.ibm.com/quantum/blog"><strong><em>ibm.com/quantum/blog</em></strong></a><strong><em> for all future Qiskit blogs.</em></strong></p><p>The Qiskit team has spent over seven <em>years</em> building a wonderful community here on the Medium platform. In that time, we’ve used this space to share not only the latest news and updates about Qiskit itself, but also to publish a collection of fascinating stories written by Qiskit users exploring the wide world of quantum software development and quantum information science. Now, we think it’s time for a change of scenery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIQMDG1T5JLYKk85DhoJmA.png" /></figure><p>As part of ongoing efforts at IBM to pool resources into a unified quantum experience, and to make it easier for our community to find and access the information they care about, we’re building a new home for the Qiskit blog. Moving forward, you’ll find all new Qiskit blog posts published at <a href="https://www.ibm.com/quantum/blog">ibm.com/quantum/blog</a>. Simply click the “Qiskit” tag on the menu in the top left corner of the page, and you’ll be able to see the new Qiskit blog content we plan to start publishing in the weeks and months ahead. Historical content previously posted here on Medium will remain live for your reference.</p><p>We may be changing addresses, but we’ll still be bringing you the high-quality quantum computing news, resources and storytelling we’ve been producing for years. So, we hope you’ll bookmark the new blog and check in regularly. You can also follow the<a href="https://www.linkedin.com/showcase/ibm-quantum/"> IBM Quantum page on LinkedIn</a> for updates featuring the latest blog content.</p><h3>A look back at seven years of Qiskit blogging</h3><p>Seven years is a long time, so we thought it would be worth taking a look back at some of the amazing stories we’ve shared here. Below, we’ve compiled a short selection of our personal favorites, as well as a few of the posts that were most popular among our readers.</p><p><strong>*PLEASE NOTE*: <em>Many of the articles listed below were published several years ago, meaning they may feature outdated information, broken links, and code examples that no longer work. Be sure to check </em></strong><a href="https://docs.quantum.ibm.com/"><strong><em>our documentation</em></strong></a><strong><em> for the latest.</em></strong></p><p>Let’s get started with a few stories that signal how just how far we’ve come since launching the Qiskit blog back in 2016. We’ll begin with — what else? — our first post ever. The article was written by IBM researcher James Wootton, who contributed an enormous amount of content to the Qiskit blog in its earliest years:</p><p><a href="https://medium.com/qiskit/playing-with-the-worlds-most-advanced-technology-c7fcc21f293f">Experimenting with the world’s most advanced technology</a></p><p>In reviewing our archive of Qiskit Medium blogs, we were also struck by this 2020 post proposing version 3.0 of the OpenQASM quantum assembly language. It’s fascinating to read about the specific issues and limitations in OpenQASM 2.0 that 3.0 was built to address:</p><p><a href="https://medium.com/qiskit/a-new-openqasm-for-a-new-era-of-dynamic-circuits-87f031cac49">A New OpenQASM for a New Era of Dynamic Circuits</a></p><p>And, of course, we’d be remiss if we didn’t highlight the most recent post on Qiskit Medium celebrating the upcoming launch of Qiskit 1.0. Be sure to take a look if you haven’t already:</p><p><a href="https://medium.com/qiskit/coming-soon-qiskit-1-0-a8d59c3533a4">Coming soon: Qiskit 1.0!</a></p><h3><strong>Quantum Computing Explainers</strong></h3><p>Learning quantum computing can be easy and fun. <em>Explaining </em>quantum computing concepts—and doing so in a straightforward way that makes those concepts easy to understand—is a little more challenging. That hasn’t stopped us from trying, however. And in many cases, the results of those efforts have given us some of the only layman-friendly explanations of quantum computing concepts that you’ll find just about anywhere.</p><p><strong><em>REMINDER: Keep an eye out for outdated code in this section and </em></strong><a href="https://docs.quantum.ibm.com/"><strong><em>check our documentation</em></strong></a><strong><em> for up-to-date tutorials on how to implement any of the quantum programming concepts detailed in the articles below.</em></strong></p><p>First up, a popular article which reminds us that, sometimes, even the explainers need a good explainer. This post offers helpful tips for those who want to teach others the basics of what quantum computing is and why it matters. Best of all, the article provides a variety of suggestions for tailoring your explanation of the subject to people — and even <em>non</em>-people — who may have differing levels of expertise:</p><p><a href="https://medium.com/qiskit/how-do-you-explain-quantum-computing-to-your-dog-and-other-important-people-in-your-life-22f5fdacaf11">How Do You Explain Quantum Computing To Your Dog (And Other Important People in Your Life)?</a></p><p>And here’s a few more of our favorite explainer articles…</p><p><strong>The Variational Quantum Eigensolver — examining the inner-workings of the VQE algorithm:</strong></p><p><a href="https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747">The Variational Quantum Eigensolver</a></p><p><strong>The benefits of high-resolution pulses for quantum computers:</strong></p><p><a href="https://medium.com/qiskit/the-benefits-of-high-resolution-pulses-for-quantum-computers-29f5c510e21">The benefits of high-resolution pulses for quantum computers</a></p><p><strong>What Is Quantum Volume, Anyway?:</strong></p><p><a href="https://medium.com/qiskit/what-is-quantum-volume-anyway-a4dff801c36f">What Is Quantum Volume, Anyway?</a></p><p><strong>Explore The Clifford Group, A Crucial Tool For Benchmarking, Error Correction, And More:</strong></p><p><a href="https://medium.com/qiskit/explore-the-clifford-group-a-crucial-tool-for-benchmarking-error-correction-and-more-b9fdca16bb46">Explore The Clifford Group, A Crucial Tool For Benchmarking, Error Correction, And More</a></p><p><strong>What Can a Quantum Computer Actually Do?</strong> (This post explains where quantum computing sits in the world of computational complexity theory):</p><p><a href="https://medium.com/qiskit/what-can-a-quantum-computer-actually-do-4daed0691f6b">What Can a Quantum Computer Actually Do?</a></p><p><strong>What are Qiskit Primitives?:</strong></p><p><a href="https://medium.com/qiskit/what-are-qiskit-primitives-9bf63c1eacc7">What are Qiskit Primitives?</a></p><p><strong>A user’s guide to the Qiskit Circuit Library:</strong></p><p><a href="https://medium.com/qiskit/a-guide-to-the-qiskit-circuit-library-36ee0f189956">A guide to the Qiskit circuit library</a></p><h3><strong>DIY Quantum Computing Projects</strong></h3><p>A good explainer will take you a long way when it comes to learning quantum computing fundamentals, but often the best way to learn is not by reading, but by doing. The Qiskit community has brought us tons of creative DIY projects over the years, projects that get users hands on with quantum computing and important concepts in the field. Here are a few of our favorites.</p><p><strong><em>REMINDER:</em></strong><em> </em><strong><em>Posts in this section have *a lot* of outdated code, so be sure to </em></strong><a href="https://docs.quantum.ibm.com/"><strong><em>check our documentation</em></strong></a><strong><em> or consider reaching out to the post author if you’d like to recreate their project!</em></strong></p><p><strong>RasQberry — Quantum Computing is the Coolest Project for Raspberry Pi:</strong></p><p><a href="https://medium.com/qiskit/rasqberry-quantum-computing-is-the-coolest-project-for-raspberry-pi-3f64bec5a133">RasQberry: Quantum Computing is the Coolest Project for Raspberry Pi</a></p><p><strong>Getting to know your quantum processor</strong> (a game that helps users understand the connections between qubits in a quantum device):</p><p><a href="https://medium.com/qiskit/getting-to-know-your-quantum-processor-ea418867615f">Getting to know your quantum processor</a></p><p><strong>Building the world’s smallest quantum classifier:</strong></p><p><a href="https://medium.com/qiskit/building-the-worlds-smallest-quantum-classifier-7da7cd845b84">Building the world’s smallest quantum classifier</a></p><p><strong>Introducing Bosonic Qiskit — A package for simulating bosonic and hybrid qubit-bosonic circuits</strong> (stay tuned for an upcoming follow-up post to be published on the new Qiskit blog):</p><p><a href="https://medium.com/qiskit/introducing-bosonic-qiskit-a-package-for-simulating-bosonic-and-hybrid-qubit-bosonic-circuits-1e1e528287bb">Introducing Bosonic Qiskit: A package for simulating bosonic and hybrid qubit-bosonic circuits</a></p><p><strong>Programming a quantum computer—generating true random numbers:</strong></p><p><a href="https://medium.com/qiskit/programming-a-quantum-computer-generating-true-random-numbers-7dd631ef10a1">Programming a quantum computer: generating true random numbers</a></p><h3><strong>Humans of Quantum</strong></h3><p>From profiles of the world’s most famous quantum computing researchers to first-person narratives spotlighting everyday users, many of our most popular and compelling blog posts have focused not just on quantum computing, but on the people who are actually doing it.</p><p><strong>I’ve Worked in Game Development My Whole Career — Here’s Why I’m Learning Quantum Computing:</strong></p><p><a href="https://medium.com/qiskit/ive-worked-in-game-development-my-whole-career-here-s-why-i-m-learning-quantum-computing-41bd179b70f2">I’ve Worked in Game Development My Whole Career — Here’s Why I’m Learning Quantum Computing.</a></p><p><strong>Why Quantum Computing Pioneer Dorit Aharonov Thinks We Need More People Working on Quantum Algorithms:</strong></p><p><a href="https://medium.com/qiskit/why-this-quantum-pioneer-thinks-we-need-more-people-working-on-quantum-algorithms-3020729c61e1">Why This Quantum Pioneer Thinks We Need More People Working on Quantum Algorithms</a></p><p><strong>I Transitioned to Quantum Computing Later in My Career — Here’s What It Was Like:</strong></p><p><a href="https://medium.com/qiskit/i-transitioned-to-quantum-computing-later-in-my-career-heres-what-it-was-like-a0ad53147e8b">I Transitioned to Quantum Computing Later in My Career — Here’s What It Was Like</a></p><p><strong>Scott Aaronson Says Complexity Theory is ‘Inextricable’ from Quantum Computing:</strong></p><p><a href="https://medium.com/qiskit/scott-aaronson-says-complexity-theory-is-inextricable-from-quantum-computing-18369d0bd05d">Scott Aaronson Says Complexity Theory is ‘Inextricable’ from Quantum Computing</a></p><p><strong>How Ewin Tang’s Dequantized Algorithms are Helping Quantum Algorithm Researchers:</strong></p><p><a href="https://medium.com/qiskit/how-ewin-tangs-dequantized-algorithms-are-helping-quantum-algorithm-researchers-3821d3e29c65">How Ewin Tang’s Dequantized Algorithms are Helping Quantum Algorithm Researchers</a></p><p><strong>I Worked in Finance — Here’s Why I’m Learning Quantum Computing:</strong></p><p><a href="https://medium.com/qiskit/i-worked-in-finance-heres-why-i-m-learning-quantum-computing-9c1ec9b0b4a2">I Worked in Finance — Here’s Why I’m Learning Quantum Computing</a></p><h3><strong>Qiskit Community</strong></h3><p>The Qiskit community has grown by leaps and bounds since our founding in 2016, and it’s amazing to look back at just how far we’ve come. For example, today our Qiskit Advocates Program is made up of hundreds of quantum computing advocates based all around the world. So, it’s hard to believe that we made our first post launching the program just a few years ago, in late 2019:</p><p><a href="https://medium.com/qiskit/become-a-qiskit-advocate-eb1da2990257">Become a Qiskit Advocate</a></p><p><strong>The Ultimate Guide for Contributing to Qiskit — No Matter Your Background:</strong></p><p><a href="https://medium.com/qiskit/the-ultimate-guide-for-contributing-to-qiskit-no-matter-your-background-f709470b0461">The Ultimate Guide for Contributing to Qiskit — No Matter Your Background</a></p><p><strong>Join Us For The Quantum Women Invited Talk Series:</strong></p><p><a href="https://medium.com/qiskit/join-us-for-the-quantum-women-invited-talk-series-974319e2f9b4">Join Us For The Quantum Women Invited Talk Series</a></p><h3><strong>Quantum Careers</strong></h3><p>Some of our all-time most popular posts have centered on the subject of quantum careers, and on providing users with tips and tricks for landing a job in the field. These two posts continue to be great resources for anyone in quantum who may be thinking about their next career move:</p><p><strong>The Hitchhiking Cat’s Guide to Getting a Job in Quantum Computing</strong> (by Jay Gambetta!):</p><p><a href="https://medium.com/qiskit/the-hitchhiking-cats-guide-to-getting-a-job-in-quantum-computing-da7e3bb9ff64">The Hitchhiking Cat’s Guide to Getting a Job in Quantum Computing</a></p><p><strong>We Asked Experts Their Advice for Getting a Job in Quantum Computing:</strong></p><p><a href="https://medium.com/qiskit/we-asked-experts-their-advice-for-getting-a-job-in-quantum-computing-2f55e9785a6b">We Asked Experts Their Advice for Getting a Job in Quantum Computing</a></p><h3>See you at the new Qiskit blog!</h3><p>An article like this one can only ever scratch the surface when it comes to recapping seven full <em>years</em> of amazing storytelling, and there are lots of wonderful pieces that didn’t make the cut. Be sure to take a look through <a href="https://medium.com/qiskit/archive">our extensive archive here on Medium</a> for more. We’ll be leaving the Qiskit Medium up for the foreseeable future, so readers can easily reference our past articles.</p><p>We may be closing the chapter on our time here at Medium.com, but the story is far from over! Be sure to head over to <a href="https://www.ibm.com/quantum/blog">ibm.com/quantum/blog</a> to keep up with the latest and greatest from the Qiskit team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e7fa442c00c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/the-qiskit-blog-is-moving-0e7fa442c00c">The Qiskit blog is moving!</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coming soon: Qiskit 1.0!]]></title>
            <link>https://medium.com/qiskit/coming-soon-qiskit-1-0-a8d59c3533a4?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8d59c3533a4</guid>
            <category><![CDATA[qiskit]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 16:34:16 GMT</pubDate>
            <atom:updated>2023-12-20T16:34:16.519Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Abby Mitchell, Jake Lishman, Luciano Bello, Matthew Treinish &amp; Blake Johnson</em></p><p>Qiskit 1.0 will be released in February 2024 🎉</p><p>This is a huge milestone, the culmination of six years of open-source efforts, all made possible by the continued enthusiasm of thousands of users and the ongoing support of hundreds of contributors.</p><p>In this article you’ll find the following:</p><ul><li>What this upcoming major version means for users</li><li>How to test out 1.0 functionality before the stable release</li><li>How to upgrade to Qiskit 1.0</li><li>Possible disruptions to be aware of during the transition period</li></ul><p><em>The article below is a repost of </em><a href="https://www.ibm.com/quantum/blog/qiskit-1-launch"><em>our original announcement</em></a><em> on the IBM Research blog.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPFbB4lxPQJ-iliC64s1vA.png" /></figure><h3>A new phase of Qiskit development</h3><p>This upcoming release signals a new phase for Qiskit development, one centered on performance, stability and usability. Qiskit 1.0 is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.</p><p>What does this mean, exactly? We have been making numerous changes over the past few minor releases to prepare for this new phase, with an emphasis on the following:</p><ul><li><strong>A high performance code base:</strong> We have steadily been improving performance over the years, and Qiskit 1.0 is set to be the best version yet. It will enable users to build and transpile 100+ qubit circuits with comparative ease, and lay the groundwork for future 1000+ qubit capabilities.</li><li><strong>A leaner package:</strong> We’ve made changes such as the removal of the metapackage architecture, the splitting out of qiskit.algorithms into a separate package, and the deprecation of various modules (e.g. qiskit.opflow) — all in an effort to keep the Qiskit codebase more focused, stable, and maintainable. This paves the way for a more performant and usable package in the long run.</li><li><strong>A more stable API:</strong> The launch of Qiskit 1.0 will move Qiskit development into a new release and versioning cycle, with less frequent breaking changes. (More details on this later.)</li><li><strong>Primitives are <em>the</em> access model for quantum hardware:</strong> The Qiskit codebase provides the definition for a primitives execution model for quantum hardware, with pre-existing functionality being refactored to use primitives and future functionality being developed with a primitives-first approach.</li><li><strong>An SDK to build upon:</strong> The transpiler plugin interface and the Qiskit Ecosystem program (among other things) are designed to encourage the further extension of Qiskit’s capabilities by users and contributors.</li></ul><h3>Performance: let’s take a closer look</h3><p>We know it’s not enough for us to just say “Qiskit is more performant now!” We know you want to see the numbers, so let’s take a deeper look at what we mean when we talk about improved performance for Qiskit 1.0.</p><p>There are many different metrics to analyze for judging performance in a project like Qiskit, we’re going to focus on two: memory and speed.</p><p>In terms of speed, many features in Qiskit 1.0 just work faster now than they used to, due to ongoing internal refactoring and the introduction of Rust code under the hood. For example, the transpiler in Qiskit 1.0 can bind and transpile circuits 16x faster than Qiskit 0.33 (while also returning shorter circuit depths). See below for a comparison of the transpilation capabilities for different types of 100+ qubit circuits. The blue bars indicate how many times faster Qiskit can transpile these circuits compared to TKET (an alternative circuit building SDK), and the pink bars indicate the percentage reduction in two-qubit gates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GT_4KQRdHLv_BRkg.png" /><figcaption>Speed comparison: Qiskit 0.45 vs. TKET 1.21 at 100 qubits.</figcaption></figure><p>Similarly, when it comes to memory, we’ve done a lot of internal refactoring to reduce the footprint of circuits, with Qiskit 1.0 demonstrating an average 55% decrease in memory usage compared to Qiskit 0.39. The chart below shows data collected on the maximum memory used in building a 127-qubit Two Local circuit at increasing circuit depth, comparing the last three Qiskit versions with the upcoming 1.0 version:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X7kuW6PGA4Ni4nqr.png" /><figcaption>Two Local 127-qubit peak memory.</figcaption></figure><h3>Pre-release coming December 2023</h3><p>Before the full release in February 2024, we will be offering a very early pre-release of Qiskit 1.0 on December 4, 2023. This will include a subset of the changes coming in the full 1.0 release two months later.</p><p>As an open-source project, we have always strived to bring our community along with us in our development journey, and so we’re thrilled to be able to provide this opportunity for users and contributors to test out Qiskit 1.0 early. As always, we greatly appreciate any bug reports and feedback made by <a href="https://github.com/Qiskit/qiskit/issues/new/choose">opening an issue</a> in our GitHub repository.</p><p>Also, in early February 2024 (after the 1.0 pre-release but before the 1.0 stable release) we will release an additional Qiskit 0.46. This version will be compatible with 0.45, and will be a useful stepping stone in the transition to 1.0. We will continue to support Qiskit 0.46 for a further six months, overlapping with the release of Qiskit 1.0. This version will contain warnings for everything that is changing in Qiskit 1.0 and possibly some bug fixes, but no new features.</p><h3>How to upgrade to Qiskit 1.0</h3><p><em>The following instructions are relevant for upgrading to Qiskit 1.0 or installing the pre-release.</em></p><p>The most important thing to know when the time comes to upgrade is this:</p><blockquote><em>You will need to create a new virtual environment to install Qiskit 1.0.</em></blockquote><p>Qiskit 1.0 will use a new packaging structure, and you will not be able to upgrade an existing Qiskit 0.x installation to Qiskit 1.0 in-place. This is the only time we expect to break packaging; you will be able to upgrade from Qiskit 1.0 and beyond in-place.</p><h3>I’m a Qiskit user. What do I need to do?</h3><p>Qiskit 1.0 is not yet available, so there is nothing you need to do immediately. When it is released, you will not be able to use pip install -U qiskit to upgrade from any Qiskit 0.x version to 1.0.</p><p>To upgrade, you will need to begin a new virtual environment.</p><p>For example, using the standard tool <a href="https://docs.python.org/3.10/tutorial/venv.html">venv</a>, you might do the following:</p><pre># Create a new virtual environment (you only do this once)<br>python -m venv ~/qiskit-1.0-env<br><br># Activate the new virtual environment (you do this every time you start a new session)<br>source ~/qiskit-1.0-env/bin/activate<br><br># Install Qiskit 1.0 (you only do this once for this environment)<br>pip install ‘qiskit&gt;=1.0’</pre><p><em>Note: For installing the pre-release, you can use the same steps above. The only difference is that for the last line, you should run </em>pip install ‘qiskit==1.0.0b1’<em> instead.</em></p><p>You can follow similar steps if you prefer to use <a href="https://virtualenv.pypa.io/en/latest/user_guide.html">virtualenv</a>, <a href="https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html">Conda</a>, or any other virtual-environment management. Consult the documentation for your chosen environment for more information on how to create new ones.</p><p>In addition to creating a new virtual environment, you might need to adapt your code to work with Qiskit 1.0, as there will be some breaking changes with respect to 0.x.</p><p>To prepare for this, we recommend that you install Qiskit 0.46 when it is released in early February 2024, and try running your code to see if anything breaks. Where there are places that you need to change, you will see DeprecationWarnings being issued, which will include descriptions of how to modify your code for Qiskit 1.0.</p><p>We will support Qiskit 0.46 with bugfixes, but no new features, for six months after its release. This will give users time to make modifications, and will also give library maintainers time to upgrade any libraries users may depend on.</p><h3>I use projects that depend on Qiskit . What do I need to do?</h3><p>It will take some time for downstream projects to begin supporting Qiskit 1.0. Please be patient with these projects; it is a lot of work to support new versions of libraries, and it can take maintainers time to switch over.</p><p><strong>As an end user, you must not install packages that require Qiskit versions before Qiskit 1.0 in the same environment where you have Qiskit 1.0 installed.</strong></p><p>Doing so could break your virtual environment, and you might need to create a new one.</p><h3>I maintain a project that depends on Qiskit . What do I need to do?</h3><p>Qiskit 1.0 will include breaking changes, and we do not expect that packages supporting the current 0.44 or 0.45 series will necessarily support 1.0 unchanged.</p><p>We recommend two immediate modifications to your dependency management:</p><ol><li><strong>Remove any dependencies on the </strong>qiskit-terra<strong> PyPI package, and replace them with dependencies on the </strong>qiskit<strong> package.</strong> You can find a table matching old qiskit versions to qiskit-terra versions <a href="https://docs.quantum.ibm.com/api/qiskit/release-notes/0.44#version-history">here</a>, if you want to support old versions of Qiskit. From Qiskit 0.45 onwards, the versions of qiskit and qiskit-terra are identical, and are not listed in the table. This is critical as the qiskit-terra PyPI package will no longer be updated in any form for the 1.0 series and above, as it is entirely superseded by the qiskit PyPI package.</li><li><strong>Place an upper bound on your </strong>qiskit<strong> dependency to restrict the use of </strong>1.0<strong> until you have verified that your package supports Qiskit 1.0.</strong> To do this, set your dependency as qiskit &gt;=0.44, &lt;1.0, or replace the 0.44 as appropriate.</li></ol><p>After implementing the above steps, but before the full release of Qiskit 1.0 we recommend testing your project with Qiskit 0.46 once it is released in early February. This will enable you to find all the warnings it will generate so you can upgrade your library to support Qiskit 1.0 when it is released. We will support Qiskit 0.46 with bug fixes for six months after the release of Qiskit 1.0, to give you time to begin supporting 1.0.</p><p>Once Qiskit 1.0 is released in February 2024 (and you have sufficiently tested it with your codebase), we recommend releasing a new version of your package with updated version requirements.</p><h3>Breaking changes</h3><p>Throughout the history of Qiskit development, we have strived to keep pace with the rapid progress of quantum technology while also trying very hard to keep breaking changes to a minimum, and to provide a clean upgrade path that allows library authors to support multiple versions of the Qiskit package simultaneously.</p><p>Qiskit 1.0 will require some changes that could not necessarily be made safely in this manner. These largely affect data-structure internals, which we could not change smoothly without severely compromising performance. We hope that many of these changes will not affect user code, but are aware that this is not always the case. The best way to prepare for the transition to 1.0, and understand which breaking changes will impact you, is to try out the Qiskit 1.0 pre-release and the final minor version Qiskit 0.46 when they are released.</p><p>With the transition to Qiskit 1.0 the development cycle of Qiskit is also changing. There will be a minimum of one year between major releases, and minor version releases will happen as usual every three months. This means that breaking changes will only occur during major releases. To dig into the details of how the release cycles are changing and why, you can check out our open RFC <a href="https://github.com/Qiskit/RFCs/pull/34/files">here</a>.</p><p>While we anticipate the release of Qiskit 1.0 will result in some initial disruption, we see this as being necessary to pave the way towards a more stable and less breaking future for the package.</p><h3>Conclusion</h3><p>We are incredibly thankful to everyone who has taken the time over the past six years to get us to this place, whether it was a pull request, bug report, or just a comment on slack. Please keep it up! We are very proud of how far we’ve come, and can’t wait to embark on this next phase of our development journey with your continued support. Stay tuned for more Qiskit 1.0 updates!</p><h3>Footnote for the GitHub Gurus!</h3><p>Want to know more about what’s happening for Qiskit 1.0 at a codebase level? These resources may be of interest to you:</p><ul><li>If you wish to proactively test against changes coming in Qiskit 1.0, development is proceeding on the <a href="https://github.com/Qiskit/qiskit/tree/main">main branch</a> of the Qiskit repository.</li><li>Development on Qiskit 0.46 is happening on the <a href="https://github.com/Qiskit/qiskit/tree/stable/0.46">stable/0.46 branch</a> of the Qiskit repository.</li><li>Conversations around release cycles, versioning and deprecation policies are happening in the <a href="https://github.com/Qiskit/RFCs/pull/34">release cycle RFC</a> in the Qiskit organization RFC repository.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8d59c3533a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/coming-soon-qiskit-1-0-a8d59c3533a4">Coming soon: Qiskit 1.0!</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Christmas Closed-Timelike-Curve: Could the story of Scrooge actually happen in a quantum universe?]]></title>
            <link>https://medium.com/qiskit/a-christmas-closed-timelike-curve-could-the-story-of-scrooge-actually-happen-in-a-quantum-universe-cb22cdf8c9a7?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb22cdf8c9a7</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[grandfather-paradox]]></category>
            <category><![CDATA[time-travel]]></category>
            <category><![CDATA[time-loop]]></category>
            <category><![CDATA[knowledge-paradox]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 18:05:11 GMT</pubDate>
            <atom:updated>2024-04-09T18:16:24.539Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Maria Violaris, PhD student at the University of Oxford</em></p><p>Traveling backwards and forwards in time is a common trope that appears often in science fiction. However, as we enter the holiday season, I find myself contemplating a famous time travel story rooted in a very different genre — specifically, a piece of Victorian era morality literature by Charles Dickens. And as usual, I’m doing it from the perspective of quantum mechanics.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjcC1Ck45Ykw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjcC1Ck45Ykw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjcC1Ck45Ykw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa3a8cae883b340d821f54bfe8573059/href">https://medium.com/media/aa3a8cae883b340d821f54bfe8573059/href</a></iframe><p>Have you guessed the story I’m talking about? That’s right! It’s “A Christmas Carol,” the tale of the grumpy, selfish Ebenezer Scrooge who receives visits from ghosts of the past, present and future on Christmas Eve. Scrooge emerges from his experience a changed and newly generous man, but I can’t help but wonder, could the fantastical story of Scrooge really happen in a universe with quantum time-loops?</p><p>In the latest installment of the Quantum Paradoxes video series on the Qiskit YouTube channel, I investigate the possibility that time-loops — more commonly known to physicists as “closed-timelike-curves” — may in fact be consistent with quantum mechanics. In this blog post, I apply my findings from that video to make sense of the story of “A Christmas Carol”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBgicXcNB28cxy-RLMS8dg.png" /></figure><p><strong>A Christmas paradox</strong></p><p>Let’s first consider the visit from the Ghost of Christmas Past. The ghost takes Scrooge to observe various happy scenes from his past. Scrooge does not interact with his past self, and his past self does not see him at all.</p><p>This experience begins to change Scrooge’s outlook on life, so it has an effect on Scrooge’s future behaviour. However, there’s no paradox here. It is fully self-consistent for Scrooge to invisibly observe his past self, and then have that experience change his own future actions. In fact, this process isn’t too different from something most of us do just about every day. Like anyone else, Scrooge is simply reflecting on his past memories, and changing his actions as a result.</p><p>Next, the Ghost of Christmas Present takes Scrooge to see some scenes from the present day. No time-travel here, so all is good!</p><p>Now for the most interesting case: Scrooge receives a visit from the Ghost of Christmas Yet-To-Come. The ghost takes Scrooge to a scene that occurs after his death, where he sees that his death is celebrated rather than mourned, and also observes the tragic fate of a sick child, Tiny Tim. Seeing this future is the final straw for Scrooge to change his ways. He wakes up on Christmas morning as someone kind, generous and compassionate.</p><p>Here’s the paradox: If Scrooge changed his ways because he saw a bleak future, then the bleak future will never happen. If the bleak future never happens, it will never cause Scrooge to change his ways!</p><p><strong>Self-consistency is key</strong></p><p>The paradox we run into with our friend Ebenezer shares many similarities with the “Grandfather Paradox,” the idea that someone who goes back in time and kills their grandfather will never exist to go and kill their grandfather in the first place. These paradoxes can be solved in quantum mechanics using a “consistency condition,” which is a constraint that ensures everything makes logical sense in a time-loop. If someone goes into a time-machine, they must be in the same state as when they come out of the time-machine, and this limits the range of actions they can perform. If you go back in time, you physically will not be able to kill your own grandfather.</p><p>With that in mind, we can resolve the paradox of Scrooge changing his ways. Consider a modified story, where the Ghost of Christmas Yet-to-Come shows Scrooge a bright and happy future. In this future, Scrooge is a kind and generous man. Seeing how much happiness he can bring about by being kind and generous, present-day selfish Scrooge is inspired to change his ways. He becomes kind and generous as well, leading to the bright and happy future he was shown by the ghost, with no logical contradiction.</p><p>Is everything all well and good now? Not quite. There’s another, more subtle time-travel paradox hidden in this modified story, called the Knowledge Paradox. Imagine I travel forward in time to read this blog post, copy it from my future self, and then post it, making it the blog post that my past self would eventually copy. This is logically consistent, but where did the knowledge of the ideas in the blog post come from?</p><p>Our Scrooge scenario is similar. Sure, Scrooge can see his kind future self and become a kinder person as a result. That is perfectly self-consistent. But where did Scrooge’s knowledge of the positive impacts of being kind come from? This Knowledge Paradox has not yet been solved in quantum mechanics, so I cannot quite finish the quantum modification of Scrooge in this blog post.</p><p>Who knows? Perhaps this Christmas Eve I will be visited by a Ghost of Christmas Yet-to-Come, one who will show me a future Qiskit video where the Knowledge Paradox has been resolved. I will then come back to the present, and make a new Qiskit video resolving the Knowledge Paradox with quantum circuits, which turns out to be the one I saw in the future…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJQ_xYmrdey0oJhuz0Iazg.png" /></figure><p>Until that happens, be sure to check out the current version of the video where I investigate this topic <a href="https://youtu.be/jcC1Ck45Ykw">on Qiskit YouTube</a>. You can also dive into <a href="https://github.com/maria-violaris/quantum-paradoxes/blob/main/time-loops.ipynb">the accompanying Jupyter notebook</a>, which will show you how to simulate closed-timelike-curves as a quantum circuit. And of course, whether you are spending the festive season watching videos, reading Victorian morality tales, or reflecting on the past, present and future, best wishes for the holidays and everything yet to come!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb22cdf8c9a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/a-christmas-closed-timelike-curve-could-the-story-of-scrooge-actually-happen-in-a-quantum-universe-cb22cdf8c9a7">A Christmas Closed-Timelike-Curve: Could the story of Scrooge actually happen in a quantum universe?</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A new chapter for Qiskit algorithms and applications]]></title>
            <link>https://medium.com/qiskit/a-new-chapter-for-qiskit-algorithms-and-applications-5baff541e826?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/5baff541e826</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[qiskit]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 13:01:48 GMT</pubDate>
            <atom:updated>2023-11-27T13:01:48.819Z</atom:updated>
            <content:encoded><![CDATA[<p>In recent months, the Qiskit Ecosystem has undergone a series of changes, additions, migrations, and upgrades all driven by a common goal: to provide the community with a greater role in the development of algorithms and applications. To align with this goal, we have moved the applications repositories, relocated the algorithms in Qiskit into their own repository, and welcomed external partners as additional maintainers to the repositories. This blog post delves into the hows and whys of these changes, and introduces the new maintainers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AtVRCEBQMyeaZkyk64actg.jpeg" /></figure><h3><strong>Algorithms as an independent package</strong></h3><p>If you have been following our release updates, you may already be familiar with this change. Since Qiskit 0.44.0, qiskit.algorithms has been migrated to a new standalone package, qiskit-algorithms. The new library can be found in the qiskit-community <a href="https://github.com/qiskit-community/qiskit-algorithms">GitHub</a> organization and <a href="https://pypi.org/project/qiskit-algorithms/">PyPi</a>, and is the place to go for updated, primitive-based algorithm implementations.</p><p>This move is significant because it separates the circuit-building tools from the libraries built on top of them. This separation allows algorithm development to move at a different pace than that of the core library. While Qiskit itself aims to provide a stable foundation layer for quantum development, algorithms are still an evolving field of research, and will benefit from more flexible development cycles.</p><h3><strong>Community-oriented algorithms and applications</strong></h3><p>In the case of the Qiskit applications modules, the repository changes have been a bit more subtle. qiskit-nature, qiskit-machine-learning, qiskit-optimization, and qiskit-finance are now also part of the qiskit-community GitHub <a href="https://github.com/qiskit-community">organization</a>. The package installation path has remained unchanged, so the impact of this migration on end-users has been minimal. This move does however symbolize the strengthened community focus of the projects, which also involves the newly created qiskit-algorithms.</p><p>While these packages have always been open-source and welcomed external contributors, most feature development and maintenance efforts were sourced from within IBM Quantum. By joining forces with external partners, we enable the community to have a stronger impact on the direction of these libraries, bringing in new perspectives and areas of expertise. At the same time, we can focus more resources on improving the performance and stability of the core Qiskit package. The documentation of the applications can be found in their corresponding repositories as well as the <a href="https://qiskit.org/ecosystem">Ecosystem page</a>.</p><h3><strong>Welcoming new maintainers</strong></h3><p>The algorithms and applications libraries have onboarded new code-owners and maintainers from IBM Quantum partner institutions:</p><p><a href="https://algorithmiq.fi/"><strong>Algorithmiq</strong></a><strong> (qiskit-nature):</strong> “Our mission is to revolutionise life sciences by exploiting the potential of quantum computing to solve currently inaccessible problems. Algorithmiq’s top quantum chemistry team and their knowledge of state-of-the-art quantum chemistry methods will, together with qiskit’s expert community, tackle some of the greatest quantum chemistry simulation challenges that lie ahead.”</p><p><a href="https://www.hartree.stfc.ac.uk"><strong>STFC Hartree Centre</strong></a><strong> (qiskit-machine-learning):</strong> “We help UK businesses and organisations of any size to explore and adopt supercomputing, data analytics, AI and emerging technologies for enhanced productivity, smarter innovation and economic growth. Our Qiskit work will be supported by the Hartree National Centre for Digital Innovation (HNCDI) — a collaboration with IBM Research that bridges the gap between academic research and the adoption of new technologies to solve industry challenge and transfer the skills needed to adopt digital solutions.”</p><p><a href="https://www.quantagonia.com/"><strong>Quantagonia</strong></a><strong> (qiskit-optimization):</strong> “Quantagonia’s mission is to democratize quantum computing, making it accessible and manageable for businesses across sectors, enabling them to leverage this powerful technology for transformative growth and a competitive edge.”</p><p>These are domain experts in chemistry, machine learning and optimization, as well as active community contributors.</p><h3><strong>Cleaning up legacy dependencies</strong></h3><p>To facilitate the community’s greater role in the development of algorithms and applications, legacy dependencies in the applications have been cleaned up to simplify the code base and make the libraries more accessible to external contributors and new maintainers.</p><p>This means the newly released versions of the application modules: qiskit-finance 0.4, qiskit-machine-learning 0.7, qiskit-optimization 0.6 and qiskit-nature 0.7 no longer depend on, or support, the now deprecated modules from Qiskit, such as <a href="https://medium.com/qiskit/farewell-opflow-and-quantum-instance-7efd9f82f43">opflow and quantum instance</a>. These modules will no longer be available in the upcoming Qiskit 1.0 release.</p><p>In addition to this, and in anticipation of the upcoming removal of qiskit.algorithms, which will also not be part of Qiskit 1.0, the applications modules have been updated to use only qiskit-algorithms instead.</p><h3><strong>Conclusion</strong></h3><p>In summary, the new algorithm and application libraries in the Qiskit Ecosystem have undergone a significant shift towards community-led development. Establishing an independent algorithms package, relocating applications, and simplifying legacy code were all steps designed to facilitate and enhance community engagement. As always, community contributions are most welcome, and — together with the new maintainers — we invite all of you to get involved via the GitHub repositories or the corresponding Qiskit Slack channels, such as #applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5baff541e826" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/a-new-chapter-for-qiskit-algorithms-and-applications-5baff541e826">A new chapter for Qiskit algorithms and applications</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Glasses, a Qiskit Ecosystem package for Bloch sphere simulations]]></title>
            <link>https://medium.com/qiskit/quantum-glasses-a-qiskit-ecosystem-package-for-bloch-sphere-simulations-f443698bbb98?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/f443698bbb98</guid>
            <category><![CDATA[qiskit]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[bloch-sphere]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 15 Nov 2023 15:56:43 GMT</pubDate>
            <atom:updated>2023-11-15T15:56:43.081Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Jay Shah</em></p><p>The Bloch sphere is one of the most popular and recognizable tools for helping new learners understand quantum computing fundamentals. Now, there’s a Qiskit Ecosystem project that helps users visualize Bloch spheres with just a few clicks on a convenient GUI-based tool.</p><p>The <a href="https://github.com/Jayshah25/Quantum-Glasses"><strong>Quantum-Glasses</strong></a><strong> </strong>package is a Tkinter GUI app designed to help users visualize the effects of single-qubit quantum gates via interactive <a href="https://learn.qiskit.org/course/ch-states/representing-qubit-states#bloch-sphere">Bloch Sphere</a> simulations. Built using Qiskit, the package is a recent addition to the <a href="https://qiskit.org/ecosystem/"><strong>Qiskit Ecosystem</strong></a> Community Tier. It’s designed to be easy to use, and its GUI-based software allows users to build their visualizations while simultaneously studying or working — no need to worry about code.</p><p>Read on to learn more about this handy tool and how you can use it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*4GI3oAEqTfQsSMgdaGurSA.png" /></figure><h3>What users see through Quantum Glasses</h3><p>Individual qubits and single-qubit gates are some of the most fundamental building blocks of quantum computation, and the Bloch sphere provides a convenient way of visualizing them. The challenge is that Bloch spheres are not very easy to draw by hand, and there aren’t many simulators that make it easy to generate them.</p><p>Quantum Glasses accomplishes this by providing a GUI app that makes it easy to produce and manipulate Bloch sphere visualizations. This, in turn, helps users visualize important quantum computing concepts to enhance their understanding of the subject.</p><p>The Quantum Glasses package supports a total of 11 single-qubit gates. These 11 gates include both parameterized as well as non-parameterized gates, listed below:</p><ol><li>Hadamard Gate</li><li>X Gate</li><li>Y Gate</li><li>Z Gate</li><li>S Gate</li><li>S Dagger Gate</li><li>T Gate</li><li>T Dagger gate</li><li>RX Gate</li><li>RY Gate</li><li>RZ Gate</li></ol><p>The parameter values for the parameterized gates (RX, RY, RZ) are discretized into the following set: 2𝝥, 𝝥, 𝝥/2, 𝝥/4, -𝝥/4, -𝝥/2, -𝝥, -2𝝥.</p><p>With Quantum Glasses, users can apply a series of single qubit gates and see how they affect a qubit, either starting in a default initial state of |0&gt; or in any other state that can be prepared using the available gates. Users can see the direct impact of these gates as the state vector rotates around the Bloch Sphere. These visualizations can help users:</p><ol><li>Better understand the effect of a particular gate when we apply it to a qubit in a given state.</li><li>Example: Effect of RX gate when applied to a qubit in the state |+&gt;</li><li>Gain a different perspective on important quantum computing identities</li><li>Example:<em> H2 = Identity (Applying a Hadamard Gate twice has no effect)</em></li></ol><h3>Getting started</h3><p>Quantum Glasses is a GUI app built using the tkinter python library. Users can follow these steps to get the app on their local machines.</p><ol><li>Clone <a href="https://github.com/Jayshah25/Quantum-Glasses">this</a> repository using git clone <a href="https://github.com/Jayshah25/Quantum-Glasses">https://github.com/Jayshah25/Quantum-Glasses</a></li><li>Activate the venv</li><li>Run python quantum_glasses.py</li></ol><p>Once you have successfully followed these steps, you should see Quantum Glasses appear on your screen.</p><h3>How to use Quantum Glasses</h3><ol><li>Apply the desired Gates. The Display Screen keeps track of the gates applied.</li><li>Click the Visualize Button. A new window with should pop up with the animated Bloch sphere.</li><li>Close the animation window once the animation is complete.</li><li>Click the Clear Button to reset the Quantum Glasses app.</li><li>Apply a new series of Gates for visualization ,or click the Quit Button to close the app.</li></ol><p>Hopefully Qiskit users will find the above to be pretty straightforward. For extra clarity, let’s take a look at two examples taken from the preceding section of this article.</p><p><strong>Effect of RX Gate on a qubit in the state |+&gt;</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCqU1s67-7zA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCqU1s67-7zA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCqU1s67-7zA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c2df2293f5b3205df98516346d65812/href">https://medium.com/media/8c2df2293f5b3205df98516346d65812/href</a></iframe><p><strong><em>H2 = Identity</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fsg71kmUMwsY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dsg71kmUMwsY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fsg71kmUMwsY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b02b571dff4f055342f10b62ea0240c/href">https://medium.com/media/4b02b571dff4f055342f10b62ea0240c/href</a></iframe><p>Wish to see more examples with Quantum Glasses? You’ll find several more on our <a href="https://youtube.com/playlist?list=PLJk_IGUjQllfCDHYmFNfaCoUgXImxmZIA&amp;si=J0pKDmSL6bikqCCc">YouTube playlist</a>.</p><h3>Future Work</h3><p>Quantum Glasses is a fun and potentially useful tool, but it does currently have some significant limitations.</p><ol><li>The visualizations are limited to a single qubit. Quantum Glasses cannot visualize important concepts like quantum entanglement, which involve more than one qubit.</li><li>The parameterized gates can only take one of the 8 values (2𝝥, 𝝥, 𝝥/2, 𝝥/4, -𝝥/4, -𝝥/2, -𝝥, -2𝝥).</li><li>The number of gates that you can apply at once is limited to 10. Once 10 gates are applied, all the buttons automatically deactivate.</li></ol><p>Future work will focus on addressing these limitations and making the Quantum Glasses app even more functional and versatile. If you’d like to contribute to these efforts, please contact us via the project GitHub, <a href="https://github.com/Jayshah25/Quantum-Glasses">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f443698bbb98" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/quantum-glasses-a-qiskit-ecosystem-package-for-bloch-sphere-simulations-f443698bbb98">Quantum Glasses, a Qiskit Ecosystem package for Bloch sphere simulations</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qiskit v0.45 is here!]]></title>
            <link>https://medium.com/qiskit/qiskit-v0-45-is-here-69e861fbfc88?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/69e861fbfc88</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[qiskit]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Mon, 06 Nov 2023 15:31:57 GMT</pubDate>
            <atom:updated>2023-11-10T21:34:26.206Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Abby Mitchell, Luciano Bello, Matthew Treinish, Jake Lishman</em></p><p>We’re excited to announce the release of Qiskit v0.45! Read on for a summary of the key highlights and, as always, you can find the full release notes in our documentation <a href="https://qiskit.org/documentation/release_notes.html">here</a>. With this being the last release before Qiskit 1.0, you’ll notice a lot of changes which we’ve highlighted in the article below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FL9ICGHtt01Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DL9ICGHtt01Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FL9ICGHtt01Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a90b517f858bdc9e088ff5dacdb1a4e/href">https://medium.com/media/2a90b517f858bdc9e088ff5dacdb1a4e/href</a></iframe><h3>The TL;DR</h3><p>The biggest updates we’re going to cover include the following:</p><ul><li>New passmanager submodule to make constructing passmanagers easier</li><li>New hardware-aware synthesis functionality, so you can now write a synthesis plugin that uses hardware information</li><li>New methods to make it easier to use TranspileLayout</li><li>New SabrePreLayout pass to provide a better “first guess” initial layout before running SabreLayout</li><li>Performance improvements due to refactoring gates into singletons (Note: Some attributes will now error because of mutability changes)</li><li>Unroller pass, bind_parameters() and any duplicated gate methods are now deprecated. qiskit.extensions is pending deprecation</li><li>Deprecated code from old releases (0.16, 0.19, 0.20 and 0.21) has been removed</li></ul><h4>An important note about package versioning</h4><p>If you’re confused about version numbers and think you may have missed out on a lot — don’t panic! <a href="https://medium.com/qiskit/release-news-qiskit-v0-44-is-here-d03e9dd06010">In our last release</a>, we announced that we had renamed Qiskit Terra to just Qiskit. This means the python package qiskit (which used to refer to the metapackage codebase) now refers to the codebase that was formerly named qiskit-terra. The last phase of this renaming process is to sync the version numbers between the old qiskit metapackage (the last release was v0.44) and the old qiskit-terra (the last release was v0.25). We chose to stick with the higher version number, so this release of qiskit will be v0.45.</p><h3>Top new features &amp; improvements</h3><p>In this section we’ll cover some of the most important new features and enhancements included in this release. If you want to know more about these, or other features that didn’t make it into this article, you can see the full list of new features <a href="https://qiskit.org/documentation/release_notes.html#new-features">here</a>.</p><h4>New passmanager sub-module</h4><p>The passmanager has been significantly refactored to make it easier to use and more performant. Users can use this new module to create their own custom passmanager using their own intermediate representations.</p><p>The following example demonstrates how you can construct a toy passmanager that, when run, will take in a row of numbers and remove any digits that equal 5. In this example, the input and outputs are integers, whereas the intermediate representation is a string:</p><pre>from qiskit.passmanager import BasePassManager, GenericPass, ConditionalController<br><br># create custom passmanager using BasePassManager<br>class ToyPassManager(BasePassManager):<br><br>    # convert input integer to string<br>    def _passmanager_frontend(self, input_program: int, **kwargs) -&gt; str:<br>        return str(input_program)<br>    <br>    # convert IR string to integer for output<br>    def _passmanager_backend(self, passmanager_ir: str, in_program: int, **kwargs) -&gt; int:<br>        return int(passmanager_ir)<br><br><br># Create a pass to remove a number if it equals 5<br>class RemoveFive(GenericPass):<br><br>    def run(self, passmanager_ir: str):<br>        return passmanager_ir.replace(&quot;5&quot;, &quot;&quot;)<br><br># Initialize pass<br>task = RemoveFive()<br><br># Initialize passmanager<br>pm = ToyPassManager()<br><br># Add pass to passmanager<br>pm.append(task)<br><br># Run the passmanager<br>pm.run([123456789, 45654, 36785554])</pre><p>Output:</p><pre>[12346789, 464, 36784]</pre><h4>Improved workflow for transpiler layout</h4><p>A number of new methods have been added to simplify the workflow for using and applying the TranspileLayout class.</p><p>TranspileLayout itself now has the following new methods:</p><ul><li>.initial_index_layout() — returns a python list of TranspileLayout.initial_layout</li><li>.routing_permutation() — returns a python list of TranspileLayout.final_layout</li><li>.initial_virtual_layout() — same functionality as TranspileLayout.initial_layout but with the option to exclude auxilary qubits by setting the argument filter_ancillas=False</li><li>.final_index_layout() — returns a python list of the output positions for each qubit from the input circuit to the transpiler</li><li>.final_virtual_layout() — returns a Layout object of the output positions for each qubit from the input circuit to the transpiler</li></ul><p>In addition, the SparsePauliOp class now has a new method, apply_layout(), that enables a transpiled layout to be applied to an observable locally before passing it to a primitive .run() function. E.g.:</p><pre>from qiskit.circuit.library import RealAmplitudes<br>from qiskit.quantum_info import SparsePauliOp<br>from qiskit.primitives import BackendEstimator<br>from qiskit.compiler import transpile<br>from qiskit.providers.fake_provider import FakeNairobiV2<br><br>psi = RealAmplitudes(num_qubits=2, reps=2)<br>H1 = SparsePauliOp.from_list([(&quot;YX&quot;, 1), (&quot;XZ&quot;, 2), (&quot;XI&quot;, 3)])<br>backend = FakeNairobiV2()<br>estimator = BackendEstimator(backend=backend, skip_transpilation=True)<br><br>thetas = [0, 1, 1, 2, 3, 5]<br>transpiled_psi = transpile(psi, backend, optimization_level=3)<br><br><br>permuted_op = H1.apply_layout(transpiled_psi.layout)<br><br>res = estimator.run(transpiled_psi, permuted_op, thetas).result()</pre><h4>New SabrePreLayout pass</h4><p>This release includes a new transpiler pass, called SabrePreLayout, designed to provide a better initial layout before running SabreLayout. This layout attempts to improve transpilation outputs in particular for large device topologies.</p><p>The following example demonstrates how to use the SabrePreLayout pass before running a SabreLayout pass:</p><pre>import math<br>from qiskit.transpiler import CouplingMap, PassManager<br>from qiskit.circuit.library import EfficientSU2<br>from qiskit.transpiler.passes import SabrePreLayout, SabreLayout<br><br>qc = EfficientSU2(16, entanglement=&#39;circular&#39;, reps=3, flatten=True)<br>qc.assign_parameters([math.pi / 2] * len(qc.parameters), inplace=True)<br>qc.measure_all()<br><br>coupling_map = CouplingMap.from_heavy_hex(7)<br><br>pm = PassManager(<br>  [<br>    SabrePreLayout(coupling_map=coupling_map),<br>    SabreLayout(coupling_map),<br>  ]<br>)<br><br>pm.run(qc)</pre><p>For more details on how this new pass does its thing, check out the <a href="https://github.com/Qiskit/qiskit/pull/10829">PR</a> for a more detailed description of the logic behind its development.</p><p><em>Note: This new feature is an experimental pass and is not yet included in the preset passmanagers.</em></p><h3>Performance improvements</h3><p>In this section, we’ll cover the most significant performance improvements that users will gain with this release.</p><h4>Faster transpilation</h4><p>The transpiler has undergone some refactoring under the hood, resulting in performance improvements across all optimization levels. Users do not need to change anything in their transpiler development workflow. However, by upgrading to the latest version of Qiskit, you should see faster transpilation times, particularly noticeable for large circuit depths.</p><p>The graphs below show the difference in transpile time between Qiskit v0.44 and v0.55 across a range of circuit depths and optimization levels:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUxraAXqgI2XdOVYOQx72Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XE0eqlk2X7HQ-PKEiBzxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8Ciq65ZIzlekH32yN6iRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9u0zHr-R2oMxaHo39UKww.png" /></figure><h4>Faster circuit construction and QASM parsing due to Singleton classes</h4><p>The following unparameterised and non-controlled gate classes have been refactored to be <a href="https://www.geeksforgeeks.org/singleton-pattern-in-python-a-complete-guide/">singletons</a>:</p><ul><li><a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.DCXGate.html#qiskit.circuit.library.DCXGate">DCXGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.ECRGate.html#qiskit.circuit.library.ECRGate">ECRGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.HGate.html#qiskit.circuit.library.HGate">HGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.IGate.html#qiskit.circuit.library.IGate">IGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.iSwapGate.html#qiskit.circuit.library.iSwapGate">iSwapGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.SGate.html#qiskit.circuit.library.SGate">SGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.SdgGate.html#qiskit.circuit.library.SdgGate">SdgGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.SwapGate.html#qiskit.circuit.library.SwapGate">SwapGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.SXGate.html#qiskit.circuit.library.SXGate">SXGate</a> , <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.SXdgGate.html#qiskit.circuit.library.SXdgGate">SXdgGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.TGate.html#qiskit.circuit.library.TGate">TGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.TdgGate.html#qiskit.circuit.library.TdgGate">TdgGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.XGate.html#qiskit.circuit.library.XGate">XGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.RCCXGate.html#qiskit.circuit.library.RCCXGate">RCCXGate</a> , <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.RC3XGate.html#qiskit.circuit.library.RC3XGate">RC3XGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.YGate.html#qiskit.circuit.library.YGate">YGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.ZGate.html#qiskit.circuit.library.ZGate">ZGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CHGate.html#qiskit.circuit.library.CHGate">CHGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CSGate.html#qiskit.circuit.library.CSGate">CSGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CSdgGate.html#qiskit.circuit.library.CSdgGate">CSdgGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CSwapGate.html#qiskit.circuit.library.CSwapGate">CSwapGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CSXGate.html#qiskit.circuit.library.CSXGate">CSXGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CXGate.html#qiskit.circuit.library.CXGate">CXGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CCXGate.html#qiskit.circuit.library.CCXGate">CCXGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.C3SXGate.html#qiskit.circuit.library.C3SXGate">C3SXGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.C3XGate.html#qiskit.circuit.library.C3XGate">C3XGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.C4XGate.html#qiskit.circuit.library.C4XGate">C4XGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CYGate.html#qiskit.circuit.library.CYGate">CYGate</a>, <a href="https://qiskit.org/documentation/dev/stubs/qiskit.circuit.library.CZGate.html#qiskit.circuit.library.CZGate">CZGate</a></li></ul><p>As a result, implementing these gates has become significantly more efficient, requiring less memory, reducing circuit construction time and speeding up QASM parsing time. These effects are most noticeable in large circuits, and highlight the efforts being made to ensure Qiskit can continue to support users as they move towards utility-scale experimentation.</p><p>See below a comparison of circuit build time and parameter binding time between Qiskit v0.44 and 0.45:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47v2mbdeCloKS60UHrbxNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9MNdYpwhFA8yKi_Dl0on6g.png" /></figure><h3>New deprecations</h3><p>In this section we’ll cover some of the most important new deprecations in this release. This section aims to highlight things that will now start throwing deprecation warnings and will be removed in a later release, following Qiskit’s Deprecation Policy (documented in full <a href="https://qiskit.org/documentation/deprecation_policy.html">here</a>). Due to this being the last release before Qiskit 1.0, you may see more things than usual being highlighted in this section.</p><p>For guidance on how to deal with deprecation warnings, check out the deprecations section in our previous article <a href="https://medium.com/qiskit/oh-no-my-qiskit-code-isnt-working-what-do-i-do-70e9249125d3#:~:text=Option%201%20%E2%80%94%20Is%20it%20a%20deprecation%20warning%3F">here</a>. You can see more detail about the deprecations specific to this release <a href="https://qiskit.org/documentation/release_notes.html#deprecation-notes">here</a>.</p><h4>qiskit.extensions</h4><p>The qiskit.extensions sub-module is pending deprecation and will be fully deprecated in a future release, with its contents either being moved to other sub-modules or deprecated.</p><p>The following qiskit.extensions classes have been moved to the <a href="https://docs.quantum-computing.ibm.com/api/qiskit/circuit_library">circuit library</a>, users should update their import statements accordingly, using from qiskit.circuit.library import ... instead of from qiskit.extensions import ... .</p><ul><li>UCPauliRotGate , UCRXGate , UCRYGate , UCRZGate , UnitaryGate , HamiltonianGate , Initialize</li></ul><p>The following qiskit.extensions classes have been deprecated, due to them being similar to existing functionality elsewhere:</p><ul><li>SingleQubitUnitary and Snapshot</li></ul><p>Additionally, the following QuantumCircuit methods have been deprecated as part of this change:</p><ul><li>.isometry(), .snapshot(), .ucrx(), .ucry(), .ucrz(), .squ(), .diagonal() and .hamiltonian()</li></ul><h4>Unroller transpiler pass</h4><p>The Unroller pass has been deprecated due to its functionality being superseded by the BasisTranslator pass, which can be used in a wider range of use cases than was possible with the Unroller pass.</p><p>For users currently using the Unroller pass, we recommended updating your code to use a custom pass manager with the BasisTranslator pass. For example:</p><pre>from qiskit.transpiler import PassManager<br>from qiskit.transpiler.passes import UnrollCustomDefinitions, BasisTranslator<br>from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel<br><br>circuit = YOUR_CIRCUIT<br>basis_gates = YOUR_BASIS_GATE_LIST<br><br>pm = PassManager(<br> [<br>   UnrollCustomDefinitions(sel, basis_gates=basis_gates),<br>   BasisTranslator(sel, target_basis=basis_gates),<br> ]<br>)<br><br>pm.run(circuit)</pre><p>In addition, as part of this deprecation, the use of the unroller value for the translation_method argument in the transpile() function is also deprecated. Users should use the default translator option instead. So, instead of transpile(qc, backend, translation_method=&quot;unroller&quot;, ...) , users can use transpile(qc, backend, ...) .</p><h4>bind_parameters()</h4><p>The functionality of assign_parameters() is the same as that of bind_parameters() , so we’ve made the decision to deprecate bind_parameters() in an effort to clean up the Qiskit codebase. Users should update their code to use assign_parameters() instead of bind_parameters() going forward.</p><h4>Duplicated circuit gate methods</h4><p>There are certain QuantumCircuit methods that apply the same gate as another existing method, so duplicated gate methods have been deprecated, and going forward only one gate method will exist for each gate. The following methods are being deprecated by this change:</p><ul><li>.i() is deprecated; users should use .id() instead</li><li>.cnot() is deprecated; users should use .cx() instead</li><li>.toffoli() is deprecated; users should use .ccx() instead</li><li>.mct() is deprecated; users should use .mcx() instead</li><li>.fredkin() is deprecated; users should use .cswap() instead</li></ul><h3>Breaking changes</h3><p>In this section we’ll highlight any changes that could cause user’s existing code to break when updating to this latest version, such as deprecated classes/functions that have now been removed.</p><h4>Deprecated code from numerous prior releases has been removed</h4><p>Due to the upcoming release of Qiskit 1.0, we are doing as much as we can to remove outdated code that has been throwing deprecation warnings for 3 months or more (in line with the removal timeline stipulated in our <a href="https://qiskit.org/documentation/deprecation_policy.html">deprecation policy</a>). In this release we have removed all code that was deprecated in Qiskit (Terra) releases 0.16, 0.19, 0.20 and 0.21. Users who are using deprecated code from these release versions should check the deprecation warnings for information on how to update your code, or consider pinning your Qiskit version to v0.44 or earlier.</p><h4>Singleton Gates</h4><p>Due to unparameterised and non-controlled gates being refactored to singletons, users will no longer be able to set the label, condition, duration, or unit attributes after instantiating a gate object. Instead users will now only be able to set these attributes as arguments when creating a new gate object, or use the new method .to_mutable() to get a mutable copy of the gate and set the attribute on that copy instead of the original object.</p><p>For example, the following code will now throw an error:</p><pre>from qiskit.circuit.library import XGate<br><br>x_gate = XGate()<br>xgate.label = &quot;My X Gate&quot;</pre><p>Instead, this example could be refactored like so:</p><pre>from qiskit.circuit.library import XGate<br><br>x_gate = XGate(label=&quot;My X Gate&quot;)</pre><p>or alternatively:</p><pre>from qiskit.circuit.library import XGate<br><br>x_gate = XGate().to_mutable()<br>xgate.label = &quot;My X Gate&quot;</pre><p>And there you have it! The most important details of the latest release. Remember, if you want to put ideas forward for future versions of Qiskit, you can always <a href="https://github.com/Qiskit/qiskit-terra/issues/new/choose">open a GitHub issue</a> to request a feature or report a bug! And if you want to follow what’s coming up in the next release (as well as releases for other packages in the Qiskit Ecosystem), you can take a look at the <a href="http://qisk.it/release-planning">Qiskit Release Planning Wiki</a>.</p><p><em>Many people contributed to this release, special thanks to (in alphabetical order): Abby Mitchell, Abhiraj Shrotriya, Abigail J. Cross, Alexander Ivrii, AlexanderGroeger, Andir16, Aniket Patil, Christopher J. Wood, David McKay, Diego Emilio Serrano, Edwin Navarro, Elena Peña Tapia, Eric Arellano, Erick Winston, Evgenii Zheltonozhskii, Henry Zou, Hunter Kemeny, Ikko Eltociear Ashimine, Ikko Hamamura, Jake Lishman, Jay M. Gambetta, John Lapeyre, Joonghoon Lee, Julien Gacon, Kevin Hartman, Kevin J. Sung, Kyle Lund, Luciano Bello, Mahnoor Fatima, Matthew Treinish, Michał Górny, MozammilQ, Naoki Kanazawa, Paul Nation, Pieter Eendebak, Raghav, Raynel Sanchez, Ryuhei Yoshida, SamD-1998, Santhosh G S, Simone Gasperini, Takashi Imamichi, Toshinari Itoko, TsafrirA, Will Shanks, adigaboy, atharva-satpute, danielleodigie, jaeunkim, rht</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69e861fbfc88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/qiskit-v0-45-is-here-69e861fbfc88">Qiskit v0.45 is here!</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhance variational quantum algorithms with Qiskit Pulse and Qiskit Dynamics]]></title>
            <link>https://medium.com/qiskit/enhance-variational-quantum-algorithms-with-qiskit-pulse-and-qiskit-dynamics-768249daf8dd?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/768249daf8dd</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[vqa]]></category>
            <category><![CDATA[qiskit]]></category>
            <category><![CDATA[quantum-algorithms]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 01 Nov 2023 14:23:29 GMT</pubDate>
            <atom:updated>2023-11-01T14:23:29.154Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Zhiding Liang, Jinglei Cheng, and Hanrui Wang</em></p><p>The world of quantum computing is always evolving. Researchers and scientists are constantly pushing the boundaries, looking for ways to improve the methods they use to harness the power of quantum mechanics. Variational quantum algorithms (VQAs), for example, have gained significant traction in recent years as useful tools for exploring optimization and quantum chemistry problems. But how can we make them even better?</p><p>Traditionally, researchers approach VQAs at the gate-level. More specifically, they focus on the design of a type of quantum circuit structure known as the “ansatz,” which serves as a kind of template for the quantum state that we believe is close to the solution of the problem at hand. The challenge with this approach is that gate-level quantum circuits have a lot of redundancies and inefficiencies that limit the execution of intricate quantum algorithms on the noisy quantum computing hardware we have today. Fortunately, there’s a new kid on the block who could very well open up a world of possibilities for running VQA algorithms on near-term quantum hardware. It’s called the Parameterized Quantum Pulse Circuit.</p><p>In this blog post, we will showcase how to use a tool from the Qiskit Ecosystem called Qiskit Dynamics to simulate the parameterized quantum pulse circuits, with a focus on the variational quantum eigensolver (VQE) algorithm. More specifically, we will demonstrate the Pulse ansatz on near-term superconducting hardware by using part of the PAN [1] algorithm, implementing a pulse-based ansatz for estimating the H2 molecule’s ground state energy.</p><h4><strong>Pulse programming in Qiskit</strong></h4><p>One of the useful features of Qiskit is that it gives us a lot of flexibility. Most Qiskit users focus on gate-level operations. However, when we’re working with transmon qubits in superconducting hardware, we know the quantum system executes qubit operations by firing microwave pulses at the qubits. Qiskit provides both gate-level and pulse-level programming capabilities, allowing us to get much more creative with how we approach algorithms like VQE.</p><p>Within Qiskit’s Pulse programming, users can customize pulse shapes for transmon qubits, adjusting parameters like amplitude, phase, shape, and frequency. (Check the <a href="https://qiskit.org/documentation/apidoc/pulse.html">Qiskit Pulse</a> module for more details.) Users can also use the Qiskit Ecosystem project <a href="https://qiskit.org/ecosystem/dynamics/tutorials/qiskit_pulse.html">Qiskit Dynamics</a> to quickly and efficiently simulate the generated pulse schedules.</p><p>Pulse circuits offer much more versatility than gate-level programming, but they come at the cost of precision, leading to potential uncertainties in the resulting unitary matrix. This precision is crucial for non-variational algorithms that demand exact rotations and operations. However, in variational quantum algorithms, the primary goal is to approximate a specific quantum state, not to achieve perfect accuracy. Experiments in previous research — VQP [2] and Pan [1] by Liang, Zhiding, <em>et al.</em>, and [3] by Egger, Daniel J,<em> et al.</em> — confirm that shorter circuit latency pulses can effectively achieve these outcomes on IBM hardware via pulse access with both quantum machine learning (QML) and quantum chemistry tasks, such as running the VQE algorithm.</p><h4><strong>Variational Quantum Eigensolver</strong></h4><p>The Variational Quantum Eigensolver (VQE) is a prominent example of variational quantum algorithms. A comprehensive review of its methods and best practices can be found in the <a href="https://qiskit.org/documentation/stubs/qiskit.algorithms.VQE.html">VQE documentation</a> provided in Qiskit. Distinct from conventional quantum algorithms that require fault-tolerant quantum computers for proper execution, VQE can be tailored for efficient operations on our current generation of noisy quantum devices.</p><p>When using the typical gate-level approach, we begin the process of using a VQE algorithm by expressing a system’s Hamiltonian with weighted Pauli matrices, which we can translate into quantum circuits. Next, we deploy an ansatz, essentially a quantum circuit with tunable parameters, to prepare the ground eigenstate of the Hamiltonian. Further measurement of this eigenstate gives us the Hamiltonian’s ground state energy. The power of VQE lies in its iterative nature. It employs classical optimization techniques to adjust the ansatz parameters, minimizing the Hamiltonian’s expectation value and thereby approximating the system’s lowest energy state.</p><p>Different ansatz structures have been proposed, from hardware-efficient models to the UCCSD, and each possesses its own advantages and challenges. Some researchers have even proposed a search-based algorithm, the QuantumNAS [4], to simplify the process of finding the best ansatz. As quantum computing continues to advance, VQE remains a popular area of focus, with ongoing studies exploring innovative ansatz structures and optimization strategies to enhance its precision and applicability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lio31D56sFMuybKd" /></figure><p>Before diving into pulse-level VQE, let’s quickly recap the traditional gate-level approach:</p><ul><li>In gate-level VQE, the parameters we deal with are the angles of rotation gates.</li><li>The ansatz, or the quantum circuit that approximates the desired quantum state, is composed of these parameterized gates (e.g. rotation gates) and fixed gates.</li><li>The primary objective is to tweak these parameters such that the quantum state closely approximates the lowest energy state.</li></ul><p>Now, let’s look at how pulse-level VQE differs from the usual approach:</p><ul><li>Instead of focusing on gate-level parameters, pulse-level VQE shifts attention to the parameters of quantum pulses.</li><li>These quantum pulses are essentially microwave pulses that act directly on superconducting quantum qubits.</li><li>By directly controlling the quantum pulses, we can significantly reduce circuit latency.</li></ul><h4><strong>Why Pulse-Level VQE?</strong></h4><p>You might be wondering, “why should I bother with pulse-level VQE when the gate-level approach already exists?” Here are some compelling reasons:</p><ol><li><strong>Expands the Design Space. </strong>Working with pulses allows us to potentially access areas of the Hilbert space that are inaccessible with a CNOT-based circuit decomposition. For example, leakage outside of the computational sub-space may allow the variational algorithm to take short-cuts.</li><li><strong>Lowers calibration cost.</strong> One of the challenges with quantum gates is calibration. With pulse-level VQE, the lack of calibration is automatically addressed as the parameters are updated to mitigate these errors. For example, quantum pulses can sometimes suffer from issues like overrotation and underrotation. Pulse-level VQE inherently corrects these errors by adjusting the parameters to find the optimal quantum state.</li><li><strong>Reduces Latency.</strong> By directly controlling the quantum pulses, the need for intermediate gate operations is reduced, leading to faster quantum computations.</li></ol><h4><strong>How to build parameterized pulse circuits in Qiskit</strong></h4><p>To construct a pulse schedule, we can use the built-in functionality offered by Qiskit Pulse. This allows us to exercise control over the parameters in the quantum pulses, and extract the corresponding pulses from gates.</p><p>For instance, let’s generate a bell state pulse schedule by directly obtaining the corresponding pulses from the gate-level circuit.</p><pre>from qiskit import QuantumCircuit, pulse<br>from qiskit_dynamics.backend import DynamicsBackend<br><br>qc_test = QuantumCircuit(2)<br>qc_test.h(0)<br>qc_test.cx(0,1)<br>qc_test.measure_all()<br>with pulse.build(backend) as pulse_test:<br>  pulse.call(qc_test)<br><br>pulse_test.draw()</pre><p>We can visualize the pulse schedule as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1hzvlY97E8BWmxXa" /></figure><p>Furthermore, we can build parameterized quantum pulse circuits (see example code below). Here, we use the drag pulse shape from a single qubit gate, since drag pulse is the native pulse in IBM’s superconducting quantum machines. By using drag pulses, we can avoid population leaking outside of the computational subspace. However, we can also build a parameterized pulse from scratch depending on our needs.</p><pre>from qiskit.pulse import Schedule, GaussianSquare, Drag, Delay, Play, ControlChannel, DriveChannel<br><br>def drag_pulse(backend, amp, angle):<br>  backend_defaults = backend.defaults()<br>  inst_sched_map = backend_defaults.instruction_schedule_map<br>  x_pulse = inst_sched_map.get(‘x’, (0)).filter(channels = [DriveChannel(0)], instruction_types=[Play]).instructions[0][1].pulse<br>  duration_parameter = x_pulse.parameters[‘duration’]<br>  sigma_parameter = x_pulse.parameters[‘sigma’]<br>  beta_parameter = x_pulse.parameters[‘beta’]<br>  pulse1 = Drag(duration=duration_parameter, sigma=sigma_parameter, beta=beta_parameter, amp=amp, angle=angle)<br>  return pulse1</pre><p><strong>How to simulate the pulse circuit with Qiskit Dynamics</strong></p><p>To run the pulse circuit using Qiskit Dynamics, first we need to initialize Qiskit Dynamics itself.</p><pre>from qiskit_dynamics import Solver, DynamicsBackend<br>from qiskit_dynamics.backend import default_experiment_result_function<br>from qiskit_dynamics.array import Array<br>import jax<br>from qiskit.providers.fake_provider import *<br><br>gate_backend = FakeManila()<br>gate_backend.configuration().hamiltonian[‘qub’] = {‘0’: 2,’1&#39;: 2,’2&#39;: 2,’3&#39;: 2,’4&#39;: 2}<br>jax.config.update(“jax_enable_x64”, True)<br>jax.config.update(“jax_platform_name”, “cpu”)<br>Array.set_default_backend(“jax”)<br>pulse_backend = DynamicsBackend.from_backend(gate_backend, evaluation_mode=”sparse”)<br>solver_options = {“method”: “jax_odeint”, “atol”: 1e-6, “rtol”: 1e-8}<br>pulse_backend.set_options(solver_options=solver_options)<br>pulse_backend.configuration = lambda: gate_backend.configuration()</pre><p>After the initialization, let’s try to run the pulse_test (the Bell state circuit we showed in the last section) on Qiskit Dynamics.</p><pre>results = pulse_backend.run(pulse_test).result()<br>counts = results.get_counts()</pre><p><strong>Pulse based VQE for Ground State Energy of H2</strong></p><p>We will now perform ground state energy estimation for the H2 molecule using our Pulse-based VQE. We’ll need to start with the following preprocessing steps:</p><ol><li>Use ‘sto-3g’ Gaussian equations to fit the spin orbital of the H2 molecule with bond length equals 0.735.</li><li>Through the Fermionic mapping, we get the Pauli strings and corresponding coefficients that describe the problem. Based on these Pauli strings, we can generate the observable layer for the VQE algorithm.</li></ol><pre>from qiskit_nature.units import DistanceUnit<br>from qiskit_nature.second_q.drivers import PySCFDriver<br>from qiskit_nature.second_q.mappers import JordanWignerMapper,ParityMapper,QubitConverter<br>import numpy as np<br>simplified_h2_molecule = &quot;&quot;&quot;<br>H 0.0 0.0 0.0<br>H 0.0 0.0 0.735<br>&quot;&quot;&quot;<br><br>driver = PySCFDriver(<br>  atom=ultra_simplified_ala_string.strip(),basis=&#39;sto3g&#39;,<br>  charge=0,<br>  spin=0,<br>  unit=DistanceUnit.ANGSTROM<br>)<br>qmolecule = driver.run()</pre><p>We define the VQE and build our own custom pulse ansatz. Then we can use the Qiskit Dynamics module to obtain the results of the estimated energy of H2. (For more details regarding implementation based on the PAN [1] algorithm, please refer to this <a href="https://github.com/zlianghahaha/QPulse/blob/main/qiskit_dynamics_tutorial_for_PulseAnsatz.ipynb">pulse-level VQE tool</a> based on Qiskit-Pulse and Qiskit-Dynamics.)</p><pre>def vqe(params,pauli_dict,pulse_backend, backend,n_qubit,n_shot):<br>  print(“params in def chemistry in vqe.py: “, params)<br>  # assert(len(params)%2==0)<br>  width_len = int(len(params)-1*(n_qubit-1))<br>  split_ind = int(width_len/2)<br>  amp = np.array(params[:split_ind])<br>  angle = np.array(params[split_ind:width_len])*np.pi*2<br>  width_1 = (np.array(params[width_len:]))<br>  num_items = (1024–256) // 16 + 1<br>  width_norm = (width_1–256) / (1024–256)<br>  width_norm = np.clip(width_norm, 0, 1)<br>  width = (np.round(width_norm * (num_items — 1)) * 16 + 256).astype(int)<br>  amp = amp.tolist()<br>  angle = angle.tolist()<br>  width = width.tolist()<br>  keys = [key for key in pauli_dict]<br>  values = [pauli_dict[key] for key in pauli_dict]<br>  expect_values = []<br>  for key, value in zip(keys, values):<br>    prepulse = HE_pulse(backend, amp, angle, width)<br>    expect = vqe_one(prepulse, n_qubit, n_shot, pulse_backend, backend, key, value)<br>    expect_values.append(expect)<br>  print(“E for cur_iter: “,sum(expect_values))<br>  return sum(expect_values)</pre><p>Here is a plot showing the convergence of estimated energy while training pulse-based VQE for the H2 molecule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/0*50a2fwYnWt5FCgqP" /></figure><p><strong>Conclusion</strong></p><p>Pulse-level VQE offers a promising avenue for quantum optimization. By shifting the focus from gate-level parameters to quantum pulse parameters, we can address several challenges inherent in quantum computing, such as calibration and rotation errors.</p><p>We hope this blog post provides you with a deeper understanding of pulse-level VQE and its advantages. Stay tuned for more insights into the fascinating world of quantum computing!</p><p><strong>References</strong></p><p>[1] Liang, Zhiding, et al. “Pan: Pulse ansatz on nisq machines.” <em>arXiv preprint arXiv:2208.01215</em> (2022).</p><p>[2] Liang, Zhiding, et al. “Variational quantum pulse learning.” <em>2022 IEEE International Conference on Quantum Computing and Engineering (QCE)</em>. IEEE, 2022.</p><p>[3] Egger, Daniel J, et al. “Pulse variational quantum eigensolver on cross-resonance-based hardware.” <em>PhysRevResearch.5.033159</em>. American Physical Society<em> </em>(2023).</p><p>[4] Wang, Hanrui, et al. “Quantumnas: Noise-adaptive search for robust quantum circuits.” <em>2022 IEEE International Symposium on High-Performance Computer Architecture (HPCA)</em>. IEEE, 2022.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=768249daf8dd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/enhance-variational-quantum-algorithms-with-qiskit-pulse-and-qiskit-dynamics-768249daf8dd">Enhance variational quantum algorithms with Qiskit Pulse and Qiskit Dynamics</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Schrödinger’s cat meets Qiskit: Why do we never see cats that are both dead and alive?]]></title>
            <link>https://medium.com/qiskit/schr%C3%B6dingers-cat-meets-qiskit-why-do-we-never-see-cats-that-are-both-dead-and-alive-6e9adf7a09e0?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e9adf7a09e0</guid>
            <category><![CDATA[quantum-entanglement]]></category>
            <category><![CDATA[schrodingers-cat]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-superposition]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 14:26:01 GMT</pubDate>
            <atom:updated>2024-04-09T18:16:12.318Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Maria Violaris, PhD student at the University of Oxford</em></p><p>Can a cat be dead and alive at the same time? In 1935, quantum physicist Erwin Schrödinger came up with a thought experiment showing that, according to quantum mechanics, a cat can exist in a superposition of being alive and dead. Schrödinger’s aim was to demonstrate the absurdity of quantum mechanics. In everyday life, we never see cats that are simultaneously alive and dead — indeed, we never see <em>any</em> large object in a state of quantum superposition. By modelling Schrödinger’s cat as a qubit and simulating his thought experiment on a quantum computer, we can resolve the apparent paradox, and explain how even a quantum mechanical cat will always be observed as either dead or alive.</p><p>Welcome back to the Quantum Paradoxes series, where we resolve quantum paradoxes using the tools of quantum computing. In addition to blog posts like this one, each instalment of the series includes <a href="https://www.youtube.com/watch?v=sBtAe8BsOhA">a video on the Qiskit YouTube channel</a> and <a href="https://github.com/maria-violaris/quantum-paradoxes/blob/main/schrodingers-cat.ipynb">a Qiskit code tutorial</a> that shows you how to reproduce our simulations for yourself. So far, this series has covered five thought experiments ranging from <a href="https://medium.com/qiskit/building-quantum-bomb-testers-and-other-thought-experiments-with-quantum-computers-c160060fdde4">the quantum bomb tester</a> to <a href="https://medium.com/qiskit/how-to-count-pigeons-using-a-quantum-computer-without-breaking-math-32404fd2abc4">the quantum pigeonhole paradox</a>, and we’ve got plenty more on the way. This week, we’re centering our attention on perhaps the most famous thought experiment in the history of quantum mechanics. But before we see how quantum computing helps us resolve Schrödinger’s apparent paradox, let’s take a closer look at the original thought experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2E8tY68L8RfqBDJdlJpPQ.png" /></figure><p><a href="https://www.youtube.com/watch?v=sBtAe8BsOhA"><strong><em>Click here</em></strong></a><strong><em> to watch “Schrödinger’s Cat Explained with Quantum Computing” on the Qiskit YouTube Channel.</em></strong></p><p><strong>Introducing Schrödinger’s cat</strong></p><p>Imagine we put a cat inside a box along with a vial of poison, a small hammer and a radioactive atom. If the atom decays, it will trigger the hammer to smash open the vial of poison and the cat will die. If the atom does not decay, the hammer will not smash open the vial of poison and the cat will stay alive.</p><p>Importantly, the radioactive atom can be in a quantum superposition of “decaying” and “not decaying.” Since everything inside the box is ultimately made of atoms, let’s treat the entire box as a quantum system. As the radioactive atom interacts with the hammer, which interacts with the poison, which interacts with the cat, they all enter a big joint superposition.</p><p>This means the states of the atom, hammer, poison and cat have become quantum entangled. In one part of their overall state, the atom has decayed and the cat is dead. In the other part, the atom has not decayed and the cat is alive. We are left with a seemingly absurd conclusion that inside the box, the cat is in a superposition of being alive and dead at the same time!</p><p><strong>The collapse postulate</strong></p><p>The apparent paradox comes in when an observer looks inside the box. At that point, they will only see a living cat, or a dead one.</p><p>To explain this, quantum theorists developed the <em>collapse postulate</em>, which states that when you observe a quantum system in superposition, it undergoes an irreversible collapse into just one state, with some probability. Applying the collapse postulate to Schrödinger’s cat means that if anyone opens the box containing the cat and observes the cat’s state, their observation will cause a collapse so they only see either a living cat, or a dead one.</p><p>The idea that observation causes an irreversible collapse to a single state is often referred to as the “Copenhagen Interpretation” of quantum mechanics. This viewpoint is typically presented as the conventional explanation for why we see a single outcome, yet it fails to address the key questions of the Schrödinger’s cat thought experiment.</p><p><strong>Is a cat an observer?</strong></p><p>A natural question arises from this postulate: surely the cat itself is an observer? If so, the cat’s observation of the atom should be enough to collapse its state into being decayed or not decayed. The cat will then either be dead or alive, with no need for absurd, cat-sized superpositions.</p><p>The problem with this reasoning is that it breaks down when we apply it to smaller and smaller scales. Does the vial of poison count as an observer which can collapse the atom’s state? How about the hammer? We could even go down to the scale of using a single particle as a detector — one that changes state if the atom decays, and stays the same if it does not. Would this single-particle detector cause the radioactive atom’s state to collapse?</p><p>The Copenhagen interpretation has no answer to these questions. It does not say what counts as an observer, simply that observation somehow causes an irreversible collapse. It does not tell us whether hammers, vials of poison, or cats can be in a quantum superposition.</p><p>To answer these questions, we need theories of quantum mechanics that explicitly model the measurement process. These theories fall into two main categories, known as collapse theories and no-collapse theories.</p><p><strong>Collapse theories</strong></p><p>Collapse theories modify the laws of quantum mechanics, such that when we describe Schrödinger’s cat using these modified laws, they explicitly model the cause of collapse. Under these theories, it is specific properties of the system — e.g., mass, size, complexity, etc. — that cause the irreversible collapse into a single state. Whether or not hammers and cats can be in superpositions depends on each individual theory’s precise conditions for collapse.</p><p>The standard dynamical laws of quantum mechanics have been thoroughly studied, tested, and extended to incorporate special relativity. To date, the objective collapse proposals which modify quantum mechanics remain incomplete theories, and using them to recover all the results of standard quantum mechanics is an open problem.</p><p><strong>No-collapse theories</strong></p><p>An alternative approach is to take the existing theory of quantum mechanics at face value as a universal theory — meaning it applies to macroscopic objects, detectors, observers, and our environment. Then, observing Schrödinger’s cat actually corresponds to the observer (or measurement apparatus) becoming quantum entangled with the cat. The observer, cat and atom really do enter a big joint superposition of states.</p><p>Crucially, this measurement process is reversible — there is no irreversible collapse. The observer, cat and atom could in theory be unentangled, and return to their original states.</p><p>One version of quantum theory which uses this “no collapse” approach is Everettian quantum mechanics. Applying it to the Schrödinger’s cat thought experiment, we find that the act of observation precipitates the emergence of two branches of the universe — one where an observer sees an alive cat and one where an observer sees a dead cat. Hence, this is commonly known as the “many worlds” interpretation.</p><p>Other no-collapse versions of quantum theory include Bohmian mechanics, relational quantum mechanics, and QBism, amongst others. Explanations for the physical meaning of a superposition, and the emergence of measurement outcome probabilities, continue to be discussed and debated among quantum scientists.</p><p><strong>Can Schrödinger’s cat come back from the dead?</strong></p><p>If we treat observers and the environment as quantum systems, then there’s a clear explanation for why we never see cats being dead and alive in everyday life. As soon as an observer encounters that cat, they join its entangled superposition. As such, the observer only sees the cat being either dead or alive.</p><p>However, there is still a missing ingredient for universal quantum theory to explain our everyday experience: since measurements are reversible, measured objects can become unentangled. Schrödinger’s cat could become unentangled from the radioactive atom — it could even come “back from the dead” and return to a fixed alive state!</p><p>This problem is known as the emergence of classicality in quantum theory. How does a classical world where measurement results have fixed outcomes emerge if all the underlying laws of physics are quantum mechanical, and therefore reversible? Here we need to introduce the notion of <em>decoherence</em>.</p><p><strong>Decoherence</strong></p><p>To understand decoherence, I like to imagine the environment surrounding the observer as a collection of dominoes. As soon as we knock over one domino, it triggers a chain reaction that spreads out across the entire set until they have all been knocked over.</p><p>This is analogous to what happens after the observer measures Schrödinger’s cat. As the observer interacts with their environment, they cause a chain reaction where more and more of the environment surrounding them enters the giant entangled superposition with the cat.</p><p>Now, it is much easier to knock down all the dominoes than to stand them all back up. In a similar way, it is much easier for the information about whether the cat is alive or dead to spread out across the environment than it is to erase it from the environment. This is why the cat becomes effectively fixed into either the dead state or alive state: without quantum control over the environment, not even the most powerful technology can unentangle the cat from its environment.</p><p>We call this process decoherence, because the atom, cat and observer lose their quantum coherence once they interact with the environment. In general, when a system is measured by any part of the environment over which we have no quantum control, the system is projected into a single state, destroying its coherence.</p><p>Fighting the effects of decoherence is one of the key challenges of quantum computing. To preserve the coherent properties of the quantum states we use for computation, we want to keep them as isolated from the environment as possible. Once they interact with the environment, qubits decohere and become fixed into separate branches, where they are either in the |0&gt; state or the |1&gt; state.</p><p><strong>Effective collapse</strong></p><p>Decoherence gives the exact appearance of measurement causing an irreversible collapse: if we write down the state of Schrödinger’s cat mathematically, it is exactly the same whether it has undergone a reversible quantum measurement by its environment or an irreversible collapse.</p><p>A fact which is often under-appreciated in explanations of decoherence is that we do not actually need a large, macroscopic environment to cause the cat’s state to decohere. Using even a single-particle detector to store information about whether the cat is dead or alive would effectively collapse the cat’s state. The important property for this effective collapse is that we no longer have access to quantum control over the measurement device or environment. In general, quantum control over a larger device is more difficult, making it harder to unentangle from the measured system.</p><p><strong>Schrödinger’s cat on a quantum computer</strong></p><p>The Schrödinger’s cat thought experiment becomes much simpler when it is expressed via qubits and quantum circuits.</p><p>We can model the atom and the cat as qubits, which we can put into an entangled quantum superposition using basic quantum gates. Then we can model irreversible collapse by adding a measurement operation to the cat qubit, or model a quantum observer’s measurement by representing the observer as a third qubit that becomes entangled with the cat and the atom. Finally, we can model environment-induced decoherence by treating the environment as a large collection of qubits, which join in the entangled superposition.</p><p>Ultimately the quantum-computing representation of Schrödinger’s cat leads to the creation of states in a superposition of having a large number of qubits in the |0&gt; state, and a large number of qubits in the |1&gt; state. The technical term for these superposition states is actually “Schrödinger’s cat states” because of this thought experiment! Preparing good quality cat states turns out to be useful for some error-correction techniques.</p><p>To understand in detail how to represent Schrödinger’s thought experiment as a quantum circuit you can run on a quantum computer, and to learn how to code it yourself using Qiskit, have a watch of <a href="https://www.youtube.com/watch?v=sBtAe8BsOhA">the Qiskit YouTube video</a>, and see <a href="https://github.com/maria-violaris/quantum-paradoxes/blob/main/schrodingers-cat.ipynb">the Jupyter Notebook</a> for the complete Qiskit code, ready to run.</p><p>Make sure to follow the Qiskit Blog and <a href="https://www.youtube.com/@qiskit">subscribe to our YouTube channel</a> for lots more paradox-busting to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e9adf7a09e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/schr%C3%B6dingers-cat-meets-qiskit-why-do-we-never-see-cats-that-are-both-dead-and-alive-6e9adf7a09e0">Schrödinger’s cat meets Qiskit: Why do we never see cats that are both dead and alive?</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Important changes to Qiskit documentation and learning resources]]></title>
            <link>https://medium.com/qiskit/important-changes-to-qiskit-documentation-and-learning-resources-7f4e346b19ab?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f4e346b19ab</guid>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[qiskit]]></category>
            <category><![CDATA[quantum-learning]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 18 Oct 2023 14:03:38 GMT</pubDate>
            <atom:updated>2023-10-18T14:03:38.720Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, we’re announcing important changes to Qiskit.org that you should be aware of. Starting on November 29, 2023, Qiskit Documentation and Qiskit educational resources will live on IBM Quantum Platform and will be removed from Qiskit.org. We will be slowly moving content over until then.</p><p>Qiskit is, first and foremost, an open source programming language and technology for programming quantum computers. We remain committed to our open source community, and value the contributions they have made since Qiskit’s inception. However, it has been challenging to maintain Qiskit documentation and educational resources in their current form. We’ve also received lots of user feedback that these resources needed to be consolidated and better-organized to make Qiskit easier to use on real quantum hardware. Our hope is that the community will no longer need to jump between scattered, disjointed resources to develop quantum programs.</p><p>That’s why we’re migrating Qiskit educational resources and documentation into the IBM Quantum Platform<strong> — </strong>to offer a more unified experience for users. Our eventual plan is to sunset all of the content on <a href="http://qiskit.org/">Qiskit.org</a> and move it to the IBM Quantum Platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVSwQ7Z6EZ4NYB1GhUWQdA.png" /></figure><p>IBM Quantum is committed to open-source software development and education, so none of the old content is going away. Community-built content, such as the Qiskit Textbook, will be handed off to the community and remain available on GitHub.</p><p>Things will look a little different — so let’s walk you through the changes.</p><p><strong>Qiskit Documentation</strong></p><p>Qiskit and Qiskit Runtime documentation are moving to <a href="https://docs.quantum-computing.ibm.com/">https://docs.quantum-computing.ibm.com/</a></p><p>This migration is ongoing, with content due to be fully removed from Qiskit.org by the end of the year. Qiskit.org/documentation and q<a href="https://qiskit.org/ecosystem/ibm-runtime/">iskit.org/ecosystem/ibm-runtime/</a> will go away and redirect to <a href="https://docs.quantum-computing.ibm.com/">https://docs.quantum-computing.ibm.com</a>.</p><p>Docs will also be structured differently. Instead of API reference, tutorials, how-to guides and explanations, the content will be split into the following sections (to support natural workflows):</p><ol><li><a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/start/install">Install</a>: Begin using our tools and platforms with install and setup instructions.</li><li><a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/build">Build</a>: Design and develop quantum circuits with primitives and advanced methods like dynamic circuits and mid-circuit measurements. You can also find our circuit library here.</li><li><a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/verify">Verify</a>: Validate and evaluate your quantum circuits.</li><li><a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/run">Run</a>: Run on our hardware with job configuration options such as sessions.</li><li><strong>API reference</strong>: Find API references for <a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/api/qiskit">Qiskit</a>, <a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/api/qiskit-ibm-runtime/runtime_service">Qiskit Runtime IBM Client</a>, <a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/api/runtime/tags/programs">Qiskit IBM Runtime Rest API</a>, and <a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/api/qiskit-ibm-provider/ibm_provider">Qiskit IBM Provider</a> in the API reference drop-down menu above. You can also find the <a href="https://qiskit-docs-preview-pr-73.1799mxdls7qz.us-south.codeengine.appdomain.cloud/errors">Error code registry</a> here.</li></ol><p>Users will have two ways to submit feedback and report bugs. For non API ref content, they should report issues/feedback in <a href="https://github.com/Qiskit/documentation/issues/new/choose">https://github.com/Qiskit/documentation/issues/new/choose</a>. For any user interface-related issues, click the feedback button.</p><p>Qiskit and Runtime docs will remain open source, and we still welcome community feedback and contributions to documentation. The translations program will also continue. We are currently working to define a robust process to facilitate contributions, so we are temporarily pausing contribution reviews until the content migration is complete. More details to come.</p><p><strong>Qiskit Textbook</strong></p><p>Starting today, the following courses will redirect to the new learning app:</p><ul><li><a href="https://learning.quantum-computing.ibm.com/course/basics-of-quantum-information">Basics of quantum information</a>, with John Watrous</li><li><a href="https://learning.quantum-computing.ibm.com/course/fundamentals-of-quantum-algorithms">Fundamentals of quantum algorithms</a>, with John Watrous</li><li><a href="https://learning.quantum-computing.ibm.com/course/variational-algorithm-design">Variational algorithm design</a></li><li><a href="https://learning.quantum-computing.ibm.com/catalog?content=tutorials">Qiskit tutorials</a></li></ul><p>We invite you to explore IBM Quantum Learning to read these courses and explore the new <a href="https://learning.quantum-computing.ibm.com/course/practical-introduction-to-quantum-safe-cryptography">Quantum-Safe Cryptography</a>course. Over the next few months, we’re planning more free courses to help you learn foundations of quantum information, and experiment with Qiskit Runtime and IBM Quantum.</p><p>We will sunset the textbook and the syllabus creation tool on November 29, 2023. Legacy textbook pages will remain available through a public archive <a href="https://github.com/Qiskit/textbook">on Github</a>. Once archived, this content will not be maintained by IBMers, and new external contributions will not be accepted. We understand that the textbook is a much-beloved resource, and you’ll still be able to stand up the textbook locally with the instructions in the README.</p><p><strong>Why we’re making this change</strong></p><p>Moving docs and learning resources will bring things closer to the same platform that developers, researchers, and students use every day for running actual workloads on quantum systems. Now, they’ll be able to find all of their resources in one, easy-to-navigate place.</p><p>IBM Quantum Platform will now be the home for all education, from the basics of quantum computing and programming with Qiskit to experimenting and prototyping with Qiskit Runtime on IBM Quantum systems. We’ll continue to develop this content in the open to promote trust and transparency within the quantum community, but moving it to the IBM Quantum Platform will help to ensure the quality of this content continues to be high as possible.</p><p>We’re excited about this change, and hope that the result will be a seamless quantum computing experience for everyone. We look forward to building together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f4e346b19ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/important-changes-to-qiskit-documentation-and-learning-resources-7f4e346b19ab">Important changes to Qiskit documentation and learning resources</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A guide to the Qiskit circuit library]]></title>
            <link>https://medium.com/qiskit/a-guide-to-the-qiskit-circuit-library-36ee0f189956?source=rss-12b2fb01d834------2</link>
            <guid isPermaLink="false">https://medium.com/p/36ee0f189956</guid>
            <category><![CDATA[variational-circuits]]></category>
            <category><![CDATA[qiskit]]></category>
            <category><![CDATA[quantum-circuits]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-gate]]></category>
            <dc:creator><![CDATA[Qiskit]]></dc:creator>
            <pubDate>Wed, 04 Oct 2023 13:48:39 GMT</pubDate>
            <atom:updated>2023-10-04T13:48:39.876Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Robert Davis, Julien Gacon, Abby Mitchell, and Luciano Bello</em></p><p>When it comes to quantum circuits, sometimes the “do it yourself” approach is best. Even for common subroutines like the quantum Fourier transform (QFT), a user may find that it’s better to build their circuit by hand, so they can implement it in a way that works for their specific use case. But in many cases, the circuits we need are well-studied, and we can avoid having to reinvent the wheel (potentially creating bugs in the process) by simply using circuits that already exist. That’s just one reason why we created the Qiskit circuit library.</p><p><a href="https://qiskit.org/documentation/apidoc/circuit_library.html#module-qiskit.circuit.library">The Qiskit circuit library</a> is a collection of valuable, well-studied circuits and gates that Qiskit users can easily plug into their quantum circuits. These include useful tools for a wide array of quantum computing applications—including quantum machine learning, quantum chemistry, circuits for benchmarking, and even a number of circuits that are hard to simulate classically. Whether you’re a complete beginner or a bona fide Qiskit wizard, we’re sure you’ll find something useful in our extensive circuit library module.</p><h3>Why every Qiskit user should give the circuit library a closer look</h3><p>Before we launched the circuit library a few years ago, users could only run quantum circuits they had constructed manually. If a user wanted to implement a phase estimation, a Fourier transform, or a variational circuit—really anything at all—they either had to build it themselves, or build a function that generated the circuit for them. In either case, the process was cumbersome, and documentation was limited and disorganized.</p><p>As the Qiskit community began to grow, we developed a clearer sense of which circuits were most important to users. Eventually, we began to organize these into the circuit library we have today. This library is designed to be a repository of building blocks—a collection of any and all circuits we think are valuable to users. Here, we define “valuable” circuits as those that are either (1) widely used for common quantum computing tasks, (2) difficult to simulate classically, or (3) useful for quantum hardware benchmarking.</p><p>For example, the quantum Fourier transform (QFT) is an essential building block in a number of quantum algorithms including quantum phase estimation and the famous Shor’s algorithm. Now, if they really want to, a user can certainly run a QFT on quantum hardware by building the circuit manually. That might look something like this:</p><pre>import numpy as np<br>from qiskit import QuantumCircuit<br><br>def build_qft(n):<br>   circuit = QuantumCircuit(n)<br>   for j in reversed(range(n)):<br>       circuit.h(j)<br>       for k in reversed(range(j)):<br>           circuit.cp(np.pi * 2. ** (k - j), j, k)<br><br>   for j in range(n // 2):<br>       circuit.swap(j, n - j - 1)<br><br>   return circuit<br><br>qft = build_qft(5)</pre><p>But users who want to save time on this common quantum computing task can simply import the QFT from the circuit library and use it in their subroutines like so:</p><pre>from qiskit.circuit.library import QFT<br><br>qft = QFT(5)</pre><p>Most Qiskit users are aware the circuit library exists, but not everyone realizes just how useful it can be. That’s why we suggest all users spend time familiarizing themselves with it. The circuit library provides essential tools for building quantum algorithms, and gives users the ability to write programs at a higher level of abstraction. Gates and other elements found in the circuit library are developed so that users can easily plug them into their own quantum circuits using the QuantumCircuit.append() method, meaning users shouldn’t need to concern themselves with the lower level details of how those elements actually work.</p><p>The circuit library also provides tools that help users investigate properties of the quantum system itself, such as measuring quantum volume, and it offers useful information about the gates and circuits we use most often. It really is a library in the truest sense—in many cases; documentation for gates and other objects include links to a paper detailing the theory upon which they’re based.</p><p>Now, let’s take a look at some of the different kinds of circuits and gates that users will find in the Qiskit Circuit Library.</p><h3>Variational quantum circuits (“N-local circuits”)</h3><p>The <strong>N-local circuits sub-module</strong> of the circuit library contains a selection of subclasses that serve as parameterized models in <strong>variational algorithms</strong>, such as the variational quantum eigensolver (VQE) algorithm and the quantum approximate optimization algorithm (QAOA).</p><p>In fields like chemistry and physics, these algorithms serve to approximate wave functions efficiently, which is a task that is generally hard for classical computers. Variational algorithms are also useful for problems in classical optimization and machine learning, where a quantum computer might enable a better optimization of the objective.</p><p>Let’s take a look at an example of how to define a problem instance for a VQE algorithm, using the EfficientSU2 ansatz circuit taken from the circuit library. In this example, we’ll derive our Hamiltonian from a quantum chemistry problem:</p><pre>from qiskit.quantum_info import SparsePauliOp<br><br>hamiltonian = SparsePauliOp.from_list(<br>    [(&quot;YZ&quot;, 0.3980), (&quot;ZI&quot;, -0.3980), (&quot;ZZ&quot;, -0.0113), (&quot;XX&quot;, 0.1810)]<br>)</pre><p>As mentioned above, our choice of ansatz is the EfficientSU2 circuit. By default, the EfficientSU2 circuit linearly entangles qubits. This makes it ideal for use in quantum hardware with limited connectivity:</p><pre>from qiskit.circuit.library import EfficientSU2<br><br>ansatz = EfficientSU2(hamiltonian.num_qubits)<br>ansatz.draw(&quot;mpl&quot;)</pre><p>Here’s what the circuit looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*9XyeYnLjOrTMeoGbMSbEdQ.png" /></figure><p>Try printing with the following code to see how the circuit is structured!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*jPWUJYAB68VekgC2THiK7Q.png" /></figure><p>Based on the previous figure, we know that our ansatz circuit is defined by a vector of parameters, <em>θi</em>​, with the total number given by:</p><pre>num_params = ansatz.num_parameters<br>print(num_params)</pre><p>And in this case we get the output:</p><pre>16</pre><p>For an example on how to use the circuit library to run a VQE, see: <a href="https://qiskit.org/ecosystem/algorithms/tutorials/01_algorithms_introduction.html">https://qiskit.org/ecosystem/algorithms/tutorials/01_algorithms_introduction.html</a></p><h3>Data encoding circuits</h3><p>Data encoding circuits enable the preparation of input data for QML applications. There are several techniques to encode classical data, or features, into a quantum state, for example:</p><ul><li>Amplitude encoding: Encode the features into the amplitude of a basis state. This allows to store 2^n numbers in a single state, but can be costly to implement</li><li>Basis encoding: Encode an integer k by preparing the corresponding basis state |k&gt;</li><li>Angle encoding: Encode features as rotation angles in a variational quantum circuit</li></ul><p>Deciding which of these approaches is best really depends upon the specifics of your application. On current quantum computers, however, we often use angle encoding.</p><p>One example is the ZZFeatureMap found in the circuit library:</p><pre>from qiskit.circuit.library import ZZFeatureMap<br><br>feature = [0.2, 0.4, 0.8]<br>feature_map = ZZFeatureMap(feature_dimension=len(feature))<br><br>encoded = feature_map.assign_parameters(feature)<br>encoded.draw(&#39;mpl&#39;)</pre><p>which prints</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*mZKPmyZiPkFSHluJE82aMQ.png" /></figure><p>Try printing with the following code to see how the circuit is structured!</p><pre>encoded.decompose().draw(&#39;mpl&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oplw7M7-YeTCkg43I7QxcA.png" /></figure><p>For an example of how to use data encoding circuits for classication, see: <a href="https://qiskit.org/ecosystem/machine-learning/tutorials/02_neural_network_classifier_and_regressor.html">https://qiskit.org/ecosystem/machine-learning/tutorials/02_neural_network_classifier_and_regressor.html</a>.</p><h3>Time evolution circuits</h3><p>Time evolution circuits allow us to evolve a quantum state in time. Physics researchers make use of them for a wide-array of applications, including investigations of thermalization properties or potential phase transitions of a system. Time evolution circuits are also a fundamental building block of chemistry wave functions—e.g., for unitary coupled-cluster trial states—and of the QAOA algorithm we use for optimization problems.</p><pre>from qiskit.circuit.library import PauliEvolutionGate<br>from qiskit.circuit import QuantumCircuit<br>from qiskit.quantum_info import SparsePauliOp<br><br>hamiltonian = SparsePauliOp([&quot;ZZI&quot;, &quot;IZZ&quot;])<br><br># prepare an initial state with a Hamadard on the middle qubit<br>state = QuantumCircuit(3)<br>state.h(1)<br><br>evolution = PauliEvolutionGate(hamiltonian, time=1)<br><br># evolve state by appending the evolution gate<br>state.append(evolution)<br><br>state.draw(&#39;mpl&#39;)</pre><p>And in this case we get the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*4hT3pJJMc62sAFmWnjYnhg.png" /></figure><h3>Benchmarking and complexity theory circuits</h3><p>Benchmarking and complexity theory circuits are a vital tool for anyone working with quantum computers. They give us a sense of how well our hardware is actually working, and the true level of computational complexity involved in the problems we want to solve.</p><p>One of the most important examples of this is the QuantumVolume circuit, which allows us to quantify the largest random circuit of equal width and depth that a near-term quantum computer of relatively modest size can successfully implement. This single metric can help us understand how well the quantum computer is doing in terms of fidelity of operations, qubit connectivity, gate set calibration, and circuit rewiring tool chains.</p><p>A quantum volume model circuit comprises layers of Haar random elements of SU(4) applied between corresponding pairs of qubits in a random bipartition. Here’s an example of a quantum volume circuit built in Qiskit that runs on four qubits:</p><pre>from qiskit.circuit.library import QuantumVolume<br><br>qv = QuantumVolume(4)<br>qv.decompose().decompose().draw(&#39;mpl&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ufunQI5QwwmvjKoQNuqilg.jpeg" /></figure><p>Some quantum circuits have been shown to deliver advantage over classical algorithms. Many readers will already be familiar with some of the more famous examples of these circuits, which include Shor’s algorithm for prime factorizationand the Grover search algorithm.</p><p>The circuit library contains circuits that are conjectured to be hard to simulate classically, such as the IQP circuit. (Learn more about the IQP circuit <a href="https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.117.080501">here</a>.)</p><p>It also contains building blocks for algorithms that are believed to provide quantum advantage. Some of these are of a more practical nature. For example, Qiskit users can build the circuit for Grover’s algorithm by using GroverOperator.</p><p>Others are of more theoretical interest. For example, Fourier checking uses the FourierChecking method. (Click <a href="https://arxiv.org/pdf/0910.4698.pdf">here</a> to learn more about Fourier checking.)</p><p>Let’s take a look at an example of the IQP circuit:</p><pre>from qiskit.circuit.library import IQP<br><br>interactions = [[6, 5, 3], [5, 4, 5], [3, 5, 1]]<br>circuit = IQP(interactions)<br>circuit.decompose().draw(&quot;mpl&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*9Q27WfTWxbOQwnSoZsF2jw.png" /></figure><h3>Arithmetic circuits</h3><p>Some users may be surprised to learn that the circuit library includes numerous quantum circuits that are designed to perform classical arithmetic operations on qubit states or state amplitudes, such as addition or multiplication. These are useful for applications like amplitude estimation, which have the potential to be valuable in finance applications, and in algorithms like HHL, which is a proposed method for solving linear systems of equations.</p><p>As an example, let’s try adding two 3-bit-long numbers, using a ripple-carry circuit to perform in-place addition (CDKMRippleCarryAdder). This adder take two numbers—A and B—then it adds them, and “sets” B with the result. In this example, A=2 and B=3:</p><pre>from qiskit.circuit.library import CDKMRippleCarryAdder<br>adder = CDKMRippleCarryAdder(3)  # Create an adder of 3-bit-long numbers<br><br>from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister<br><br># Create the number A=2<br>reg_a = QuantumRegister(3, &#39;a&#39;)<br>number_a = QuantumCircuit(reg_a)<br>number_a.initialize(&#39;010&#39;) # number 2 - equivalent to format(2, &#39;03b&#39;)<br><br># Create the number B=3<br>reg_b = QuantumRegister(3, &#39;b&#39;)<br>number_b = QuantumCircuit(reg_b)<br>number_b.initialize(&#39;011&#39;)  # number 3 - equivalent to format(3, &#39;03b&#39;)<br><br># Create a circuit to hold everything, including a classical register to put the result<br>reg_result = ClassicalRegister(3)<br>circuit = QuantumCircuit(*adder.qregs, reg_result)<br><br># Compose setting A and B with the adder. Measure the result in B<br>circuit = circuit.compose(number_a, qubits=reg_a).compose(number_b, qubits=reg_b).compose(adder)<br>circuit.measure(reg_b, reg_result)<br>circuit.draw(&#39;mpl&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*Be2c0u_z2CLswvCiqlE4Bg.png" /></figure><p>By calling the sampler in qiskit.primitives.Sampler, it is possible to simulate the execution of this circuit and observe that the result is 5.</p><pre>from qiskit.primitives import Sampler<br><br>result = Sampler().run(circuit).result()<br>print(result.quasi_dists[0].keys())</pre><pre>dict_keys([5])</pre><h3>Standard gates</h3><p>The <strong>Standard Gates</strong> section of the Qiskit Circuit Library is a foundational toolbox for building up a wide array of quantum circuits—from the humble X Gate all the way to more complex multi-controlled rotation gates.</p><p>Users can add standard gates to their circuits by calling the gates as methods—e.g., circuit.x(3) will append an X Gate to the qubit 3. That&#39;s the most common way to use them. With that being said, this is still an incredibly useful section of the circuit library, and of our documentation in general, as it provides some very useful information about the matrices underlying these gates.</p><p>Let’s take a look at an example of how to append a multi-controlled CNOT to an existing quantum circuit, using the circuit library as a reference. In the following example we are constructing a multi-controlled X Gate (MCXGate) with 4 control qubits from the circuit library and applying it to a quantum circuit, specifying the control qubits are at indices 0,1,2 and 4:</p><pre>from qiskit import QuantumCircuit<br>from qiskit.circuit.library import MCXGate<br><br># create circuit<br>circuit = QuantumCircuit(5)<br><br># initialise MCX gate with 4 control qubits<br>gate = MCXGate(4)<br><br># append gate to circuit, specifying qubit indices<br>circuit.append(gate, [0, 1, 4, 2, 3])<br>circuit.draw(&#39;mpl&#39;)</pre><p>The resulting quantum circuit looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/189/1*ULqrVQWVWJ4Y5zl-1jEpng.png" /></figure><p>And here’s an example of how we would transpile that to a quantum backend:</p><pre>from qiskit import transpile<br>from qiskit.providers.fake_provider import FakeTokyo<br><br>backend = FakeTokyo()<br>transpiled = transpile(circuit, backend)<br>transpiled.draw(&#39;mpl&#39;, idle_wires=False)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWM7lCE488SNAPu0-wfvrA.png" /></figure><h3>Other interesting circuits</h3><p>This article only scratches the surface in terms of describing the many, many different types of circuits that are available in the Qiskit Circuit Library. Some other notable examples include the <strong>quantum Fourier transform (QFT)</strong>, which is an essential subroutine in many algorithms, <strong>PhaseOracle</strong>, which implements the oracles used in grover search, and <strong>multi-control multi-target gate (MCMT)</strong>, which makes it possible to (for example) implement an X gate acting on two qubits and controlled by three others.</p><p>Be sure to head over to <a href="https://qiskit.org/documentation/apidoc/circuit_library.html">the Qiskit Circuit Library</a> to learn more about how to put these resources to use in your research.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36ee0f189956" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qiskit/a-guide-to-the-qiskit-circuit-library-36ee0f189956">A guide to the Qiskit circuit library</a> was originally published in <a href="https://medium.com/qiskit">Qiskit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>