-
Notifications
You must be signed in to change notification settings - Fork 56
Description
from pytket.circuit import Circuit
from pytket.passes import GreedyPauliSimp
c = Circuit.from_dict(
{
"bits": [],
"commands": [],
"created_qubits": [],
"discarded_qubits": [],
"implicit_permutation": [
[["q", [0]], ["q", [1]]],
[["q", [1]], ["q", [0]]],
],
"phase": "0.0",
"qubits": [
["q", [0]],
["q", [1]],
],
}
)
GreedyPauliSimp().apply(c)
print(c.to_dict())Output:
{'bits': [], 'commands': [], 'created_qubits': [], 'discarded_qubits': [], 'implicit_permutation': [[['q', [0]], ['q', [0]]], [['q', [1]], ['q', [1]]]], 'phase': '0.0', 'qubits': [['q', [0]], ['q', [1]]]}
Note that the implicit qubit permutation in the original circuit has been undone.