[BUG] qml.taper is generating a tapered Hamiltonian with wires in the wrong order #6934
Open
1 task done
Labels
bug 🐛
Something isn't working
Expected behavior
qml.taper
generates a tapered Hamiltonian with wires in the same order as the original Hamiltonian.E.g. Suppose the original Hamiltonian has
wires=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
If we taper off wires 7, 9, 10, and 11, I expect the wires of the tapered Hamiltonian to be
wires=[0, 1, 2, 3, 4, 5, 6, 8]
Actual behavior
Instead we get
wires=[1, 3, 5, 6, 8, 0, 2, 4]
Additional information
This was originally identified from Forum topic 7956. When this problem is fixed please mention it in the forum thread, linking to the PR that fixed the issue.
Source code
Tracebacks
System information
Name: PennyLane Version: 0.40.0 Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network. Home-page: https://github.com/PennyLaneAI/pennylane Author: Author-email: License: Apache License 2.0 Location: /usr/local/lib/python3.11/dist-packages Requires: appdirs, autograd, autoray, cachetools, diastatic-malt, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, tomlkit, typing-extensions Required-by: PennyLane_Lightning Platform info: Linux-6.1.85+-x86_64-with-glibc2.35 Python version: 3.11.11 Numpy version: 1.26.4 Scipy version: 1.13.1 Installed devices: - default.clifford (PennyLane-0.40.0) - default.gaussian (PennyLane-0.40.0) - default.mixed (PennyLane-0.40.0) - default.qubit (PennyLane-0.40.0) - default.qutrit (PennyLane-0.40.0) - default.qutrit.mixed (PennyLane-0.40.0) - default.tensor (PennyLane-0.40.0) - null.qubit (PennyLane-0.40.0) - reference.qubit (PennyLane-0.40.0) - lightning.qubit (PennyLane_Lightning-0.40.0)
Existing GitHub issues
The text was updated successfully, but these errors were encountered: