AWS Quantum Technologies Blog
Exploring computational chemistry using Quantinuum’s InQuanto on AWS
Introduction
Quantum computers hold the promise of driving novel approaches to solving complex problems across multiple fields, including optimization, machine learning, and the simulation of physical systems. Researchers are already using quantum computers to explore computational chemistry problems, however the scale and capabilities of quantum devices available today is limited by noise and other factors. While the industry at large is working to solve the technical challenges in building fault-tolerant quantum computers, we are also probing for use cases that could deliver a computational advantage on near-term systems.
In this blog post, we will explore a quantum computational chemistry use case provided by BMW Group using Quantinuum’s InQuanto platform combined with Amazon Braket, the quantum computing service of AWS. The problem of interest to BMW Group is simulating the surface processes of noble metals, a challenging use case that has a range of applications in the development of vehicle fuel cells.
Accurately modeling useful complex chemical systems is an intractable problem for classical computers today and the foreseeable future. The quantum nature of these chemical systems means that an accurate simulation becomes exponentially harder to solve with the size of the system. Even the most powerful classical computers available today can simulate only the simplest molecular systems. Quantum computers are expected to excel in the domain of quantum system simulation. In the field of chemistry, a quantum computer becomes a highly-controlled simulation for the real-world system a scientist wants to model.
Quantinuum’s InQuanto platform
Quantinuum is an integrated quantum computing company building and operating ion trap quantum computers, and has a team of over 350 scientists investigating applications in quantum chemistry, cybersecurity, machine learning, optimization, and natural language processing.
In these early days of the technology, it is important to explore as many types of quantum computing technologies as possible to experiment and choose the technology best suited to your application. Quantinuum’s software is designed to run efficiently on a range of quantum hardware and emulators with the goal of ensuring researchers, engineers, and developers can do the very best work in quantum computing, regardless of their experience with the technology, or the problem they are tackling.
InQuanto is a computational chemistry software platform for quantum computers. The platform is built on Quantinuum’s TKET Software Development Kit and compiler to make it platform-inclusive, with work directed to a number of hardware and emulator backends, including Quantinuum’s H-series ion-trap devices powered by Honeywell, the devices available on Amazon Braket, IBM’s superconducting quantum computers, and many others.
InQuanto grew out of the work done by Quantinuum’s in-house computational chemistry team and input from enterprise industry partners. InQuanto enables users to mix-and-match the latest quantum algorithms, advanced subroutines, and chemistry-specific noise mitigation techniques to make the best use of today’s quantum computers. The platform also helps computational chemists to break down larger industrially relevant systems into smaller fragments that can run on today’s small-scale quantum machines.
Quantinuum’s collaborations with partners using InQuanto include exploring the quantification of drug-protein interactions, work with Nippon Steel Corporation to simulate materials such as iron crystals for steel development, and work with TotalEnergies to model metal organic frameworks for carbon capture. Customers are using InQuanto in the first step towards the rigorous modeling of industrially-relevant systems for chemical reactions between noble metals and gaseous compounds. The following sections summarize such research in partnership with BMW Group, running InQuanto on AWS using Amazon Braket.
BMW Group use case – Modeling the oxygen reduction reaction
One of the key challenges in the development of novel fuel cell technology is the sluggish kinetics of the oxygen reduction reaction (ORR). Most published studies on atomistic modeling of catalytic and electrocatalytic chemical reactions, such as ORR, use density functional theory (DFT); the workhorse method of computational chemistry. However, DFT relies on cancellation of errors and has limited accuracy (such as the GMTKN55 benchmark database and a benchmark for adsorption energies to transition metal surfaces). DFT is known to especially fail for systems where strong (static) electron correlation plays a role, such as metal complexes and transition states. Hence, there is a need for reliable, systematically improvable methods for computing energetic profiles of arbitrary chemical reactions. Although such techniques have existed in the computational chemistry toolkit for a long time, their applicability is limited to small problems due to prohibitive computational cost. Quantum computing has the potential to fundamentally change this by enabling first-principles, accurate calculations of complex systems, without the compromises of approximate methods, such as DFT.
To demonstrate the mechanism of ORR, we built a minimal model of the step of this reaction occurring on a platinum cluster (Pt5) (Figure 1 below), following Li et al., (T. Li, P.B. Balbuena, J. Phys. Chem. B 2001, 105, 9943-9952):
Figure 1: Model of the oxygen reduction reaction on a platinum cluster
Due to the intricate, multi-reference nature of the Pt5 cluster and its interaction with the oxygen atoms, we apply a quantum-powered correlated wavefunction method to calculate the ground state energy.
Deploying InQuanto on AWS
To model the reaction described in the previous section, we deployed InQuanto on AWS using Amazon SageMaker, which provides managed compute instances running Jupyter Notebook and Jupyter Lab. This allowed us to quickly get started with the computational chemistry work instead of spending time on setting up underlying infrastructure. In the following paragraphs, we show you how you can deploy InQuanto in your own AWS account in just a few steps.
The AWS CloudFormation template provided with this blog simplifies the provisioning and management of InQuanto running on AWS, allowing users to rapidly deploy software on cloud infrastructure and access the simulators available on Amazon Braket. The CloudFormation template provisions a SageMaker notebook instance and enables access to Amazon Braket for submitting quantum jobs along with Amazon Simple Storage Service (Amazon S3) to store experimental and result data. The template also creates an AWS Identity and Access Management (IAM) policy and role to provide access control for the SageMaker notebook instance and S3 buckets. Amazon SageMaker Lifecycle Configuration is used to customize the Python environments and to install InQuanto. You can find details for obtaining a license to InQuanto in the contact details section of this blog. Figure 2 below illustrates how the resources provisioned by the CloudFormation template are organized.
Figure 2: Architecture diagram of InQuanto deployment in AWS
You can configure your own InQuanto deployment by following the steps below:
- Download or copy the CloudFormation template and update the placeholder fields with secrets provided alongside the InQuanto license.
- At the CloudFormation console, choose Create Stack
- Upload the CloudFormation template and choose Next
- Enter these inputs:
- Stack name – You need to specify a name, we choose ‘inquanto’, but you can select any name you like.
- InstanceName – You need to specify a name, we choose ‘inquanto-notebook’, but you can select any name you like.
- InstanceType – This specifies the compute resources on which InQuanto is deployed. For this demo, we select a cost effective t3.medium instance, but if your workload has greater compute or memory requirement you can select an appropriate instance type.
- Click Next
- Review and update other options such as tags, stack failure actions, rollback configuration and notification options.
- Acknowledge the IAM capabilities and click Submit
- Once the provisioning is complete, choose the Outputs tab and open the Jupyter Notebook instance.
With the InQuanto deployment now configured, we can turn our attention to BMW Group’s use case.
Running the ORR experiment
This section will guide you through setting up a calculation for the [Pt5(O2)] complex itself and executing the work on Amazon Braket. We first run necessary Pytket and Braket imports and instantiate Braket’s on-demand state vector simulator, SV1. The SV1 simulator allows you to run the first hour of simulation time for free every month. For additional details regarding pricing, refer to Braket pricing page.
from braket.aws import AwsSession
from pytket.extensions.braket import BraketBackend
backend = BraketBackend(device="sv1", provider="amazon", aws_session=AwsSession())
We start with creating a GeometryMolecular
object, which represents the structure of the complex. Using the integration with NGLView, we can visualize the structure of the molecule.
from inquanto.geometries import GeometryMolecular
from inquanto.extensions.nglview import VisualizerNGL
pt5o2 = [
["Pt", [1.678586, 0.039578, 0.075135]],
["Pt", [-0.741409, 1.335153, -0.057106]],
["Pt", [-0.719302, -1.338673, -0.180241]],
["Pt", [0.023329, 0.009056, 2.045330]],
["Pt", [0.366370, 0.003414, -2.125032]],
["O", [-2.542889, 0.654593, -0.492124]],
["O", [-2.581364, -0.651513, -0.182051]],
]
g = GeometryMolecular(pt5o2)
visualizer = VisualizerNGL(g)
visualizer.visualize_molecule()
Output:
The number of electrons in [Pt5(O2)] is too large to include them all in the correlated (post-HF) calculation. Therefore, we focus on improving the description of the bonding of oxygen atoms with their neighbouring platinum atoms. To achieve this, we create an active space of orbitals localised on these four atoms as shown in Figure 3 below:
Figure 3: The active space is localized on the oxygen atoms and two neighboring platinum atoms.
To construct a localized and compact active space, we use a modification of the atomic valence active space (AVAS) routine (Safyutarova et al., J. Chem. Theory Comput. 2017, 13, 9, 4063–4078) called regional embedding (Lau et al, . Phys. Chem. Lett. 2021, 12, 3, 1104–1109). We want our active orbitals to have high overlap with d orbitals of the selected platinum atoms and p orbitals of each of the oxygen atoms:
from inquanto.extensions.pyscf import AVAS
avas=AVAS(['1 Pt 5d', '2 Pt 5d', 'O 2p','O 3p'],threshold=0.95, threshold_vir=0.95)
In the next step, we use InQuanto’s PySCF driver to perform a Hartree-Fock calculation on the complex, rotate the orbitals using AVAS and generate the fermionic Hamiltonian:
from inquanto.extensions.pyscf import ChemistryDriverPyscfMolecularRHF, FromActiveSpace
driver = ChemistryDriverPyscfMolecularRHF(basis="def2-svp",ecp="def2-svp", geometry=pt5o2,
charge=0, transf=avas, frozen = FromActiveSpace(4,4))
hamiltonian_operator, space, state = driver.get_system()
The active orbitals can be visualized, using the integration with NGLView:
orbital_cubes = driver.get_cube_orbitals()
orbitals = [visualizer.visualize_orbitals(orb,red_isolevel=-2.0, blue_isolevel=2.0) for orb in orbital_cubes]
We transform our fermionic Hamiltonian to a qubit Hamiltonian via the Jordan-Wigner mapping and create an UCCSD Ansatz object, using the chemically-aware UCC synthesis method developed by the Quantinuum team. Note that the ansatz circuit dimensions are reported before any circuit optimization by Pytket.
from inquanto.ansatzes import FermionSpaceAnsatzChemicallyAwareUCCSD
from inquanto.mappings import QubitMappingJordanWigner
jw = QubitMappingJordanWigner()
qubit_hamiltonian = jw.operator_map(hamiltonian_operator)
ansatz = FermionSpaceAnsatzChemicallyAwareUCCSD(space, state, jw)
print(ansatz.generate_report())
Output:
The final step is to use the variational quantum eigensolver (VQE) to optimize the parameters in the UCCSD ansatz and compute an estimate of the ground state energy:
from inquanto.algorithms import AlgorithmVQE
from inquanto.computables import ExpectationValue
from inquanto.minimizers import MinimizerRotosolve
from inquanto.protocols import ProtocolStateVectorSparse
expectation_value = ExpectationValue(ansatz, qubit_hamiltonian)
vqe = (
AlgorithmVQE(
objective_expression=expectation_value,
minimizer=MinimizerRotosolve(),
initial_parameters=ansatz.state_symbols.construct_zeros(),
)
.build(
backend=backend,
protocol_expression=ProtocolStateVectorSparse()
)
.run()
)
print("Minimum Energy: {}".format(vqe.generate_report()["final_value"]))
Output:
The solution provided for the minimum energy is a close match to our expected results. We note that in the absence of quantum errors, VQE can provide an answer arbitrarily close to the exact FCI result, depending on the flexibility of the Ansatz. For larger active spaces and more active electrons, where UCCSD is not sufficient, InQuanto provides the systematically improvable k-UpCCGSD Ansatz (see https://arxiv.org/abs/1810.02327).
Conclusion
We have demonstrated how to deploy and use InQuanto on AWS to build a minimal model of a species featuring in the ORR, and to perform an exploratory calculation of its ground state energy via quantum simulation on Amazon Braket. This use case is of particular interest to customers such as BMW Group due to its potential future application in vehicle fuel cell designs.
In the next phase of our project, we plan to use a larger, periodic model of the platinum surface and calculate the energies of several species along the reaction path and show you how to run the model on the H1-series quantum computer provided by Quantinuum.
To learn more about how to run hybrid quantum-classical workloads such as variational quantum algorithms on Amazon Braket, refer to our Amazon Braket Hybrid Jobs page. If you would like to book an InQuanto demo or enquire about licensing for the software package, connect with the Quantinuum team at https://www.quantinuum.com/computationalchemistry/inquanto.