Please enable JavaScript in your browser.

Cutting and knitting of quantum circuits - fltech - Technology Blog of Fujitsu Research

fltech - Technology Blog of Fujitsu Research

A technology blog where Fujitsu researchers talk about a variety of topics

Cutting and knitting of quantum circuits


This is Vicente P. Soloviev and Michal Krompiec, from Quantum Applications Research group, part of the Quantum Lab at Fujitsu. In this post we give an overview of our recent results on the development of an automatic framework for circuit cutting (QuantCut) and its application to portfolio diversification for the S&P 500 stock market.

Background and purpose

The main objective that we face in this work is dealing with the scalability of the experiments that can be run on a real quantum computer or a simulator. Today's quantum computers, as well as classical simulators which model their behavior on CPUs or GPUs, are restricted to a relatively small number of qubits available to the user, i.e. the width of the circuit. With QuantCut, we are able to run bigger (i.e. wider) quantum circuits on smaller quantum devices, enabling us to target larger problem instances. In this post, we describe how this is achieved and present an example use case for quantum optimization in finance.

Circuit cutting and knitting

The idea behind circuit cutting is splitting a quantum circuit into several smaller subcircuits, whose size does not exceed the capability (i.e. maximum number of qubits in the register) of a given quantum device or simulator. Techniques have been proposed in the literature differ mainly in how the circuit graph is divided into subcircuits:

  1. Wire cuts (also known as time-like cuts) are direct cuts of a qubit wire. Usually, a wire cut is represented as a measure-and-prepare channel, in which the qubit is measured, and the rest of the wire is located into a new wire. Thus, this type of approaches involves adding a new qubit wire to satisfy the purpose.
  2. A gate cut (also known as a space-like cut) involves cutting a 2-qubit operation (i.e. an entangling gate) and splitting it into single-qubit operations located in both qubit wires. Note that this approach does not involve adding new qubit wires. QuantCut implements this type of circuit cutting variant.
Cutting comes at a price

There is no free lunch, though! While circuit cutting and knitting allows for execution of circuits with larger qubit registers than those available on the target device or simulator, it comes at a cost. Because the cuts replace a quantum channel (a gate or a wire) with classical exchange of information, they incur an exponential overhead in the number of measurements, thus limiting the utility to special cases where only a handful of cuts is required to partition a circuit. Such a use case is presented here. However, if the quantum devices executing the subcircuits could exchange quantum information, e.g. via quantum photonic interconnects, the scalability would be essentially limitless.

General workflow of cutting & knitting

Circuit cutting and knitting involves several steps:

  1. a quantum circuit is input into the circuit cutting module, to minimize the number of cuts required to obtain subcircuits of desired width;
  2. the quantum subcircuits (which already fit in the targeted quantum device) are distributed into several quantum processing units (QPUs) or quantum simulators;
  3. lastly, the results from each of the devices are combined (knitted) in order to reconstruct the final result of the operation (see diagram below).
Flowchart of circuit cutting and kniting
Our framework

As described above, circuit cutting involves several steps. QuantCut consists of an all-in-one automatic workflow, including separate modules for each of these steps. The inputs to QuantuCut are: a quantum circuit and an observable (i.e. operator) to be measured, and the output is the reconstructed expectation value (e.g. energy) of the system, and - optionally - its state vector.
The first module is the automatic cut finder (autocutter). Given a quantum circuit, this module is in charge of optimizing the number of cuts to be performed and their locations in the circuit. This involves an optimization task which is handled by a novel approach based on evolutionary computation. A manual option is also available in which the cuts can be manually imposed in the system.
The second module carries out circuit knitting, i.e. the post-processing. Given the cuts to be performed, QuantCut generates the experiments to be run, and the original observable is split according to the cuts. Each experiment involves a quantum circuit execution and will be parallelized over all the available cores in the classical device or over several QPUs. Once the results are retrieved from the quantum system, they are combined, and the final result is reconstructed. We demonstrated that our workflow outperforms similar circuit cutting and knitting frameworks available in open-source libraries.
Thirdly, QuantCut offers a plotting module to visualize the cuts performed in the quantum circuit. The following picture shows an example in which an original quantum circuit is split into two separate subcircuits. The gates to be cut are represented as grey boxes.

Cutting a 3-qubit circuit into subcircuits for a 2-qubit device
Example use case: Portfolio diversification

To showcase the utility of this framework, we have implemented a solution to an optimization problem in finance using the quantum approximate optimization algorithm (QAOA). We have used real data from the S&P 500 stock market dataset, from which we have selected 71 assets to be considered. The stock market is represented as a graph in which each of the assets is represented as a node, and the edges between them are the correlations. The optimization problem consists in dividing the assets into portfolios such that highly correlated stocks are located in different portfolios, to minimize the risk for the investor.
The QAOA is a classical-quantum hybrid approach in which a quantum parametric circuit is iteratively optimized, to minimize the cost function. In each iteration of this algorithm, the quantum circuit is executed on a QPU or a quantum simulator. In this use case, we assign each of the assets to a qubit. Hence, a 71-qubit quantum circuit has to be measured; much larger than the capacity of state vector simulators. Therefore, QuantCut plays a key role in which circuit cutting techniques are used to estimate the cost function of the quantum circuit from execution of smaller quantum circuits. To execute it, we perform 3 gate cuts over the quantum circuit to split it into two subcircuits of 35 and 36 qubits, respectively.
The following figure shows the cost function minimization of our QAOA problem. We have demonstrated that QuantCut-enabled QAOA outperforms random sampling and is slightly inferior to a state-of-the-art classical evolutionary algorithm. Note that our approach only uses a 1-layer QAOA ansatz and by increasing the number of layers, the results are expected to be improved. This will be addressed in our future research.

Convergence of QuantCut-enabled QAOA for portfolio optimization
Summary and conclusions

We present QuantCut: an automatic tool for gate cutting. It allows to automatically find the ideal cuts to be performed over a quantum circuit, to parallelize the experiments over several devices and to post-process the results to reconstruct the expectation value or state vector. Plotting tools were used to showcase a naïve example of circuit cutting over a simple quantum circuit.
We have applied our framework to play a key role in the execution of a quantum optimization algorithm for a portfolio diversification problem with 71 assets, involving a quantum circuit of 71 qubits. Preliminary results show outperforming random sampling, and results comparable to classical approaches.
Further research will involve increasing the number of layers of the QAOA circuit, where an improvement in terms of accuracy is expected. Moreover, we would like to test bigger problem instances (i.e. more than 71 qubits). We are also interested in studying the impact of quantum errors in this approach, as circuit cutting and knitting may increase noise resilience of QAOA.