qml.ftqc.generate_lattice

generate_lattice(dims, lattice)[source]

Generates a Lattice object 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 Lattice object.

Raises:

ValueError – If the lattice shape is not supported or the dimensions are invalid.