packages feed

quipper-demos-0.9.0.0: dist/build/And_gate/And_gate-tmp/Quipper/Demos/And_gate.hs

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LINE 1 "Quipper/Demos/And_gate.hs" #-}
import Quipper

and_gate :: (Qubit, Qubit) -> Circ (Qubit)
and_gate (a, b) = do
  c <- qinit False
  qnot_at c `controlled` [a, b]
  return c

main =
  print_simple Preview and_gate