Introduction_EN.md 10.0 KB
Newer Older
Q
Quleaf 已提交
1 2 3 4
# Measurement-Based Quantum Computation Module

## Introduction

Q
Quleaf 已提交
5
Measurement-Based Quantum Computation (MBQC) module is a simulation tool for universal quantum computing, developed based on Paddle Quantum. Unlike the conventional quantum circuit model, MBQC has its unique way of computing [1-8] and thus common circuit simulation tools cannot be directly used for the simulation of this model. To facilitate further research and exploration of MBQC, we have designed and provided several core modules that are required for simulation.
Q
Quleaf 已提交
6 7 8

On the one hand, as with common quantum circuit simulators, we can use the module to quickly build and train quantum neural networks, which have powerful application prospects in the field of artificial intelligence such as quantum chemistry, quantum natural language processing, and quantum finance. On the other hand, the MBQC module demonstrates its unique advantages in computational efficiency in some special cases, especially in quantum shallow circuit simulations, where the required computational resource can be significantly reduced, leading to a potential opportunity for larger-scale quantum algorithm simulations.

Q
Quleaf 已提交
9
Our module is the first and only systematic tool in the industry that supports the simulation of MBQC. We sincerely look forward to its learning and usage by quantum computing enthusiasts and researchers. Welcome to join us and discover the infinite possibilities of MBQC together!
Q
Quleaf 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

## Features

- Plenty of online tutorials with rich theory illustration and code demonstrations, making it easy to get started
- Complete core modules for universal simulation with strong extendability and friendly user experience
- Efficient transpiling and simulation algorithms to accelerate the code execution with high performance

## Getting Started with MBQC from Scratch

### What is MBQC

Measurement-based quantum computing is a technique route for universal quantum computing, different from the quantum circuit model. As its name suggests, MBQC controls the computation by measuring part of the qubits of an entangled state, with those remaining unmeasured undergoing the evolution correspondingly. By controlling measurements, we can complete any desired evolution [1-8].

The standard computational process of MBQC is divided into three main steps: graph state preparation, single-qubit measurement, and byproduct correction. An equivalent way to describe this process is the measurement pattern (or "EMC" language) of MBQC [9]. Please refer to [MBQC Quick Start Guide](MBQC_CN.ipynb) for more details.

### Submodules

|Submodule|Description|
|:---|:---|
|`simulator`|contains a frequently used class and accompanying simulation tools for constructing MBQC models.|
|`mcalculus`|contains operations for the manipulation of measurement patterns.|
|`transpiler`|contains tools for transpiling circuits to measurement patterns.|
|`qobject`|contains common objects for quantum information processing, such as quantum states, quantum circuits, measurement patterns, etc.|
|`utils`|contains various common classes and functions used for computation.|

### Basic usage of the module

Here we briefly introduce the basic usage of the module.

#### Running with standard processes

In the `simulator`, we define a class `MBQC` to be instantiated to build your own MBQC model. Most of the MBQC algorithms are implemented by this class. We can first set the underlying graph of their MBQC model, then call the class method `measure` to measure each vertex in the graph, and finally correct the corresponding byproducts to finish the computation. Here we take the implementation of a single-qubit `Hadamard` gate as an example to briefly demonstrate its basic usage.

```python
# Import modules
from paddle_quantum.mbqc.simulator import MBQC
from paddle_quantum.mbqc.utils import basis
# Construct the underlying graph
vertices = ["1", "2"]
edges = [("1", "2")]
graph = [vertices, edges]
# Construct an MBQC model
mbqc = MBQC()
# Set the underlying graph
mbqc.set_graph(graph)
# Measure vertex '1' in Pauli X basis
mbqc.measure("1", basis("X"))
# Correct byproduct on vertex '2'
mbqc.correct_byproduct('X', "2", mbqc.sum_outcomes(["1"]))
# Obtain the quantum output
state_out = mbqc.get_quantum_output()
```

#### Running with measurement patterns

