-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Software for exact and approximate synthesis of single qubit circuits using Clifford and T gate library. Based on ideas developed in http://arxiv.org/pdf/1212.6964.pdf. Uses number theoretic methods to find T-optimal approximations. Results of approximating single qubit rotations $R_z(\pi/2^k)$
with sqct 2.0 are available online; example of approximating $R_z(0.1)$
available here.
-
Create text file in.txt to specify the angles you wish to approximate:
#Input file specifies a list of $R_z$ rotations by angles to be approximated ANGLES #Filename with approximation results angles.txt #Minimal number of T gates to use for approximation 0 #Maximal number of T gates to use for approximation 90 # $0.1$ radians, angle will be labelled as a1 in the output file 0.1 a1 0.01 a2 0.001 a3 0.0001 a4 0.00001 a5
-
Run the following command
./sqct -G in.txt
SQCT will create two files: angles.txt
and angles.txt.title
. First file contains the approximation results, the second one specifies the names of the columns in the first file. Both files can be easily parsed with Mathematica ReadList function.
There are other types of input files that can be used. Here one more example
# Request approximation of R_z rotations by angles of the form $\pi/2^n$ for n in the interval [N0,N1)
POW2
#Filename with approximation results
out/rz3-14.txt
#Minimal number of T gates to use for approximation
0
#Maximal number of T gates to use for approximation
150
#N0
3
#N1
And the second one:
# Request approximation of R_z rotations by angles of the form $2\pi k/n$ for k in the interval [k1,k2)
UNIFORM
#Filename with approximation results
out/uni.txt
#Minimal number of T gates to use for approximation
0
#Maximal number of T gates to use for approximation
150
#n
1000
#k1
0
#k2
1000
This package is mainly interesting for getting an idea what circuit sizes one gets from using the Solovay-Kitaev algorithm and nearly naive database lookup. Currently, the methods that give polynomially smaller circuits exist and should be used instead: http://arxiv.org/pdf/1212.6253.pdf, http://arxiv.org/pdf/1212.6964.pdf.
The code is based on the results of http://arxiv.org/abs/1206.5236. It implements a version of the Solovay-Kitaev algorithm described in http://arxiv.org/abs/quant-ph/0505030.
sqctSK -E <max_sde>
The generation process requires ~5Gb of memory for max_sde = 29, ~12 GB of memory for max_sde = 30. The latter mode still can be used on a machine with 8GB of RAM and big enough swap space. On machine with 128GB of RAM max_sde can be set to 33.
16 0 0 1 0
16 0 0 1 1
16 0 0 1 2
16 0 0 1 3
16 0 0 1 4
The given example will approximate Pi/16 rotation around Z axis (0,0,1) using 0-4 iterations of the Solovay Kitaev algorithm.
sqctSK --in in.txt -C --max-sde <max_sde>
This will generate circuit files in out directory in dotQC file format and create a CSV file with the summary of approximation results. For more details on input/output file formats run
sqctSK --help in
The approximation stage requires ~2.1 GB of memory for max_sde = 30.