Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module provides an efficient symbolic representation of the Clifford group on one qubit. This group is generated by S, H, and the scalar ω = eiπ/4. It has 192 elements.
Synopsis
- 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
- to_clifford :: a -> Clifford
- 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 = HS3ω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 ω = eiπ/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.
Instances
ToClifford Char Source # | |
Defined in Quantum.Synthesis.Clifford to_clifford :: Char -> Clifford Source # | |
ToClifford Axis Source # | |
Defined in Quantum.Synthesis.Clifford to_clifford :: Axis -> Clifford Source # | |
ToClifford Clifford Source # | |
Defined in Quantum.Synthesis.Clifford to_clifford :: Clifford -> Clifford Source # | |
ToClifford a => ToClifford [a] Source # | |
Defined in Quantum.Synthesis.Clifford to_clifford :: [a] -> Clifford Source # | |
(Ring a, Eq a, Adjoint a) => ToClifford (SO3 a) Source # | |
Defined in Quantum.Synthesis.CliffordT to_clifford :: SO3 a -> Clifford 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 = EaXbScωd,
- a ∈ {0, 1, 2}, b ∈ {0, 1}, c ∈ {0, …, 3}, and d ∈ {0, …, 7}.
Here, E = HS3ω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 = KXbScω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.