mindquantum.device.GridQubits

View Source On Gitee
class mindquantum.device.GridQubits(n_row: int, n_col: int)[source]

Grid qubit topology.

Parameters
  • n_row (int) – how many rows of your grid qubits.

  • n_col (int) – how many columns of your grid quits.

Examples

>>> from mindquantum.device import GridQubits
>>> topology = GridQubits(2, 3)
>>> topology.n_row()
2
n_col()[source]

Get column number.

Returns

int, the column number.

Examples

>>> from mindquantum.device import GridQubits
>>> topology = GridQubits(2, 3)
>>> topology.n_col()
3
n_row()[source]

Get row number.

Returns

int, the row number.

Examples

>>> from mindquantum.device import GridQubits
>>> topology = GridQubits(2, 3)
>>> topology.n_row()
2