Skip to content
New issue

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

Change GridDeviceMetadata qubit type to GridQubit #5633

Merged
merged 6 commits into from
Jun 30, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cirq-core/cirq/devices/grid_device_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ class GridDeviceMetadata(device.DeviceMetadata):

def __init__(
self,
qubit_pairs: Iterable[Tuple['cirq.Qid', 'cirq.Qid']],
qubit_pairs: Iterable[Tuple['cirq.GridQubit', 'cirq.GridQubit']],
gateset: 'cirq.Gateset',
gate_durations: Optional[Dict['cirq.GateFamily', 'cirq.Duration']] = None,
all_qubits: Optional[Iterable['cirq.Qid']] = None,
all_qubits: Optional[Iterable['cirq.GridQubit']] = None,
compilation_target_gatesets: Iterable['cirq.CompilationTargetGateset'] = (),
):
"""Create a GridDeviceMetadata object.

Create a GridDevice which has a well defined set of couplable
Create a grid device which has a well defined set of couplable
qubit pairs that have the same two qubit gates available in
both coupling directions. Gate times (if provided) are expected
to be uniform across all qubits on the device.

Args:
qubit_pairs: Iterable of pairs of `cirq.Qid`s representing
qubit_pairs: Iterable of pairs of `cirq.GridQubit`s representing
bi-directional couplings.
gateset: `cirq.Gateset` indicating gates supported
everywhere on the device.
Expand Down Expand Up @@ -114,7 +114,7 @@ def __init__(
self._gate_durations = gate_durations

@property
def qubit_pairs(self) -> FrozenSet[FrozenSet['cirq.Qid']]:
def qubit_pairs(self) -> FrozenSet[FrozenSet['cirq.GridQubit']]:
"""Returns the set of all couple-able qubits on the device.

Each element in the outer frozenset is a 2-element frozenset representing a bidirectional
Expand All @@ -123,7 +123,7 @@ def qubit_pairs(self) -> FrozenSet[FrozenSet['cirq.Qid']]:
return self._qubit_pairs

@property
def isolated_qubits(self) -> FrozenSet['cirq.Qid']:
def isolated_qubits(self) -> FrozenSet['cirq.GridQubit']:
"""Returns the set of all isolated qubits on the device (if appliable)."""
return self._isolated_qubits

Expand Down