Skip to content

sheganinans/QVM-ocaml-mini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Simple Quantum Virtual Machine, implemented in OCaml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages