Skip to content

Commit 77e9543

Browse files
committed
Fix doctests
1 parent dcfee7b commit 77e9543

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

pennylane/resource/resource.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -394,18 +394,17 @@ class CircuitSpecs:
394394
**Example**
395395
396396
>>> from pennylane.resource import SpecsResources, CircuitSpecs
397-
>>> specs = CircuitSpecs(
398-
device_name="default.qubit",
399-
num_device_wires=2,
400-
shots=Shots(1000),
401-
level="device",
402-
resources=SpecsResources(
403-
gate_types={"RX": 2, "CNOT": 1},
404-
gate_sizes={1: 2, 2: 1},
405-
measurements={"expval(PauliZ)": 1},
406-
num_allocs=2,
407-
depth=3,
408-
),
397+
>>> specs = CircuitSpecs(device_name="default.qubit",
398+
num_device_wires=2,
399+
shots=Shots(1000),
400+
level="device",
401+
resources=SpecsResources(
402+
gate_types={"RX": 2, "CNOT": 1},
403+
gate_sizes={1: 2, 2: 1},
404+
measurements={"expval(PauliZ)": 1},
405+
num_allocs=2,
406+
depth=3,
407+
),
409408
)
410409
411410
>>> print(specs.num_device_wires)

pennylane/resource/specs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ def circuit():
277277
gate_sizes={2: 1},
278278
measurements={'expval(PauliX @ PauliZ)': 1},
279279
num_allocs=2,
280-
depth=1)),
280+
depth=1),
281281
SpecsResources(gate_types={'RandomLayers': 1},
282282
gate_sizes={2: 1},
283283
measurements={'expval(PauliZ @ PauliY)': 1},
284284
num_allocs=3,
285-
depth=1))]
285+
depth=1)])
286286
"""
287287
# pylint: disable=import-outside-toplevel
288288
# Have to import locally to prevent circular imports as well as accounting for Catalyst not being installed

0 commit comments

Comments
 (0)