Skip to content

Footnote error in lab2? #25

@ifsheldon

Description

@ifsheldon

This line says, "Note that the last qubit is not actually connected to the first one, ...."

https://github.com/qiskit-community/qgss-2025/blob/237853c994b30b45ff83cf94631f548f8fed1ad7/lab-2/Lab2.ipynb#L347C84-L347C91

I think the code corresponding to this footnote is

"graph.add_edges_from([(edge[0], edge[1], weights) for edge in generic_backend.coupling_map][:-1])\n",

However, when I print the edges added to the graph, the result does not match the intention of the footnote.

# the result of [(edge[0], edge[1], weights) for edge in generic_backend.coupling_map][:-1]
[(0, 1, 1),
 (1, 0, 1),
 (0, 2, 1),
 (2, 0, 1),
 (0, 3, 1),
 (3, 0, 1),
 (0, 4, 1),
 (4, 0, 1),
 (1, 2, 1),
 (2, 1, 1),
 (1, 3, 1),
 (3, 1, 1),
 (1, 4, 1),
 (4, 1, 1),
 (2, 3, 1),
 (3, 2, 1),
 (2, 4, 1),
 (4, 2, 1),
 (3, 4, 1)]


# the result of [(edge[0], edge[1], weights) for edge in generic_backend.coupling_map]
[(0, 1, 1),
 (1, 0, 1),
 (0, 2, 1),
 (2, 0, 1),
 (0, 3, 1),
 (3, 0, 1),
 (0, 4, 1),
 (4, 0, 1),
 (1, 2, 1),
 (2, 1, 1),
 (1, 3, 1),
 (3, 1, 1),
 (1, 4, 1),
 (4, 1, 1),
 (2, 3, 1),
 (3, 2, 1),
 (2, 4, 1),
 (4, 2, 1),
 (3, 4, 1),
 (4, 3, 1)]

In the code, there's one edge from Node 3 to Node 4 but no one edge from Node 4 to Node 3 while the last qubit (Node 4) is connected to the first one (Node 0) since there're 2 edges connecting them. So, I guess the footnote is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions