LAMBEQ: A Toolkit for Quantum Natural Language Processing

November 29, 2021

The new software development toolkit for quantum natural language processing tested and benchmarked on Honeywell’s System Model H1 technology.

Telling Alexa to play “Schrodinger’s Cat” by Tears for Fears.  Asking Siri for directions to a quantum-themed bar or restaurant.  A smart phone autocorrecting a word in a text message.

These are everyday applications of natural language processing – NLP for short – a field of artificial intelligence that focuses on training computers to understand words and conversations with the same reasoning as humans.

NLP technologies have advanced rapidly in recent years with the help of increasingly powerful computing clusters that can run language models that examine reams of text and count how often certain words appear.  These models train devices to retrieve information, annotate text, translate words from one language to another, answer questions, and perform other tasks.

The next step is to “teach” computers to infer meaning, understand nuance, and grasp the context of conversations.  To do that, however, requires massive computational resources and multiple algorithms or data structures.

A United Kingdom-based quantum computing company believes the answer lies with qubits, superposition, and entanglement.

Cambridge Quantum recently released lambeq, a new open-source software development toolkit, that enables researchers to convert sentences into quantum circuits that can be run on quantum computers. It is the first toolkit developed specifically for quantum natural language processing – or QNLP - and was tested on Honeywell’s System Model H1 technology before it was released.

The software takes the text, parses it, and then uses linguistics and mathematics to differentiate between a verb, noun, preposition, adjectives, etc., and label them to understand the relationships between words.

Cambridge Quantum researchers tested 30 sentences on the System Model H1, which was able to classify words correctly 87 percent of the time.

“We deem that a success,” said Konstantinos Meichannetzidis, a member of the CQ team.  “We found that our software works well with the Honeywell technology and were able to benchmark the performance of this quantum device.”

The lambeq project also represented a first for Honeywell Quantum Solutions. It was the first QNLP problem run on the System Model H1 hardware.

“We are really excited to be a part of this work and contribute to the development of this important toolkit,” said Tony Uttley, president of Honeywell Quantum Solutions.  “Applications like this help us test our system and understand how well it performs solving different problems.”

(Honeywell Quantum Solutions and Cambridge Quantum have a long-standing history of partnering together on research and other projects that benefit end-customers.  The two entities announced in June they are seeking regulatory approval to combine to form a new company.)


For humans, decoding conversations to understand meaning is a complex process. We infer meaning through tone of voice, body language, context, location, and other factors.  For computers, which do not rely on heuristics, decoding language is even more complex.

The only way to create some sort of “meaning-aware” NLP is to explicitly encode compositional, semantic sentence structure into language models. To do this on a classical computer, however, requires massive computational resources, which are costly, and would likely still take months to process.

Quantum computers, on the other hand, run calculations and crunch data very differently.

They harness unique properties of quantum physics, specifically superposition and entanglement, to store and process information.  Because of that, these systems can examine problems with multiple states and evaluate a large space of possible answers simultaneously.

What this means in terms of natural language processing is that quantum computers are likely to go beyond counting how often certain words appear or are used together. As noted above, quantum computers can identify words, label them as a noun, verb, preposition, etc., and understand the relationship between words.  (lambeq uses the Distributional Compositional Categorical – or DisCoCat – model to do this.)

This enables the computer to infer meaning, and also provides insight into how and why the computer made connections between words.  The latter is important for validating data and also expanding the use of QNLP in regulated sectors such as finance, legal, and medicine where transparency is critical.

Built upon previous work

The Cambridge Quantum team has long explored how quantum computing can advance natural language processing, and has published extensively on the topic.

In December 2020,  researchers released two foundational papers that demonstrated that QNLP is inherently meaning-aware and can successfully interpret questions and respond.

Earlier this year, the team performed the first NLP experiment conducted on a quantum computer by converting more than 100 sentences into quantum circuits using an IBM technology.  Researchers successfully trained two NLP models to classify words in sentences.

The release of lambeq and the testing of the open-source toolkit on the Honeywell System Model H1 represents the next steps in their QNLP efforts.

“Our team has been involved in foundational work that explores how quantum computers can be used to solve some of the most intractable problems in artificial intelligence,” said Bob Coecke, Cambridge Quantum’s chief scientist.

“In various papers published over the course of the past year,” Coecke added, “we have not only provided details on how quantum computers can enhance NLP but also demonstrated that QNLP is ‘quantum native,’ meaning the compositional structure governing language is mathematically the same as that governing quantum systems. This will ultimately move the world away from the current paradigm of AI that relies on brute force techniques that are opaque and approximate.”

Kaniah Konkoly-Thege

Kaniah is Chief Legal Counsel and SVP of Government Relations for Quantinuum. In her previous role, she served as General Counsel, Honeywell Quantum Solutions. Prior to Honeywell, she was General Counsel, Honeywell Federal Manufacturing and Technologies, LLC, and Senior Attorney, U.S. Department of Energy. She was Lead Counsel before the Civilian Board of Contract Appeals, the Merit Systems Protection Board, and the Equal Employment Opportunity Commission. Kaniah holds a J.D. from American University, Washington College of Law and B.A., International Relations and Spanish from the College of William and Mary.

Jeff Miller

Jeff Miller is Chief Information Officer for Quantinuum. In his previous role, he served as CIO for Honeywell Quantum Solutions and led a cross-functional team responsible for Information Technology, Cybersecurity, and Physical Security. For Honeywell, Jeff has held numerous management and executive roles in Information Technology, Security, Integrated Supply Chain and Program Management. Jeff holds a B.S., Computer Science, University of Arizona. He is a veteran of the U.S. Navy, attaining the rank of Commander.

Matthew Bohne

Matthew Bohne is the Vice President & Chief Product Security Officer for Honeywell Corporation. He is a passionate cybersecurity leader and executive with a proven track record of building and leading cybersecurity organizations securing energy, industrial, buildings, nuclear, pharmaceutical, and consumer sectors. He is a sought-after expert with deep experience in DevSecOps, critical infrastructure, software engineering, secure SDLC, supply chain security, privacy, and risk management.

Todd Moore

Todd Moore is the Global Vice President of Data Encryption Products at Thales. He is responsible for setting the business line and go to market strategies for an industry leading cybersecurity business. He routinely helps enterprises build solutions for a wide range of complex data security problems and use cases. Todd holds several management and technical degrees from the University of Virginia, Rochester Institute of Technology, Cornell University and Ithaca College. He is active in his community, loves to travel and spends much of his free time supporting his family in pursuing their various passions.

John Davis

Retired U.S. Army Major General John Davis is the Vice President, Public Sector for Palo Alto Networks, where he is responsible for expanding cybersecurity initiatives and global policy for the international public sector and assisting governments around the world to prevent successful cyber breaches. Prior to joining Palo Alto Networks, John served as the Senior Military Advisor for Cyber to the Under Secretary of Defense for Policy and served as the Acting Deputy Assistant Secretary of Defense for Cyber Policy.  Prior to this assignment, he served in multiple leadership positions in special operations, cyber, and information operations.