Automated design of quantum circuits