1. A computer-implemented method of synthesizing a design for a target quantum operation u in a standard-quantum-gate basis, the method comprising: receiving, by the computer system, the target quantum operation u; searching, by the computer system, a database of canonical-form quantum circuits to identify a canonical-form quantum circuit from which a minimum-cost design within a distance-metric-value distance to the target quantum operation u can be generated, wherein each canonical-form quantum circuit is represented as a sequence of representations of TH and SH gates that contains no adjacent SH gates, ends in TH, and in which no SH gate occurs before the fifth gate; generating, by the computer system, the minimum cost design from the identified canonical-form quantum circuit; and storing, by the computer system, the generated minimum-cost design in one or more of an electronic memory and physical data-storage device.