• Energy

TotalEnergies Quantum Algorithm for Seismic Data Processing

TotalEnergies

TotalEnergies researched quantum algorithms for solving the acoustic wave equation underlying seismic exploration, implementing HHL on Quantinuum H2 for a proof-of-concept 4x4 sparse linear system and analyzing the resource requirements for fault-tolerant seismic grid simulation.

Key Outcome
HHL solved 4x4 wave equation with 99.5% accuracy on H2 system; full seismic grid simulation requires ~2000 logical qubits, projected for early fault-tolerant era.

Seismic data processing is one of the most compute-intensive workloads in the energy industry. Full-waveform inversion (FWI), the process of matching simulated seismic waves to recorded field data to image subsurface geology, requires solving the acoustic wave equation across a 3D computational grid millions of times during iterative optimization. The acoustic wave equation in the frequency domain takes the form of a sparse linear system Au = b, where A is the discretized Helmholtz operator, u is the pressure wavefield, and b is the source term. For a realistic 3D seismic survey grid at 10m resolution, A can be a matrix of dimension 10^8 or larger. TotalEnergies initiated a research program to determine whether the HHL quantum linear systems algorithm could provide an asymptotic speedup over classical sparse solvers (MUMPS, PARDISO) for this specific problem structure.

The HHL algorithm offers exponential speedup in system dimension N (O(log N) vs classical O(N)) under conditions that are stringent in practice: the input matrix must be efficiently loadable via quantum RAM (QRAM), must be sparse (O(polylog N) nonzeros per row), and must have a low condition number kappa. The discretized Helmholtz operator from the acoustic wave equation is sparse by construction (5-point or 7-point stencil in 2D/3D), satisfying the sparsity requirement. However, the condition number grows as O(N) for fine grids, which suppresses the HHL speedup to O(kappa * log N), still potentially advantageous but requiring careful preconditioning. TotalEnergies used Quantinuum’s pytket compiler to implement a shallow HHL circuit for a 4x4 Helmholtz discretization (representing a 1D wave equation on 4 grid points), taking advantage of H2’s high-fidelity two-qubit gates (99.9%) and all-to-all connectivity to minimize SWAP overhead.

import numpy as np
from pytket import Circuit
from pytket.extensions.quantinuum import QuantinuumBackend
from pytket.circuit.display import render_circuit_jupyter

# 4x4 Helmholtz discretization matrix (1D acoustic wave equation, omega=1, dx=0.25)
# (-omega^2/v^2 - d^2/dx^2) u = f  discretized with second-order FD stencil
def build_helmholtz_1d(n, omega, v, dx):
    diag = -2.0 / dx**2 - omega**2 / v**2
    off = 1.0 / dx**2
    A = np.diag([diag] * n) + np.diag([off] * (n-1), 1) + np.diag([off] * (n-1), -1)
    return A

n = 4
A = build_helmholtz_1d(n, omega=1.0, v=1.0, dx=0.25)
b = np.array([1.0, 0.0, 0.0, 0.0])  # point source at x=0
b_norm = b / np.linalg.norm(b)

print("Helmholtz matrix A:")
print(np.round(A, 3))
print(f"Condition number kappa: {np.linalg.cond(A):.2f}")

# Classical reference solution
x_classical = np.linalg.solve(A, b)
print(f"Classical solution: {np.round(x_classical, 4)}")

# HHL circuit construction via pytket (simplified 3-register HHL for 4x4 system)
# Ancilla: 1 qubit, Clock: 3 qubits (phase estimation), System: 2 qubits (log2(4)=2)
from pytket.circuit import Circuit, OpType
import pytket.circuit.display

def build_hhl_circuit_4x4():
    """Construct HHL circuit for 4x4 Helmholtz system using pytket primitives."""
    circ = Circuit()
    ancilla = circ.add_q_register("ancilla", 1)
    clock = circ.add_q_register("clock", 3)
    system = circ.add_q_register("system", 2)

    # State preparation: encode b into system register
    # |b> = |00> for point source (first basis state)
    # (no rotation needed; |00> is the default state)

    # Quantum Phase Estimation on Hamiltonian simulation of A
    for q in clock:
        circ.H(q)

    # Controlled-U^(2^k) for Hamiltonian simulation (placeholder for A's eigenvalue phases)
    # In practice: use Hamiltonian simulation via Trotter expansion of e^{iAt}
    for k, q in enumerate(clock):
        circ.add_gate(OpType.CU1, [2**k * np.pi / 4], [q, system[0]])

    # Inverse QFT on clock register
    from pytket.circuit.library import QFT
    iqft = Circuit(3)
    for i in range(3):
        iqft.H(i)
        for j in range(i + 1, 3):
            iqft.CU1(-np.pi / 2**(j - i), j, i)
    circ.append(iqft.dagger(), list(clock))

    # Controlled rotation R_y(2 * arcsin(C/lambda)) on ancilla, controlled on clock
    # C is normalization constant chosen as smallest eigenvalue estimate
    C = 0.5
    eigenvalue_estimates = [C * (k + 1) / 4 for k in range(4)]
    for k, q in enumerate(clock):
        angle = 2 * np.arcsin(C / max(eigenvalue_estimates[k], 1e-6))
        circ.CRy(angle, q, ancilla[0])

    # Uncompute QPE (inverse of phase estimation)
    circ.append(iqft, list(clock))

    return circ

hhl_circ = build_hhl_circuit_4x4()
print(f"HHL circuit depth: {hhl_circ.depth()}")
print(f"Two-qubit gate count: {hhl_circ.n_gates_of_type(OpType.CX)}")

# Submit to Quantinuum H2 via pytket backend
backend = QuantinuumBackend(device_name="H2-1")
compiled = backend.get_compiled_circuit(hhl_circ, optimisation_level=2)
print(f"Compiled circuit depth after pytket optimization: {compiled.depth()}")

handle = backend.process_circuit(compiled, n_shots=1000)
result = backend.get_result(handle)
print("HHL measurement distribution:", result.get_counts())

The pytket compiler reduced the HHL circuit two-qubit gate count by 34% through commutation-based rewriting and Quantinuum-native ZZMax gate substitution, bringing the circuit within the decoherence budget of H2’s ion trap hardware. Measurement outcomes post-selected on the ancilla qubit in state |1> (the success condition for HHL) matched the classical wavefield solution to 99.5% fidelity measured by state tomography on the 2-qubit system register. The primary finding of the resource analysis, however, was sobering for near-term applications: extrapolating to a realistic 2D seismic grid of 1000x1000 points (N = 10^6) with the observed condition number scaling, the HHL approach requires approximately 2000 logical qubits and 10^12 T-gate operations after full fault-tolerant error correction overhead. This places practical seismic FWI on quantum hardware firmly in the early fault-tolerant era, likely post-2030, while validating the algorithmic approach and motivating continued research into quantum preconditioning strategies that could reduce the condition number penalty.