Added GateDurationTable to simplify duration lookup of equivalent gates. #5427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per @tanujkhattar 's suggestion, it would be useful to have the most general GateFamily for a particular gate instance as the key of
GridDeviceMetadata.gate_durations(i.e.cg.FSimGateFamily(gates_to_accept=[cg.SYC])instead ofcirq.GateFamily(cg.SYC)). However, constructing the GateFamily to look up a particular gate duration is additional overhead for the user.Here I propose a
GateDurationTabledata structure which is initialized using the most general GateFamilies for each device gate, while allowing users to look up duration using specific gate instances. For example:Users can still see the full durations list via
print(gdt).How does this look conceptually?
We may not want to overcomplicate gate duration logic since it's mostly informational and values are approximate, but I think this is a low hanging fruit where we can make the experience better.
@MichaelBroughton @tanujkhattar