-
Notifications
You must be signed in to change notification settings - Fork 1k
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
GridDeviceMetadata
design discussion and nits.
#4961
Comments
|
The name of the property on the class is
I'm fine with changing to Dict['cirq.GateFamily', 'cirq.Duration'], the point of this class is to just get the information to the users in an exploratory fashion, both GateFamily and Gateset will do this.
Durations can't always be well defined by just the gates. In all cases, the duration of the gate can only be known or defined once you have a device that implements that gate. I think it makes complete sense that a gateset/gatefamily to duration mapping happen close to the device and it be clear that the device dictates this information. I don't think we should add metadata about durations to gatesets to turn their job into communicating information about groups of gates and their respective durations were they to have some known timings related to a device. |
Thanks for the suggestions! My take:
|
+1, let's make the constructor variable name match the property name.
On a closer look, I see that using a
Sounds good. Still curious if |
Closing for now. After offline discussions we agreed that in the new roles that Device take on: Devices do |
Description of the issue
I just looked at the newly added
Cirq/cirq-core/cirq/devices/grid_device_metadata.py
Line 34 in 6937e41
s/supported_gates/gateset/g
? Type ofsupported_gates
is not clear from it's name (is it a list of supported gate instances? gate types? gate families?) and we should change it to a more descriptive name likegateset
.gate_durations
should be a dict fromGateFamily
tocirq.Duration
instead ofGateset
tocirq.Duration
. A gateset is a collection of gates, each of which can potentially have different durations.GateFamily
class itself. Maybe as an optional field? Maybe as a metadata that can be queried?Gateset
and an explicitDict['cirq.GateFamily', 'cirq.Duration']
in theGridDeviceMetadata
looks like a bad smell. A gateset is a collection of gates, and duration is a property of gates. Why decouple them and store them independently?GridDeviceMetadata
would consist of justqubit_pairs
and agateset
, both of which could potentially move into theDevice
class, avoiding an additional indirection to access qubits on a device -- (cc Matt's comment on Deprecate device.qubit_set in cirq_google. #4940)Cirq version
0.14dev
cc @MichaelBroughton @verult @dstrain115
The text was updated successfully, but these errors were encountered: