Skip to content

Latest commit

 

History

History
57 lines (52 loc) · 865 Bytes

README.md

File metadata and controls

57 lines (52 loc) · 865 Bytes

QVM-ocaml-mini

Based on Robert Smith's: A tutorial quantum interpreter in 150 lines of Lisp

$ dune exec mini_qvm
bell(0,1):
{ Quantum_state.qm_state =
  [|
    0.707106781187 + i 0.;
    0. + i 0.;
    0. + i 0.;
    0.707106781187 + i 0.;
|];
  register = 0 }

ghz(3):
{ Quantum_state.qm_state =
  [|
    0.707106781187 + i 0.;
    0. + i 0.;
    0. + i 0.;
    0. + i 0.;
    0. + i 0.;
    0. + i 0.;
    0. + i 0.;
    0.707106781187 + i 0.;
|];
  register = 0 }

qft(0,1,2):
{ Quantum_state.qm_state =
  [|
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
    0.353553390593 + i 0.;
|];
  register = 0 }

10 coin flips:
1
0
1
0
0
1
0
1
0
1
1