Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank you guys! If I want to make it more generic? Can I use UGate with the 3 Euler angles instead of R_z? Instead of H-gate (x-basis), what can I use if I want to define an arbitrary axis other than x, y or z? I understand mathematically what keisure.akira sent, but I don't know how to implement this.