qml.ftqc.generate_lattice¶
- generate_lattice(dims, lattice)[source]¶
Generates a
Latticeobject with a given geometric parameters and its shape name.- Parameters:
dims (List[int]) – Geometric parameters for lattice generation. For lattices generated by nx.grid_graph (
'chain','rectangle','square','cubic'),'triangle' (dims contains the number of nodes in the each direction of grid. Per 'honeycomb' or)
dims[1] (the generated lattices will have dims[0] rows and)
triangles. (columns of hexagons or)
lattice (str) – Shape of the lattice. Input values can be
'chain','square','rectangle','honeycomb','triangle','cubic'.
- Returns:
a
Latticeobject.- Raises:
ValueError – If the lattice shape is not supported or the dimensions are invalid.
code/api/pennylane.ftqc.generate_lattice
Download Python script
Download Notebook
View on GitHub