QUICK-PDE: A Qiskit Function by ColibriTD
See the API reference
Qiskit Functions are an experimental feature available to IBM Quantum® Premium Plan, Flex Plan, and On-Prem (via IBM Quantum Platform API) Plan users. They are in preview release status and subject to change.
Overview
The Partial Differential Equation (PDE) solver presented here is part of our Quantum Innovative Computing Kit (QUICK) platform (QUICK-PDE), and is packaged as a Qiskit Function. With the QUICK-PDE function, you can solve domain-specific partial differential equations on IBM Quantum QPUs. This function is based on the algorithm described in ColibriTD's H-DES description paper. This algorithm can solve complex multi-physics problems, starting with Computational Fluid Dynamics (CFD) and Materials Deformation (MD), and other use cases coming soon.
To tackle the differential equations, the trial solutions are encoded as linear combinations of orthogonal functions (typically Chebyshev polynomials, and more specifically of them where is the number of qubits encoding your function), parametrized by the angles of a Variable Quantum Circuit (VQC). The ansatz generates a state encoding the function, which is evaluated by observables whose combinations allow for evaluating the function at all points. You can then evaluate the loss function in which the differential equations are encoded, and fine-tune the angles in a hybrid loop, as shown in the following. The trial solutions get gradually closer to the actual solutions until you reach a satisfactory result.
In addition to this hybrid loop, you can also chain together different optimizers. This is useful when you want a global optimizer to find a good set of angles, and then a more fine-tuned optimizer to follow a gradient to the best set of neighboring angles. In the case of computational fluid dynamics (CFD), the default optimization sequence produces the best results - but in the case of material deformation (MD), while the default provides good results, you can configure it further for problem-specific benefits.
Note for each variable of the function, we specify number of qubits (which you can play with). By stacking 10 identical circuits and evaluating the 10 identical observables on different qubits throughout one big circuit, you can noise-mitigate within the CMA optimization process, relying on the noise learner method, and significantly reduce the number of shots needed.
Computational fluid dynamics
The inviscid Burgers' equation, models flowing non-viscous fluids as follows:
represents the fluid speed field. This use-case has a temporal boundary condition: you can select the initial condition and then allow the system to relax. Currently, the only accepted initial conditions are linear functions: .
The arguments for CFD's differential equations are on a fixed grid, as follows:
- is between 0 and 0.95 with 30 sample points. is between 0 and 0.95 with a step size of 0.2375.
Material deformation
This use case focuses on hypoelastic deformation with the one-dimensional tensile test, in which a bar fixed in space is pulled at its other extremity. We describe the problem as follows:
represents the bulk modulus of the material being stretched, the exponent of a power law, the force per unit mass, the proportional stress limit, the proportional strain limit, the stress function, and the strain function.
The considered bar is of unitary length. This use-case has a boundary condition for surface stress , or the amount of work needed to stretch the bar.
The arguments for MD's differential equations are on a fixed grid, as follows:
- is between 0 and 1 with a step size of 0.04.
Benchmarks
The following table presents statistics on various runs of our function.
Example | Number of qubits | Initialization | Error | Total time (min) | Runtime usage (min) |
|---|---|---|---|---|---|
| Inviscid Burgers' equation | 50 | PHYSICALLY_INFORMED | 66 | 25 | |
| Hypoelastic 1D tensile test | 18 | RANDOM | 123 | 100 |
Get started
Fill out the form to request access to the QUICK-PDE function. Then, assuming you've already saved your account to your local environment, select the function as follows:
from qiskit_ibm_catalog import QiskitFunctionsCatalog
catalog = QiskitFunctionsCatalog(channel="ibm_quantum_platform")
quick = catalog.load("colibritd/quick-pde")Examples
To get started, try one of the following examples:
Computational Fluid Dynamics (CFD)
When initial conditions are set to , the results are as follows:
# launch the simulation with initial conditions u(0,x) = a*x + b
job = quick.run(use_case="cfd", physical_parameters={"a": 1.0, "b": 0.0})Check your Qiskit Function workload's status or return results as follows:
print(job.status())
solution = job.result()Output:
'QUEUED'
import numpy as np
import matplotlib.pyplot as plt
_ = plt.figure()
ax = plt.axes(projection="3d")
# plot the solution using the 3d plotting capabilities of pyplot
t, x = np.meshgrid(solution["samples"]["t"], solution["samples"]["x"])
ax.plot_surface(
t,
x,
solution["functions"]["u"],
edgecolor="royalblue",
lw=0.25,
rstride=26,
cstride=26,
alpha=0.3,
)
ax.scatter(t, x, solution["functions"]["u"], marker=".")
ax.set(xlabel="t", ylabel="x", zlabel="u(t,x)")
plt.show()Output:
Material deformation
The material deformation use case requires the physical parameters of your material and the applied force, as follows:
import matplotlib.pyplot as plt
# select the properties of your material
job = quick.run(
use_case="md",
physical_parameters={
"t": 12.0,
"K": 100.0,
"n": 4.0,
"b": 10.0,
"epsilon_0": 0.1,
"sigma_0": 5.0,
},
)
# plot the result
solution = job.result()
_ = plt.figure()
stress_plot = plt.subplot(211)
plt.plot(solution["samples"]["x"], solution["functions"]["u"])
strain_plot = plt.subplot(212)
plt.plot(solution["samples"]["x"], solution["functions"]["sigma"])
plt.show()Output:
The following is an example of how to get the value of the function for a specific set of coordinates:
# u(t=0.2, x=0.7) == 2
assert solution["samples"]["t"][1] == 0.2
assert solution["samples"]["x"][2] == 0.7
assert solution["functions"]["u"][1, 2] == 2Fetch error messages
If your workload status is ERROR, use job.error_message() to fetch the error message to help debug, as follows:
job = quick.run(use_case="mdf", physical_params={})
print(job.error_message())
# or write a wrapper around it for a more human readable version
def pprint_error(job):
print("".join(eval(job.error_message())["error"]))
print("___")
pprint_error(job)Output:
{"error": ["qiskit.exceptions.QiskitError: 'Unknown argument \"physical_params\", did you make a typo? -- https://docs.quantum.ibm.com/errors#1804'\n"]}
___
qiskit.exceptions.QiskitError: 'Unknown argument "physical_params", did you make a typo? -- https://docs.quantum.ibm.com/errors#1804'
Get support
For support, contact qiskit-function-support@colibritd.com.
Next steps
- Fill out the form to request access to the QUICK-PDE function.
- Visit the API reference for this Qiskit Function.
- Try modeling a flowing non-viscous fluid using QUICK-PDE in the tutorial.
- Review Jaffali, H., et al. (2025). H-DES: a Quantum-Classical Hybrid Differential Equation Solver. arXiv preprint arXiv:2410.01130.