|
This package provides an easy-to-use executable program
gridsynth that computes approximations of arbitrary
z-rotations over the Clifford+T gate set, up to
arbitrary ϵ. It achieves
T-counts that are within O(log(log(1/ϵ))) of optimal. In the
typical case, this means T-counts of
The algorithm is described in:
This package also provides a library of various algorithms for exact and approximate synthesis of quantum circuits over the Clifford+T gate set, written in Haskell. |
The purpose of the gridsynth program is to approximate a
z-rotation
\[
R_z(\theta) =
\left(\begin{array}{cc} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{array}\right)
\]
up to arbitrary ϵ. It takes one argument, which is the angle θ. The
angle can be specified symbolically, for
example "pi/128"; the program will then automatically
calculate π/128 to the required number of digits. To distinguish
negative numbers from command line options, negative angles should be
entered parenthesized and in quotes, for
example, "(-0.1)". Typical usage is like this:
$ gridsynth pi/128
SHTHTHTHTHTHTHTSHTHTHTHTSHTHTHTHTHTSHTSHTHTHTHTHTSHTHTHTSHTSHTHTSHTSHTSHTHTHTHTS
HTHTHTHTHTSHTSHTHTSHTHTSHTSHTSHTSHTHTSHTSHTSHTSHTHTHTSHTSHTSHTHTHTHTSHTHTSHTHTHT
SHTHTHTHTSHTHTSHTHTSHTSHTSHTHTHTHTHTHTHTSHTHTSHTHTHTSHTSHTHTHTSHTSHTSHTHTSHTHTHT
HTSHTSHTSHSSSWWWWWWW
Here, "T", "S", "H", and "X" denote the usual quantum gates of the
same names, and "W" denotes the scalar
The default value for the precision is 10 decimal digits,
i.e.,
$ gridsynth pi/1024 -d 100
You can see the output here.
Note on phases: By default, gridsynth approximates the given
z-rotation on the nose, i.e., not up to a phase. So if you give
the angle θ = π/4, you will not get a single T-gate. Instead,
you will get an approximation of
\[
R_z({\pi}/{4}) =
\left(\begin{array}{cc} e^{-i\pi/8} & 0 \\ 0 & e^{i\pi/8} \end{array}\right),
\]
which is not the same as
\[
T = \left(\begin{array}{cc} 1 & 0 \\ 0 & \omega \end{array}\right).
\]
If you would like the approximation to be up to a phase, you must
specify the Here is the full list of command line options: Usage: gridsynth [OPTION...] |
The synthesis library includes implementations of a number of
algorithms for approximate and exact synthesis over the
Clifford+T gate set, but for single-qubit and multi-qubit
quantum circuits. Currently, the following algorithms are provided:
|
| The library is fully documented; please see the browseable online documentation. |
|
There are several options for downloading and installing the
newsynth package.
|
| For bug reports or support requests, please email me at selinger@mathstat.dal.ca. |
|
| 0.3.0.4 |
|
Peter Selinger Neil J. Ross |
|
Copyright (c) 2012-2018 Peter Selinger and Neil J. Ross.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. |
To Peter Selinger's other Software.
Back to Peter Selinger's Homepage: