We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An existing implementation that has been removed from surface-sim is
surface-sim
def sublayout( self, qubits: List[str], name: Optional[str] = None, distance: Optional[int] = None, description: Optional[str] = None, ) -> Layout: setup = {} setup["name"] = name setup["distance"] = distance setup["description"] = description setup["interaction_order"] = self.interaction_order layout = [] for node, attrs in self.graph.nodes(data=True): if node in qubits: node_dict = deepcopy(attrs) node_dict["qubit"] = node nbr_dict = dict() adj_view = self.graph.adj[node] for nbr_node, edge_attrs in adj_view.items(): if nbr_node in qubits: edge_dir = edge_attrs["direction"] nbr_dict[edge_dir] = nbr_node for ver_dir in ("north", "south"): for hor_dir in ("east", "west"): edge_dir = f"{ver_dir}_{hor_dir}" if edge_dir not in nbr_dict: nbr_dict[edge_dir] = None node_dict["neighbors"] = nbr_dict layout.append(node_dict) setup["layout"] = layout return Layout(setup)
I believe this functionality should not be a method from Layout as this class is already big and it can be separated into a new function.
Layout
The text was updated successfully, but these errors were encountered:
No branches or pull requests
An existing implementation that has been removed from
surface-sim
isI believe this functionality should not be a method from
Layout
as this class is already big and it can be separated into a new function.The text was updated successfully, but these errors were encountered: