Previously, the Layer.hpp class implicitly assumed that the circuit is fully reduced, i.e., redundant gates are removed. The new behaviour is to create new layer group for a gate that is already present in the current group, i.e., to handle them in the same way as they would not commute with the current group. Hence, every gate in a group is unique with respect its type and the qubits it is operating on.
Checklist:
[x] The pull request only contains commits that are related to it.
[x] I have added appropriate tests and documentation.
[x] I have made sure that all CI jobs on GitHub pass.
[x] The pull request introduces no new warnings and follows the project's style guidelines.
Description
Previously, the
Layer.hpp
class implicitly assumed that the circuit is fully reduced, i.e., redundant gates are removed. The new behaviour is to create new layer group for a gate that is already present in the current group, i.e., to handle them in the same way as they would not commute with the current group. Hence, every gate in a group is unique with respect its type and the qubits it is operating on.Checklist: