Introducing 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 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 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.)

Why QNLP?

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.”

About Quantinuum

Quantinuum, the world’s largest integrated quantum company, pioneers powerful quantum computers and advanced software solutions. Quantinuum’s technology drives breakthroughs in materials discovery, cybersecurity, and next-gen quantum AI. With over 500 employees, including 370+ scientists and engineers, Quantinuum leads the quantum computing revolution across continents. 

Blog
December 9, 2024
Q2B 2024: The Roadmap to Quantum Value

At this year’s Q2B Silicon Valley conference from December 10th – 12th in Santa Clara, California, the Quantinuum team will be participating in plenary and case study sessions to showcase our quantum computing technologies. 

Schedule a meeting with us at Q2B

Meet our team at Booth #G9 to discover how Quantinuum is charting the path to universal, fully fault-tolerant quantum computing. 

Join our sessions: 

Tuesday, Dec 10, 10:00 - 10:20am PT

Plenary: Advancements in Fault-Tolerant Quantum Computation: Demonstrations and Results

There is industry-wide consensus on the need for fault-tolerant QPU’s, but demonstrations of these abilities are less common. In this talk, Dr. Hayes will review Quantinuum’s long list of meaningful demonstrations in fault-tolerance, including real-time error correction, a variety of codes from the surface code to exotic qLDPC codes, logical benchmarking, beyond break-even behavior on multiple codes and circuit families.

View the presentation

Wednesday, Dec 11, 4:30 – 4:50pm PT

Keynote: Quantum Tokens: Securing Digital Assets with Quantum Physics

Mitsui’s Deputy General Manager, Quantum Innovation Dept., Corporate Development Div., Koji Naniwada, and Quantinuum’s Head of Cybersecurity, Duncan Jones will deliver a keynote presentation on a case study for quantum in cybersecurity. Together, our organizations demonstrated the first implementation of quantum tokens over a commercial QKD network. Quantum tokens enable three previously incompatible properties: unforgeability guaranteed by physics, fast settlement without centralized validation, and user privacy until redemption. We present results from our successful Tokyo trial using NEC's QKD commercial hardware and discuss potential applications in financial services.

Details on the case study

Wednesday, Dec 11, 5:10 – 6:10pm PT

Quantinuum and Mitsui Sponsored Happy Hour

Join the Quantinuum and Mitsui teams in the expo hall for a networking happy hour. 

events
All
Blog
December 5, 2024
Quantum computing is accelerating

Particle accelerator projects like the Large Hadron Collider (LHC) don’t just smash particles - they also power the invention of some of the world’s most impactful technologies. A favorite example is the world wide web, which was developed for particle physics experiments at CERN.

Tech designed to unlock the mysteries of the universe has brutally exacting requirements – and it is this boundary pushing, plus billion-dollar budgets, that has led to so much innovation. 

For example, X-rays are used in accelerators to measure the chemical composition of the accelerator products and to monitor radiation. The understanding developed to create those technologies was then applied to help us build better CT scanners, reducing the x-ray dosage while improving the image quality. 

Stories like this are common in accelerator physics, or High Energy Physics (HEP). Scientists and engineers working in HEP have been early adopters and/or key drivers of innovations in advanced cancer treatments (using proton beams), machine learning techniques, robots, new materials, cryogenics, data handling and analysis, and more. 

A key strand of HEP research aims to make accelerators simpler and cheaper. A key piece of infrastructure that could be improved is their computing environments. 

CERN itself has said: “CERN is one of the most highly demanding computing environments in the research world... From software development, to data processing and storage, networks, support for the LHC and non-LHC experimental programme, automation and controls, as well as services for the accelerator complex and for the whole laboratory and its users, computing is at the heart of CERN’s infrastructure.” 

With annual data generated by accelerators in excess of exabytes (a billion gigabytes), tens of millions of lines of code written to support the experiments, and incredibly demanding hardware requirements, it’s no surprise that the HEP community is interested in quantum computing, which offers real solutions to some of their hardest problems. 

As the authors of this paper stated: “[Quantum Computing] encompasses several defining characteristics that are of particular interest to experimental HEP: the potential for quantum speed-up in processing time, sensitivity to sources of correlations in data, and increased expressivity of quantum systems... Experiments running on high-luminosity accelerators need faster algorithms; identification and reconstruction algorithms need to capture correlations in signals; simulation and inference tools need to express and calculate functions that are classically intractable.”

The HEP community’s interest in quantum computing is growing. In recent years, their scientists have been looking carefully at how quantum computing could help them, publishing a number of papers discussing the challenges and requirements for quantum technology to make a dent (here’s one example, and here’s the arXiv version). 

In the past few months, what was previously theoretical is becoming a reality. Several groups published results using quantum machines to tackle something called “Lattice Gauge Theory”, which is a type of math used to describe a broad range of phenomena in HEP (and beyond). Two papers came from academic groups using quantum simulators, one using trapped ions and one using neutral atoms. Another group, including scientists from Google, tackled Lattice Gauge Theory using a superconducting quantum computer. Taken together, these papers indicate a growing interest in using quantum computing for High Energy Physics, beyond simple one-dimensional systems which are more easily accessible with classical methods such as tensor networks.

We have been working with DESY, one of the world’s leading accelerator centers, to help make quantum computing useful for their work. DESY, short for Deutsches Elektronen-Synchrotron, is a national research center that operates, develops, and constructs particle accelerators, and is part of the worldwide computer network used to store and analyze the enormous flood of data that is produced by the LHC in Geneva.  

Our first publication from this partnership describes a quantum machine learning technique for untangling data from the LHC, finding that in some cases the quantum approach was indeed superior to the classical approach. More recently, we used Quantinuum System Model H1 to tackle Lattice Gauge Theory (LGT), as it’s a favorite contender for quantum advantage in HEP.

Lattice Gauge Theories are one approach to solving what are more broadly referred to as “quantum many-body problems”. Quantum many-body problems lie at the border of our knowledge in many different fields, such as the electronic structure problem which impacts chemistry and pharmaceuticals, or the quest for understanding and engineering new material properties such as light harvesting materials; to basic research such as high energy physics, which aims to understand the fundamental constituents of the universe,  or condensed matter physics where our understanding of things like high-temperature superconductivity is still incomplete.

The difficulty in solving problems like this – analytically or computationally – is that the problem complexity grows exponentially with the size of the system. For example, there are 36 possible configurations of two six-faced dice (1 and 1 or 1 and 2 or 1and 3... etc), while for ten dice there are more than sixty million configurations.

Quantum computing may be very well-suited to tackling problems like this, due to a quantum processor’s similar information density scaling – with the addition of a single qubit to a QPU, the information the system contains doubles. Our 56-qubit System Model H2, for example, can hold quantum states that require 128*(2^56) bits worth of information to describe (with double-precision numbers) on a classical supercomputer, which is more information than the biggest supercomputer in the world can hold in memory.

The joint team made significant progress in approaching the Lattice Gauge Theory corresponding to Quantum Electrodynamics, the theory of light and matter. For the first time, they were able study the full wavefunction of a two-dimensional confining system with gauge fields and dynamical matter fields on a quantum processor. They were also able to visualize the confining string and the string-breaking phenomenon at the level of the wavefunction, across a range of interaction strengths.

The team approached the problem starting with the definition of the Hamiltonian using the InQuanto software package, and utilized the reusable protocols of InQuanto to compute both projective measurements and expectation values. InQuanto allowed the easy integration of measurement reduction techniques and scalable error mitigation techniques. Moreover, the emulator and hardware experiments were orchestrated by the Nexus online platform.

In one section of the study, a circuit with 24 qubits and more than 250 two-qubit gates was reduced to a smaller width of 15 qubits thanks our unique qubit re-use and mid-circuit measurement automatic compilation implemented in TKET.

This work paves the way towards using quantum computers to study lattice gauge theories in higher dimensions, with the goal of one day simulating the full three-dimensional Quantum Chromodynamics theory underlying the nuclear sector of the Standard Model of particle physics. Being able to simulate full 3D quantum chromodynamics will undoubtedly unlock many of Nature’s mysteries, from the Big Bang to the interior of neutron stars, and is likely to lead to applications we haven’t yet dreamed of. 

technical
All