Skip to main contentIBM Quantum Documentation Mirror

QUICK-PDE API reference

  • Qiskit Functions

    Qiskit Functions — pre-built tools created by partner organizations — abstract away parts of the software development workflow to simplify and accelerate utility-scale algorithm discovery and application development. Click to view the guide for this Qiskit Function.


Inputs

use_case

Type: `Literal['MD', 'CFD']`

Toggle to select the system of differential equations to solve

  • Use-case specific: No
  • Example: "CFD"

parameters

Type: `dict[str, Any]`

The parameters of the differential equation (physical parameters and boundary condition), which should follow the given format:

Use case
Key
Value type
Description
Example
CFDafloatCoefficient of the initial values of uu1.0
CFDbfloatOffset of the initial values of uu1.0
MDtfloatsurface stress12.0
MDKfloatbulk modulus100.0
MDnintpower law4.0
MDbfloatforce per unit mass10.0
MDepsilon_0floatproportional stress limit0.1
MDsigma_0floatproportional strain limit5.0
  • Use-case specific: No
  • Example: {"a": 1.0, "b": 1.0}

nb_qubits

Type: `Optional[dict[str, dict[str, int]]]`

Number of qubits per function and per variable. Optimized values are chosen by the function, but if you want to try to find a better combination, you can override the default values.

  • Use-case specific: No
  • Example: {"u": {"x": 1, "t":3}}

depth

Type: `Optional[dict[str, int]]`

Depth of ansatz per function. Optimized values are chosen by the function, but if you want to try to find a better combination, you can override the default values.

  • Use-case specific: No
  • Example: {"u": 4}

optimizer

Type: `Optional[list[str]]`

Optimizers to be used, either "CMAES" from the cma python library or one of the optimizers of scipy

  • Use-case specific: MD
  • Example: "SLSQP"

shots

Type: `Optional[list[int]]`

Number of shots used to run each circuit. Since several optimization steps are needed, the length of the list must be equal to the number of optimizers used (4 in the case of CFD). Defaults to [50_000] * nb_optimizers for MD and [5_00, 2_000, 5_000, 10_000] for CFD.

  • Use-case specific: No
  • Example: [15_000, 30_000]

optimizer_options

Type: `Optional[dict[str, Any]]`

Options to pass to the optimizer. The details of this input depends on the optimizer used; for specifics, refer to the documentation of the optimizer used.

  • Use-case specific: MD
  • Example: {"maxiter": 50 }

initialization

Type: `Optional[Literal['RANDOM', 'PHYSICALLY_INFORMED']]`

Default value: `PHYSICALLY_INFORMED`

Whether to start with random angles or smartly chosen angles. Beware that smartly chosen angles may not work in 100% of the cases.

  • Use-case specific: No
  • Example: "RANDOM"

backend_name

Type: `Optional[str]`

The backend name to use.

  • Use-case specific: No
  • Example: ibm_torino

mode

Type: `Optional[Literal['job', 'session', 'batch']]`

Default value: `job`

The execution mode to use.

  • Use-case specific: No
  • Example: "job"

Output

The output is a dictionary with the list of sample points, as well as the values of the functions at each of these points:

from numpy import array
solution = {
    "functions": {
        "u": array(
            [
                [0.01, 0.1, 1],
                [0.02, 0.2, 2],
                [0.03, 0.3, 3],
                [0.04, 0.4, 4],
            ]
        ),
    },
    "samples": {
        "t": array([0.1, 0.2, 0.3, 0.4]),
        "x": array([0.5, 0.6, 0.7]),
    },
}

The shape of a solution array depends on the variables' samples:

assert len(solution["functions"]["u"].shape) == len(solution["samples"])
for col_size, samples in zip(
    solution["functions"]["u"].shape, solution["samples"].values()
):
    assert col_size == len(samples)

The mapping between the function variables' sample points and the solution array's dimension is done in alphanumeric order of the variable's name. For example, if the variables are "t" and "x", a row of solution["functions"]["u"] represents the values of the solution for a fixed "t", and a column of solution["functions"]["u"] represents the values of the solution for a fixed "x".