Skip to content

Commit b140970

Browse files
mhuckapavoljuhas
andauthored
Fix #5497: update IonQ docs to remove decompose_operation (#7198)
* Fix #5497 Removed mention of `decompose_operation`. Issue #5497 talks about updating the IonQ documentation to describe the use of transformers for compilation introduced in #5479. This commit does not address that. * Fix example of circuit transformation for IonQ-native gates Replace and test the outdated example code (cirq.Circuit does not take a `device` argument anymore). --------- Co-authored-by: Pavol Juhas <[email protected]>
1 parent 2239eb0 commit b140970

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/hardware/ionq/circuits.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,18 @@ these gates are one or two qubit gates which support the `unitary` protocol
9696
for the gate), there is support for compiling these into API supported gates.
9797
This conversion may not be optimal, but it does produce a valid API circuit.
9898

99-
This support is given by the `cirq_ionq.IonQAPIDevice` and its
100-
`decompose_operation` method. On way to use this is to pass the device
101-
to a circuit, and these decompositions will be automatically applied while
102-
the circuit is being constructed:
99+
This support is provided by the `cirq.optimize_for_target_gateset` transformer
100+
and the `cirq_ionq.IonQTargetGateset`, which specifies the IonQ native gates,
101+
for example:
103102

104103
```python
105104
q0 = cirq.LineQubit(0)
106-
device = ionq.IonQAPIDevice([q0])
107-
circuit = cirq.Circuit(device=device)
108-
circuit.append(cirq.H(q0)**0.2) # Non-API gate
109-
print(circuit)
105+
circuit = cirq.Circuit(cirq.H(q0)**0.2) # Non-API gate
106+
circuit_for_ionq = cirq.optimize_for_target_gateset(
107+
circuit,
108+
gateset=ionq.IonQTargetGateset(),
109+
)
110+
print(circuit_for_ionq)
110111
```
111112
which produces
112113
```
@@ -121,4 +122,3 @@ circuit.
121122
[How to use the service API](jobs.md)
122123

123124
[Get information about QPUs from IonQ calibrations](calibrations.md)
124-

0 commit comments

Comments
 (0)