surface_sim.layouts.Layout.__init__#
- layouts.Layout.__init__(setup)#
Initiailizes the layout for a particular code.
- Parameters:
- setup
The layout setup, provided as a dict.
The setup dictionary is expected to have a ‘layout’ item, containing a list of dictionaries. Each such dictionary (
dict[str, object]) must define the qubit label (str) corresponding the'qubit'item. In addition, each dictionary must also have a'neighbors'item that defines a dictonary (dict[str, str]) of ordinal directions and neighbouring qubit labels. Apart from these two items, each dictionary can hold any other metadata or parameter relevant to these qubits.In addition to the layout list, the setup dictionary can also optionally define the name of the layout (
str), a description (str) of the layout as well as the interaction order of the different types of check, if the layout is used for a QEC code.
- Raises:
- ValueError
If the type of the setup provided is not a dictionary.