Circuit.simplify should remove small rotations, but it currently only looks whether the angle is sufficiently close to 0.
If the angle somehow ends up being 2pi or 4 pi, we would also like the gate to be removed, as it is the identity operation. It is currently not the case.
remove_small_rotations should remove rotations with angles that are 0 modulo 2*pi instead of just 0.
easy test:
import numpy as np
from tangelo.linq import Gate, Circuit
c = Circuit([Gate('H',0), Gate('Rx, 0, parameter=4*np.pi)])
c.simplify
# Assert c is now just a single H gate.
Circuit.simplify should remove small rotations, but it currently only looks whether the angle is sufficiently close to 0.
If the angle somehow ends up being 2pi or 4 pi, we would also like the gate to be removed, as it is the identity operation. It is currently not the case.
remove_small_rotations should remove rotations with angles that are 0 modulo 2*pi instead of just 0.
easy test: