Safe Haskell | Safe |
---|---|

Language | Haskell98 |

This module provides an efficient symbolic representation of the
Clifford group on one qubit. This group is generated by *S*, *H*,
and the scalar ω = *e*^{iπ/4}. It has 192 elements.

- data Clifford
- clifford_X :: Clifford
- clifford_Y :: Clifford
- clifford_Z :: Clifford
- clifford_H :: Clifford
- clifford_S :: Clifford
- clifford_SH :: Clifford
- clifford_E :: Clifford
- clifford_W :: Clifford
- class ToClifford a where
- clifford_decompose :: ToClifford a => a -> (Int, Int, Int, Int)
- data Axis
- clifford_decompose_coset :: ToClifford a => a -> (Axis, Int, Int, Int)
- clifford_id :: Clifford
- clifford_mult :: Clifford -> Clifford -> Clifford
- clifford_inv :: ToClifford a => a -> Clifford
- clifford_tconj :: Clifford -> (Axis, Clifford)

# The Clifford group

A type representing single-qubit Clifford operators.

## Constructors

clifford_X :: Clifford Source #

The Pauli *X*-gate as a Clifford operator.

clifford_Y :: Clifford Source #

The Pauli *Y*-gate as a Clifford operator.

clifford_Z :: Clifford Source #

The Pauli *Z*-gate as a Clifford operator.

clifford_H :: Clifford Source #

The Hadamard gate as a Clifford operator.

clifford_S :: Clifford Source #

The Clifford operator *S*.

clifford_SH :: Clifford Source #

The Clifford operator *SH*.

clifford_E :: Clifford Source #

The Clifford operator *E* = *H**S*^{3}ω^{3}. This operator is
uniquely determined by the properties *E*³ = *I*,
*EXE*⁻¹ = *Y*, *EYE*⁻¹ = *Z*, and *EZE*⁻¹ = *X*.

clifford_W :: Clifford Source #

The Clifford operator ω = *e*^{iπ/4}.

class ToClifford a where Source #

A type class for things that can be exactly converted to a
Clifford operator. One particular instance of this is `String`

, so
that Clifford operators can be denoted, e.g.,

to_clifford "-iX"

The valid characters for such string conversions are `"XYZHSEIWi-"`

.

to_clifford :: a -> Clifford Source #

Convert any suitable thing to a Clifford operator.

ToClifford Char Source # | |

ToClifford Axis Source # | |

ToClifford Clifford Source # | |

ToClifford a => ToClifford [a] Source # | |

## Deconstructors

clifford_decompose :: ToClifford a => a -> (Int, Int, Int, Int) Source #

Given a Clifford operator *U*, return (*a*, *b*, *c*, *d*) such that

*U*=*E*^{a}*X*^{b}*S*^{c}ω^{d},*a*∈ {0, 1, 2},*b*∈ {0, 1},*c*∈ {0, …, 3}, and*d*∈ {0, …, 7}.

Here, *E* = *H**S*^{3}ω^{3}. Note that *E*, *X*, *S*, and ω have order
3, 2, 4, and 8, respectively. Moreover, each Clifford operator can
be uniquely represented as above.

A axis is either *I*, *H*, or *SH*.

clifford_decompose_coset :: ToClifford a => a -> (Axis, Int, Int, Int) Source #

Given a Clifford operator *U*, return (*K*, *b*, *c*, *d*) such that

*U*=*K**X*^{b}*S*^{c}ω^{d},*K*∈ {*I*,*H*,*SH*},*b*∈ {0, 1},*c*∈ {0, …, 3}, and*d*∈ {0, …, 7}.

## Group operations

clifford_id :: Clifford Source #

The identity Clifford operator.

clifford_inv :: ToClifford a => a -> Clifford Source #

Clifford inverse.