31 lines
740 B
Common Lisp
31 lines
740 B
Common Lisp
|
;;;; Example Bell state creation circuits
|
||
|
(in-package :cl-quantum/examples)
|
||
|
|
||
|
(defun make-bell-phi+-circuit ()
|
||
|
"Return a circuit that makes a Bell phi+ state. That is |00>+|11>."
|
||
|
(with-build-circuit
|
||
|
(:h 0)
|
||
|
(:cnot 1 0)))
|
||
|
|
||
|
(defun make-bell-phi--circuit ()
|
||
|
"Return a circuit that makes a Bell phi- state. That is |00>-|11>."
|
||
|
(with-build-circuit
|
||
|
(:h 0)
|
||
|
(:cnot 1 0)
|
||
|
(:z 1)))
|
||
|
|
||
|
(defun make-bell-psi+-circuit ()
|
||
|
"Return a circuit that makes a Bell psi+ state. That is |01>+|10>."
|
||
|
(with-build-circuit
|
||
|
(:x 1)
|
||
|
(:h 0)
|
||
|
(:cnot 1 0)))
|
||
|
|
||
|
(defun make-bell-psi--circuit ()
|
||
|
"Return a circuit that makes a Bell psi- state. That is |01>-|10>."
|
||
|
(with-build-circuit
|
||
|
(:x 1)
|
||
|
(:h 0)
|
||
|
(:cnot 1 0)
|
||
|
(:z 1)))
|