Skip to content

Commit

Permalink
also apply preprocess to diagaonalizing gates
Browse files Browse the repository at this point in the history
  • Loading branch information
lillian542 committed Sep 20, 2024
1 parent 37029a9 commit bb0b900
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pennylane/resource/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,14 @@ def specs_qnode(*args, **kwargs) -> Union[list[dict], dict]:
batch, _ = qml.workflow.construct_batch(qnode, level=level)(*args, **kwargs)

for tape in batch:

program = qml.workflow.get_transform_program(qnode, level=level)
(diag_tape,), _ = program((qml.tape.QuantumTape(tape.diagonalizing_gates, [])))

info = tape.specs.copy()

info["num_diagonalizing_gates"] = len(diag_tape.operations)

info["num_device_wires"] = len(qnode.device.wires or tape.wires)
info["num_tape_wires"] = tape.num_wires
info["device_name"] = qnode.device.name
Expand Down

0 comments on commit bb0b900

Please sign in to comment.