how to build a quantum gate