Safe Haskell | None |
---|---|
Language | Haskell98 |
This module provides backward compatibility with older versions of the newsynth package. Formerly, it contained an implementation of the single-qubit Clifford+T approximation algorithm of
- Peter Selinger. Efficient Clifford+T approximation of single-qubit operators. http://arxiv.org/abs/1212.6253.
Since the new algorithm in Quantum.Synthesis.GridSynth is better in all cases, we now simply provide a compatible interface to that algorithm.
New software should not use this module, and it may eventually be removed.
Documentation
newsynth :: RandomGen g => Double -> SymReal -> g -> U2 DOmega Source #
Backward compatible interface to the approximate synthesis algorithm. The parameters are:
- an angle θ, to implement a Rsub /z/ = e−iθZ/2 gate;
- a precision b ≥ 0 in bits, such that ε = 2-b;
- a source of randomness g.
Output a unitary operator in the Clifford+T group that
approximates Rsub /z/ to within ε in the operator norm. This
operator can then be converted to a list of gates with
to_gates
.
Note: the argument theta is given as a symbolic real number. It
will automatically be expanded to as many digits as are necessary
for the internal calculation. In this way, the caller can specify,
e.g., an angle of pi
/128 ::
SymReal
, without having to worry
about how many digits of π to specify.
newsynth_stats :: RandomGen g => Double -> SymReal -> g -> (U2 DOmega, Maybe Double, Integer) Source #