signe
所属分类:量子计算
开发工具:Haskell
文件大小:8864KB
下载次数:0
上传日期:2021-12-23 15:40:47
上 传 者:
sh-1993
说明: 将函数编程的力量引入量子计算
(Bringing the power of functional programming to quantum computing)
文件列表:
ChangeLog.md (45, 2021-12-21)
LICENSE (35149, 2021-12-21)
Setup.hs (46, 2021-12-21)
app (0, 2021-12-21)
app\Main.hs (61, 2021-12-21)
package.yaml (1186, 2021-12-21)
presentation.pdf (3813169, 2021-12-21)
report.pdf (3938350, 2021-12-21)
signe.cabal (1938, 2021-12-21)
src (0, 2021-12-21)
src\Frontend (0, 2021-12-21)
src\Frontend\SAST (0, 2021-12-21)
src\Frontend\SAST\Abs.hs (955, 2021-12-21)
src\Frontend\SAST\Convert.hs (5442, 2021-12-21)
src\Frontend\SAST\Par.hs (726, 2021-12-21)
src\Frontend\SAST\Print.hs (572, 2021-12-21)
src\Frontend\Signe (0, 2021-12-21)
src\Frontend\Signe\Abs.hs (2291, 2021-12-21)
src\Frontend\Signe\Doc.txt (4411, 2021-12-21)
src\Frontend\Signe\ErrM.hs (1992, 2021-12-21)
src\Frontend\Signe\Layout.hs (10077, 2021-12-21)
src\Frontend\Signe\Lex.hs (66210, 2021-12-21)
src\Frontend\Signe\Lex.x (6362, 2021-12-21)
src\Frontend\Signe\Par.hs (66197, 2021-12-21)
src\Frontend\Signe\Par.info (91294, 2021-12-21)
src\Frontend\Signe\Par.y (6694, 2021-12-21)
src\Frontend\Signe\Print.hs (7971, 2021-12-21)
src\Frontend\Signe\Skel.hs (2631, 2021-12-21)
src\Frontend\Signe\Test (4092048, 2021-12-21)
src\Frontend\Signe\Test.hs (1983, 2021-12-21)
src\Lib.hs (88, 2021-12-21)
src\Makefile (1766, 2021-12-21)
src\Signe.cf (2679, 2021-12-21)
src\Type (0, 2021-12-21)
src\Type\Check.hs (8896, 2021-12-21)
src\Type\Error.hs (697, 2021-12-21)
stack.yaml (2209, 2021-12-21)
... ...
# signe
Example code, should parse and type check.
```ocaml
dup x : a . a -> a * a
:= (x,x)
share : qubit -> qubit * qubit
:= dup
fst (x,y) : a b . (a * b) -> a
:= x
measure : qubit -> qubit
:= fst share
basis f t q : a . a -> a -> qubit -> a
:= if° q
then t
else f
H : qubit -> qubit
:= basis ~+ ~-
X : qubit -> qubit
:= basis ~1 ~0
I : qubit -> qubit
:= basis ~0 ~1
CNOT c t : qubit -> qubit -> qubit * qubit
:= if° c
then (~1, X t)
else (~0, t)
S : qubit -> qubit
:= let ~s = i * ~1
in basis ~0 ~s
T : qubit -> qubit
:= let ~e = e^(iπ/4) * ~1
in basis ~0 ~e
```
近期下载者:
相关文件:
收藏者: