Added function to calculate gate sequence product
Used added function to calculate gate sequence product
Removed bug from circuit.py