Closed balopat closed 3 years ago
The above workaround doesn't work for Bristlecone, it uses a completely different way to display the ascii diagram based on neighbors_of
:
def neighbors_of(self, qubit: GridQubit):
"""Returns the qubits that the given qubit can interact with."""
possibles = [
GridQubit(qubit.row + 1, qubit.col),
GridQubit(qubit.row - 1, qubit.col),
GridQubit(qubit.row, qubit.col + 1),
GridQubit(qubit.row, qubit.col - 1),
]
return [e for e in possibles if e in self.qubits]
+1 for adding this to the device. For reference, we usually refer to "pairs" internally, rather than "edges", see our internal GridDevice
implementation.
Is your feature request related to a use case or problem? Please describe.
I am working on the 2 qubit interaction visualization and wanted to generate random characterization data for each of the edges of the Sycamore chip.
Describe the solution you'd like
There is no way to retrieve a list of the edges on the chip - despite the
cirq.google.Sycamore
representation printing out the diagram nicely.Describe alternatives/workarounds you've considered
As currently I'm only working on an example, I will just rely on a copy-pasta from the
SerializableDevice.__str__
function:But this is far from ideal. It would be much better to have something like
cirq.google.Sycamore.edges()
or something similar.Additional context (e.g. screenshots)
Maybe the generic GraphDevice is the answer to this as well?
What is the urgency from your perspective for this issue? Is it blocking important work?
P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle (because I have a workaround at the moment)