mentpy.mbqc.templates.grid_cluster(n, m, periodic=False, **kwargs) MBQCircuit

Returns a grid cluster state of n x m qubits.

Parameters:
n : int

The number of rows in the cluster state.

m : int

The number of columns in the cluster state.

periodic : bool

If True, the returned state will be a cylinder.

Return type:

The grid cluster state of n x m qubits.

Examples

Create a 2D cluster state \(|G>\) of five qubits

In [1]: g = mp.templates.grid_cluster(2, 3)

In [2]: mp.draw(g)
Out[2]: (<Figure size 800x300 with 1 Axes>, <Axes: >)
../_images/grid_cluster.png