Safe Haskell | None |
---|---|
Language | Haskell2010 |
Proarrow.Category.Instance.ZX
Contents
Synopsis
- newtype Bitstring (n :: Nat) = BS Int
- split :: forall (n :: Nat) (m :: Natural). KnownNat n => Bitstring (n + m) -> (Bitstring n, Bitstring m)
- combine :: forall (n :: Nat) (m :: Nat). KnownNat n => Bitstring n -> Bitstring m -> Bitstring (n + m)
- type SparseMatrix (o :: Nat) (i :: Nat) = Map (Bitstring o, Bitstring i) (Complex Double)
- epsilon :: Double
- filterSparse :: forall (o :: Nat) (i :: Nat). SparseMatrix o i -> SparseMatrix o i
- transpose :: forall (o :: Nat) (i :: Nat). SparseMatrix o i -> SparseMatrix i o
- mirror :: forall (n :: Nat). KnownNat n => Bitstring n -> Bitstring (n + n)
- enumAll :: forall (n :: Nat). KnownNat n => [Bitstring n]
- nat :: forall (n :: Nat). KnownNat n => Int
- data ZX (i :: Nat) (o :: Nat) where
- zSpider :: forall (i :: Nat) (o :: Nat). (KnownNat i, KnownNat o) => Double -> ZX i o
- xSpider :: forall (i :: Nat) (o :: Nat). (KnownNat i, KnownNat o) => Double -> ZX i o
- cup :: forall (n :: Nat). KnownNat n => ZX 0 (n + n)
- cap :: forall (n :: Nat). KnownNat n => ZX (n + n) 0
- zCopy :: ZX 1 2
- zDisc :: ZX 1 0
- xCopy :: ZX 1 2
- xDisc :: ZX 1 0
- zeroState :: ZX 0 1
- oneState :: ZX 0 1
- plusState :: ZX 0 1
- minusState :: ZX 0 1
- not :: ZX 1 1
- cnot :: ZX 2 2
- ghzState :: ZX 0 3
- hadamard :: forall (n :: Nat). KnownNat n => ZX n n
Documentation
newtype Bitstring (n :: Nat) Source Comments #
Instances
split :: forall (n :: Nat) (m :: Natural). KnownNat n => Bitstring (n + m) -> (Bitstring n, Bitstring m) Source Comments #
Split n + m bits into two parts: the lower n bits and the higher m bits.
combine :: forall (n :: Nat) (m :: Nat). KnownNat n => Bitstring n -> Bitstring m -> Bitstring (n + m) Source Comments #
Combine two bitstrings of lengths n and m into one bitstring with the n lower bits or m higher bits.
type SparseMatrix (o :: Nat) (i :: Nat) = Map (Bitstring o, Bitstring i) (Complex Double) Source Comments #
filterSparse :: forall (o :: Nat) (i :: Nat). SparseMatrix o i -> SparseMatrix o i Source Comments #
transpose :: forall (o :: Nat) (i :: Nat). SparseMatrix o i -> SparseMatrix i o Source Comments #
data ZX (i :: Nat) (o :: Nat) where Source Comments #
Constructors
ZX :: forall (i :: Nat) (o :: Nat). (KnownNat i, KnownNat o) => SparseMatrix o i -> ZX i o |
zSpider :: forall (i :: Nat) (o :: Nat). (KnownNat i, KnownNat o) => Double -> ZX i o Source Comments #
xSpider :: forall (i :: Nat) (o :: Nat). (KnownNat i, KnownNat o) => Double -> ZX i o Source Comments #
minusState :: ZX 0 1 Source Comments #
Orphan instances
Monoidal Nat Source Comments # | |||||||||
Associated Types
Methods withOb2 :: forall (a :: Nat) (b :: Nat) r. (Ob a, Ob b) => (Ob (a ** b) => r) -> r Source Comments # leftUnitor :: forall (a :: Nat). Ob a => ((Unit :: Nat) ** a) ~> a Source Comments # leftUnitorInv :: forall (a :: Nat). Ob a => a ~> ((Unit :: Nat) ** a) Source Comments # rightUnitor :: forall (a :: Nat). Ob a => (a ** (Unit :: Nat)) ~> a Source Comments # rightUnitorInv :: forall (a :: Nat). Ob a => a ~> (a ** (Unit :: Nat)) Source Comments # associator :: forall (a :: Nat) (b :: Nat) (c :: Nat). (Ob a, Ob b, Ob c) => ((a ** b) ** c) ~> (a ** (b ** c)) Source Comments # associatorInv :: forall (a :: Nat) (b :: Nat) (c :: Nat). (Ob a, Ob b, Ob c) => (a ** (b ** c)) ~> ((a ** b) ** c) Source Comments # | |||||||||
SymMonoidal Nat Source Comments # | |||||||||
CategoryOf Nat Source Comments # | The category of qubits, to implement ZX calculus from quantum computing. | ||||||||
Associated Types
| |||||||||
CompactClosed Nat Source Comments # | |||||||||
StarAutonomous Nat Source Comments # | |||||||||
Associated Types
Methods dual :: forall (a :: Nat) (b :: Nat). (a ~> b) -> Dual b ~> Dual a Source Comments # dualInv :: forall (a :: Nat) (b :: Nat). (Ob a, Ob b) => (Dual a ~> Dual b) -> b ~> a Source Comments # linDist :: forall (a :: Nat) (b :: Nat) (c :: Nat). (Ob a, Ob b, Ob c) => ((a ** b) ~> Dual c) -> a ~> Dual (b ** c) Source Comments # linDistInv :: forall (a :: Nat) (b :: Nat) (c :: Nat). (Ob a, Ob b, Ob c) => (a ~> Dual (b ** c)) -> (a ** b) ~> Dual c Source Comments # | |||||||||
Closed Nat Source Comments # | |||||||||
Associated Types
Methods withObExp :: forall (a :: Nat) (b :: Nat) r. (Ob a, Ob b) => (Ob (a ~~> b) => r) -> r Source Comments # curry :: forall (a :: Nat) (b :: Nat) (c :: Nat). (Ob a, Ob b) => ((a ** b) ~> c) -> a ~> (b ~~> c) Source Comments # uncurry :: forall (b :: Nat) (c :: Nat) (a :: Nat). (Ob b, Ob c) => (a ~> (b ~~> c)) -> (a ** b) ~> c Source Comments # (^^^) :: forall (a :: Nat) (b :: Nat) (x :: Nat) (y :: Nat). (b ~> y) -> (x ~> a) -> (a ~~> b) ~> (x ~~> y) Source Comments # |