{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LINE 1 "Quipper/Algorithms/USV/Simulate.hs" #-}
module Quipper.Algorithms.USV.Simulate where
import Quipper
import Quipper.Libraries.Arith
import Quipper.Libraries.Simulation
import Quipper.Algorithms.USV.USV
import Quipper.Algorithms.USV.Definitions
import Quipper.Utils.Sampling
h_test :: Int -> IO ()
h_test n = do
let h_table_n = [ "h table for n = " ++ (show n) ++ ":"
, ""
, "v h(v)_C h(v)_Q "]
++
[ (show (map integer_of_intm_unsigned w)) ++ " " ++ (show y) ++ " " ++ (show z) ++ flag
| w <- (sample_all0 (replicate n (intm (4*n) (2^(4*n)-1))))
, let y = integer_of_intm_unsigned $ h_classical w
, let z = integer_of_intm_unsigned $ (run_classical_generic h_quantum) w
, let flag = if y /= z then " **MISMATCH**" else ""]
++
["",""]
mapM putStrLn $ h_table_n
return ()