cirq.LineTopology

A 1D linear topology.

Inherits From: NamedTopology

Used in the notebooks

Used in the tutorials

Node indices are contiguous integers starting from 0 with edges between adjacent integers.

n_nodes The number of nodes in a line.

n_nodes Dataclass field

Methods

draw

View source

Draw this graph using Matplotlib.

Args
ax Optional matplotlib axis to use for drawing.
tilted If True, draw as a horizontal line. Otherwise, draw on a diagonal.
**kwargs Additional arguments to pass to nx.draw_networkx.

nodes_as_linequbits

View source

Get the graph nodes as cirq.LineQubit

nodes_to_linequbits

View source

Return a mapping from graph nodes to cirq.LineQubit

Args
offset Offset integer positions of the resultant LineQubits by this amount.

__eq__

Return self==value.

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