cirq.TiltedSquareLattice

A grid lattice rotated 45-degrees.

Inherits From: NamedTopology

Used in the notebooks

Used in the tutorials

This topology is based on Google devices where plaquettes consist of four qubits in a square connected to a central qubit:

x   x
  x
x   x

The corner nodes are not connected to each other. width and height refer to the rectangle formed by rotating the lattice 45 degrees. width and height are measured in half-unit cells, or equivalently half the number of central nodes. An example diagram of this topology is shown below. It is a "tilted-square-lattice-6-4" with width 6 and height 4.

      x
      │
 x────X────x
 │    │    │

x────X────x────X────x │ │ │ │ x────X────x────X───x │ │ │ x────X────x │ x

Nodes are 2-tuples of integers which may be negative. Please see get_placements for mapping this topology to a GridQubit Device.

width Dataclass field
height Dataclass field

Methods

draw

View source

Draw this graph using Matplotlib.

Args
ax Optional matplotlib axis to use for drawing.
tilted If True, directly position as (row, column); otherwise, rotate 45 degrees to accommodate the diagonal nature of this topology.
**kwargs Additional arguments to pass to nx.draw_networkx.

nodes_as_gridqubits

View source

Get the graph nodes as cirq.GridQubit

nodes_to_gridqubits

View source

Return a mapping from graph nodes to cirq.GridQubit

Args
offset Offset row and column indices of the resultant GridQubits by this amount. The offset positions the top-left node in the draw(tilted=False) frame.

__eq__

Return self==value.

graph Instance of NotImplementedType
n_nodes Instance of NotImplementedType
name Instance of NotImplementedType