added function for creating controlled versions of arbitrary single-qubit gates

* New function `controlled_gate`
* pep8 fixes