Skip to content

Commit

Permalink
Add Quantum Engine Support for InternalGate (#6613)
Browse files Browse the repository at this point in the history
* add internal gate to device proto

* build protos

* tests pass

* add docstring

* build protos

* build protos
  • Loading branch information
senecameeks authored May 22, 2024
1 parent 3b975b0 commit f246c2b
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 45 deletions.
4 changes: 4 additions & 0 deletions cirq-google/cirq_google/api/v2/device.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ message GateSpecification {
Wait wait = 11;
FSimViaModel fsim_via_model = 12;
CZPowGate cz_pow_gate = 13;
InternalGate internal_gate = 14;
}

// Gate types available to Google devices.
Expand All @@ -76,6 +77,9 @@ message GateSpecification {
message Wait {}
message FSimViaModel {}
message CZPowGate {}
// This gate gets mapped to the internal representation corresponding
// to <gate_module.gate_name>.
message InternalGate {}
}

message GateSet {
Expand Down
86 changes: 44 additions & 42 deletions cirq-google/cirq_google/api/v2/device_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions cirq-google/cirq_google/api/v2/device_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cirq-google/cirq_google/devices/grid_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ class _GateRepresentations:
gate_spec_name='fsim_via_model',
supported_gates=[cirq.GateFamily(cirq.FSimGate, tags_to_accept=[ops.FSimViaModelTag()])],
),
_GateRepresentations(
gate_spec_name='internal_gate', supported_gates=[cirq.GateFamily(ops.InternalGate)]
),
]


Expand Down
Loading

0 comments on commit f246c2b

Please sign in to comment.