Skip to content

GreedyPauliSimp ignores implicit qubit permutation #2071

@cqc-alec

Description

@cqc-alec
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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions