Package Overview

QuOp_MPI provides an objected-oriented framework for the design and simulation of QVAs. It enables researchers with any level of parallel programming experience to design simulation workflows that are efficiently scalable on massively parallel systems.

QVA Simulation

Predefined Algorithms

For combinatorial optimisation problems:

For the optimisation of continuous multivariable functions.

User-Defined Algorithms

Novel QVAs may be designed by working directly with the Ansatz class and propagator submodules. See,

Adaptive Operator and Optimisation Schemes

The QuOp_MPI Ansatz and Unitary classes are configured via QuOp Functions. These allow the implementation of arbitrarily parameterised operators and adaptive optimisation schemes. QuOp_MPI includes default QuOp Functions that support the interfacing of user-defined serial Python functions with its parallelisation scheme for QVA simulation. Users may also define MPI-compatible custom QuOp Functions with minimal parallel programming experience.

Parallelisation Schemes

QuOp_MPI implements several MPI-based parallelisation schemes, which are all mutually compatible. Of these, parallel Quantum simulation is relevant to QVA simulation on personal computers, workstations and clusters. While parallel gradient computation and Ansatz swarms support simulation workflows on clusters.

Quantum Simulation

For an MPI (sub)communicator with \(m\) processes with integer ID \(\text{rank} \in (0,...,m-1)\), the system state and observables of a simulated QVA are partitioned over an MPI (sub)communicator with,

\[\text{local_i}\]

elements per rank and a global index offset of,

\[\text{local_i_offset} = \sum_{i<\text{rank}} \text{local_i}.\]

These distributed arrays are acted on by instances of the Unitary class, which provides an interface to efficient Python extensions which compute the action of the QVA unitaries in MPI parallel.

Gradient Evaluation

For optimisation methods that make use of gradient information, computation of the objective function gradient may be carried out in MPI parallel by duplicating an Ansatz over multiple MPI subcommunicators (see set_parallel_jacobian()).

Ansatz Swarms

Optimisation of QVA variational parameters over a large search domain, or other QVA meta-optimisation tasks can be accelerated through creation of an swarm, which manages multiple QVA simulation instances.

Parallel Overview

The diagram below depicts a swarm of two QVA simulation instances with parallel gradient evaluation (see set_parallel_jacobian()). Each QVA simulation occurs over three MPI subcommunicators with two of the subcommunicators carrying out computation of the partial derivatives of the objective function and the remaining managing optimisation of the variational parameters and evaluation of the objective function. The six Ansatz subcommunicators call the propagate() method of Unitary instances which compute the action of the QVA’s phase-shift and mixing unitaries in MPI parallel.

digraph "sphinx-ext-graphviz" {
    node [fontsize="10"];

    mpi[label="MPI.COMM_WORLD\n12 nodes, 1536 cores", shape=oval]

    swarm[label="Interrelated QVA simulations.\n(swarm)", shape="trapezium"];

    ansatz_0[label="QVA Simulation 1\n(Ansatz)",shape="invhouse"];
    ansatz_N[label="QVA Simulation 2\n(Ansatz)",shape="invhouse"];

    gradient_0_0[label="Gradient\ncomputation.\n(Ansatz)",shape="rectangle"];
    gradient_0_N[label="Gradient\ncomputation.\n(Ansatz)",shape="rectangle"];
    gradient_N_0[label="Gradient\ncomputation.\n(Ansatz)",shape="rectangle"];
    gradient_N_N[label="Gradient\ncomputation.\n(Ansatz)",shape="rectangle"];

    propagation_0[label="Objective function\nminimisation.\n(Ansatz)",shape="rectangle"];
    propagation_N[label="Objective function\nminimisation.\n(Ansatz)",shape="rectangle"];

    propagation_gradient_0_0[label="Parallel quantum\nstate propagation\n(Unitary)", shape="rectangle"];
    propagation_gradient_0_N[label="Parallel quantum\nstate propagation\n(Unitary)", shape="rectangle"];
    propagation_gradient_N_0[label="Parallel quantum\nstate propagation\n(Unitary)", shape="rectangle"];
    propagation_gradient_N_N[label="Parallel quantum\nstate propagation\n(Unitary)", shape="rectangle"];

    obj_propagation_0[label="Parallel quantum\nstate propagation\n(Unitary)", shape="rectangle"];
    obj_propagation_N[label="Parallel quantum\nstate propagation\n(Unitary)", shape="rectangle"];

    mpi -> swarm [style=dashed, dir=none];

    swarm-> ansatz_0 [label=768];
    swarm-> ansatz_N [label=768];

    ansatz_0 -> propagation_0 [label=256];
    ansatz_N -> propagation_N [label=256];

    propagation_0 -> obj_propagation_0 [style=dashed, dir=none];
    propagation_N -> obj_propagation_N [style=dashed, dir=none];

    ansatz_0 -> gradient_0_0 [label=256];
    ansatz_0 -> gradient_0_N [label=256];

    ansatz_N -> gradient_N_0 [label=256];
    ansatz_N -> gradient_N_N [label=256];

    gradient_0_0 -> propagation_gradient_0_0 [style="dashed", dir="none"];
    gradient_0_N -> propagation_gradient_0_N [style="dashed", dir="none"];
    gradient_N_0 -> propagation_gradient_N_0 [style="dashed", dir="none"];
    gradient_N_N -> propagation_gradient_N_N [style="dashed", dir="none"];

}

Example parallel structure for QuOp_MPI running on a cluster with 128 cores per node. Solid arrows indicate splitting of an MPI (sub)communicator and dashed lines sharing of an MPI (sub)communicator. Numbered edges indicate MPI subcommunicator size. Relevant QuOp_MPI classes are indicated in parenthesises.

Support for Clusters with Job-Scheduling

For clusters with time-limited job-scheduling, the benchmark(), execute_swarm() and benchmark_swarm() methods support automated job-suspension and resumption.