The News: Ahead of its annual Think conference, IBM announced more details about the Qiskit 1.0 quantum software development kit, including artificial intelligence (AI)-assisted code optimization and the GenAI Qiskit Code Assistant built on top of the watsonx Granite family of Foundation Models. See the IBM press release for more details.
Quantum in Context: IBM Extends Qiskit 1.0 via AI Tools
Analyst Take: I previously discussed many of the speed and memory usage improvements in Qiskit 1.0 for quantum software development. AI for quantum holds much more immediate promise than quantum for AI. IBM’s two demonstrated uses are excellent improvements that help quantum developers create circuits faster and circuits that run faster.
Qiskit 1.0 News Recap
In my Research Note, “Quantum in Context: Quantum Software Development Kit Qiskit Turns 1.0,” I highlighted many Qiskit usage statistics and new features. These included:
- More than 700 colleges and universities using Qiskit to teach quantum computing classes
- 540 Qiskit Advocates and 550,000 users
- Nearly 1,200 certified Qiskit developers
- Almost 2,900 published and preprint papers using Qiskit
- At least eight other quantum hardware providers supplying backend support for Qiskit
- A standardized convention for Qiskit versions and a reliable release schedule
- Tools rewritten in Rust with Python wrappers to better handle circuits with many more qubits and much greater operation depth
When circuits start using many qubits with many operations, simplistic algorithms no longer work efficiently to translate what a developer has written to what ultimately runs on quantum hardware. A reasonable threshold for this is about 100 qubits, what IBM calls “utility-scale quantum computing.” To reach Practical Quantum Advantage, we will need circuits that are tens to thousands times this number in both qubits and operations. IBM and open-source contributors have created the foundation on which Qiskit can efficiently scale.
The press release adds some numbers to the performance statements:
- 40 times faster circuit optimization for quantum hardware
- Average of 3 times reduction in memory usage (reduce, reuse, recycle)
- Possible 5 times faster execution time
- Possible 40% reduction in circuit depth using AI and heuristics
These are impressive and much-needed improvements.
Optimizing Quantum Circuits with AI
“Transpiling” is a somewhat odd word meaning translating and compiling software code from one form or programming language into a different representation executable on hardware using its native operations. Transpilation is what a transpiler does when it is busy transpiling.
The code a quantum software developer writes for a circuit may not be ideal for running on quantum hardware:
- The high-level quantum operations you see in a quantum book may not be those implemented natively in your hardware.
- Different quantum hardware modalities have different native operations.
- High-level optimizations can simplify code, such as removing two consecutive operations where the second undoes the action of the first.
- Optimizations that look at more of the code can decrease the number of operations, such as minimizing the number of quantum state interchanges in qubits.
- Optimizations that understand the whole context of structuring executions on specific hardware can make code run even faster.
Qiskit uses the idea of “passes” for transpilation. There are many optimization schemes that you can arrange to run once or multiple times on parts of or entire circuits. Each run is a pass. You can write a new scheme and insert that into the optimization process. Some of these are heuristics, meaning they are reasonable guesses for quickly making improvements. Others are static, such as removing consecutive H, X, Y, and Z operations. Some of these are learned: run many optimization passes in different ways and progressively get better at optimizing code. This last method is reinforcement learning, a great application of AI for quantum.
The Qiskit Transpiler Services incorporates traditional and AI passes into the optimization processes. IBM reports that it has seen a roughly 40% increase in circuit quality compared to before it started implementing AI inference in Qiskit. Speed-wise, they state that the circuits now run two to five times faster. The IBM coders wrote the inference code in Rust.
IBM Qiskit Code Assistant for Faster Quantum Software Development
Like many GenAI code generators, Qiskit Code Assistant operates as a Visual Studio Code extension:
The prompt is in the Python comments in lines 5 and 6. It would be nice if GenAI tools could read our minds and deliver exactly what we are thinking. Then again, maybe this isn’t such a great idea. In any case, good prompts are a mixture of general directions and specific instructions, especially when there are several choices.
The generated circuit is
This is indeed a Bell circuit, but only one of the four. Qiskit Code Assistant made a choice for you. The Python code at the end is a fairly literal response to the prompt.
Quantum circuits at the operation level can be challenging to write and debug. All assistance is welcome. In that regard, Qiskit Code Assistant is built on the IBM Granite family of Foundation Models, specifically the code model with 20B parameters, 8K context length, and 1.63T tokens. IBM announced on May 6 that Granite is going open source under the Apache 2.0 license.
Given this exceptional GenAI base, the Qiskit Coding Assistant should mature quickly. Moreover, I would bet that more quantum computing code is written in Python with Qiskit than in any other language or development kit. The collection of usable training code is vast. Qiskit developers should ultimately have the best of the quantum and GenAI worlds because of Granite’s abilities to generate, explain, and fix code.
In a private briefing, IBM stated that an alpha version of Qiskit Code Assistant will be available later in 2Q2024.
Related Work by Other Vendors
Many vendors are working on GenAI code generation for classical computing. Fewer are looking at the quantum case, but visit Microsoft Azure Quantum to see how they can generate quantum circuits in Q#.
IBM is not alone in creating better tools for faster quantum circuit generation and execution. Competition is good for the industry and developers, and both TKET from Quantinuum and the Classiq software platform provide that. Coders win when vendors and open-source developers innovate on the toolchains.
Key Takeaway: Qiskit 1.0 has a rich set of improvements, but the exceptional ones for me are the uses of AI for quantum computing that help developers write great code that runs optimally on the hardware of their choice.
I’m very excited about these developments from IBM. In almost every way you can imagine, quantum is hard. Bringing AI into code generation and optimization is a requirement for building large enough and powerful enough error-corrected quantum computers that fulfill the promises many of us have spoken about for almost a decade and more.
Disclosure: The Futurum Group is a research and advisory firm that engages or has engaged in research, analysis, and advisory services with many technology companies, including those mentioned in this article. The author is a former employee of IBM and holds an equity position in the company. The author does not hold an equity position in any other company mentioned in this article.
Analysis and opinions expressed herein are specific to the analyst individually and data and other information that might have been provided for validation, not those of The Futurum Group as a whole.
Other Insights from The Futurum Group:
Quantum in Context: Quantum Software Development Kit Qiskit Turns 1.0
Quantum in Context: The Case for On-Premises Quantum Computers
AI in Context: First Test of Several Generative AI Code Generators
Author Information
Dr. Bob Sutor has been a technical leader and executive in the IT industry for over 40 years. Bob’s industry role is to advance quantum and AI technologies by building strong business, partner, technical, and educational ecosystems. The singular goal is to evolve quantum and AI to help solve some of the critical computational problems facing society today. Bob is widely quoted in the press, delivers conference keynotes, and works with industry analysts and investors to accelerate understanding and adoption of quantum technologies. Bob is the Vice President and Practice Lead for Emerging Technologies at The Futurum Group. He helps clients understand sophisticated technologies in order to make the best use of them for success in their organizations and industries. He is also an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. More than two decades of Bob’s career were spent in IBM Research in New York. During his time there, he worked on or led efforts in symbolic mathematical computation, optimization, AI, blockchain, and quantum computing. He was also an executive on the software side of the IBM business in areas including middleware, software on Linux, mobile, open source, and emerging industry standards. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. Bob is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College.
He’s the author of a book about quantum computing called Dancing with Qubits, which was published in 2019, with the Second Edition released in March 2024. He is also the author of the 2021 book Dancing with Python, an introduction to Python coding for classical and quantum computing. Areas in which he’s worked: quantum computing, AI, blockchain, mathematics and mathematical software, Linux, open source, standards management, product management and marketing, computer algebra, and web standards.