Both MBQC and circuit models can realize universal quantum computation and there is a one-to-one correspondence between them. However, the process of converting a quantum circuit to its MBQC equivalent is complicated and requires numerous calculations [9]. For this, we provide a module `transpiler` in our module for automatic translation from quantum circuits to measurement patterns. We can first call the ``Circuit`` in `qobject` to build a quantum circuit, just like calling [UAnstaz](https://qml.baidu.com/api/paddle_quantum.circuit.uansatz.html), then use the `transpiler` module to get an equivalent measurement pattern of the circuit, and finally send this pattern into the ``simulator`` module to run it. Again, here we briefly demonstrate the usage by the implementation of a single-qubit `Hadamard` gate as an example.

```python
# Import modules
from paddle_quantum.mbqc.qobject import Circuit
from paddle_quantum.mbqc.transpiler import transpile
from paddle_quantum.mbqc.simulator import MBQC
# Construct a circuit
width = 1
cir = Circuit(width)
cir.h(0)
# Transpile it to a pattern
pat = transpile(cir)
# Run the pattern in MBQC
mbqc = MBQC()
mbqc.set_pattern(pat)
mbqc.run_pattern()
# Obtain the quantum output
state_out = mbqc.get_quantum_output()
```

The above are the main contents of the current MBQC module. We can call relevant modules as needed in practice. In terms
of more functionalities of each module, please refer to the tutorials and the API documentation.

### Tutorials

Here, we provide three tutorials, each of which contains basic theory explanations and detailed code demonstrations. By following the tutorials and code practice, you will get familiar with the MBQC model as well as our module
shortly.

- [MBQC Quick Start Guide](MBQC_EN.ipynb)
- [Measurement-based Quantum Approximate Optimization Algorithm](QAOA_EN.ipynb)
- [Polynomial Unconstrained Boolean Optimization Problem in MBQC](PUBO_EN.ipynb)

## Frequently Asked Questions

- Q: Why should I study MBQC? What application scenarios does it have?

    A: MBQC is a universal quantum computing model parallel to the quantum circuit model. Compared to quantum gates, single-qubit measurements are easier to implement in practice with higher fidelity, and the part of non-adaptive measurements can even be realized simultaneously, drastically reducing the algorithm depth and thus the effect of decoherence on fidelity. In terms of classical simulation, since measurements commute between different qubits, the simulation process can be optimized by measurements reordering, leading to less consumption of the computational resource and thus improving the efficiency. In addition, the resource states in MBQC can be independent of specific computational tasks, which can be applied in quantum Internet for secure delegated quantum computing to protect users' privacy [10,11].

- Q: How is the MBQC physically implemented?

Q
Quleaf 已提交
106 107 108
    A: The difficulty in the physical implementation of MBQC is mainly the preparation of resource states. Unlike 
  the superconducting techniques used in the quantum circuit model, the resource states are mostly prepared using 
  linear optics or cold atoms, see e.g. [2,12,13] for the existing techniques of resource states preparation.
Q
Quleaf 已提交
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136

## References

[1] Gottesman, Daniel, and Isaac L. Chuang. "Demonstrating the viability of universal quantum computation using teleportation and single-qubit operations." [Nature 402.6760 (1999): 390-393.](https://www.nature.com/articles/46503?__hstc=13887208.d9c6f9c40e1956d463f0af8da73a29a7.1475020800048.1475020800050.1475020800051.2&__hssc=13887208.1.1475020800051&__hsfp=1773666937)

[2] Robert Raussendorf, et al. "A one-way quantum computer." [Physical Review Letters 86.22 (2001): 5188.](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.86.5188)

[3] Raussendorf, Robert, and Hans J. Briegel. "Computational model underlying the one-way quantum computer." [Quantum Information & Computation 2.6 (2002): 443-486.](https://dl.acm.org/doi/abs/10.5555/2011492.2011495)

[4] Robert Raussendorf, et al. "Measurement-based quantum computation on cluster states." [Physical Review A 68.2 (2003): 022312.](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.68.022312)

[5] Nielsen, Michael A. "Quantum computation by measurement and quantum memory." [Physics Letters A 308.2-3 (2003): 96-100.](https://www.sciencedirect.com/science/article/abs/pii/S0375960102018030)

[6] Leung, Debbie W. "Quantum computation by measurements." [International Journal of Quantum Information 2.01 (2004): 33-43.](https://www.worldscientific.com/doi/abs/10.1142/S0219749904000055)

[7] Briegel, Hans J., et al. "Measurement-based quantum computation." [Nature Physics 5.1 (2009): 19-26.](https://www.nature.com/articles/nphys1157)

[8] Aliferis, Panos, and Debbie W. Leung. "Computation by measurements: a unifying picture." [Physical Review A 70.6 (2004): 062314.](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.70.062314)

[9] Danos, Vincent, et al. "The measurement calculus." [Journal of the ACM (JACM) 54.2 (2007): 8-es.](https://dl.acm.org/doi/abs/10.1145/1219092.1219096)

[10] Broadbent, Anne, et al. "Universal blind quantum computation." [2009 50th Annual IEEE Symposium on Foundations of Computer Science. IEEE, 2009.](https://arxiv.org/abs/0807.4154)

[11] Morimae, Tomoyuki. "Verification for measurement-only blind quantum computing." [Physical Review A 89.6 (2014): 060302.](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.89.060302)

[12] Larsen, Mikkel V., et al. "Deterministic generation of a two-dimensional cluster state." [Science 366.6463 (2019): 369-372.](https://science.sciencemag.org/content/366/6463/369)

[13] Asavanant, Warit, et al. "Generation of time-domain-multiplexed two-dimensional cluster state." [Science 366.6463 (2019): 373-376.](https://science.sciencemag.org/content/366/6463/373)