Experiment
This commit is contained in:
@ -1,29 +1,29 @@
|
||||
;;;; Example Bell state creation circuits
|
||||
(in-package :cl-quantum/examples)
|
||||
|
||||
(defun make-bell-phi+-circuit ()
|
||||
(defun make-bell-phi+-circuit (bits)
|
||||
"Return a circuit that makes a Bell phi+ state. That is |00>+|11>."
|
||||
(with-build-circuit
|
||||
(with-build-circuit bits
|
||||
(:h 0)
|
||||
(:cnot 1 0)))
|
||||
|
||||
(defun make-bell-phi--circuit ()
|
||||
(defun make-bell-phi--circuit (bits)
|
||||
"Return a circuit that makes a Bell phi- state. That is |00>-|11>."
|
||||
(with-build-circuit
|
||||
(with-build-circuit bits
|
||||
(:h 0)
|
||||
(:cnot 1 0)
|
||||
(:z 1)))
|
||||
|
||||
(defun make-bell-psi+-circuit ()
|
||||
(defun make-bell-psi+-circuit (bits)
|
||||
"Return a circuit that makes a Bell psi+ state. That is |01>+|10>."
|
||||
(with-build-circuit
|
||||
(with-build-circuit bits
|
||||
(:x 1)
|
||||
(:h 0)
|
||||
(:cnot 1 0)))
|
||||
|
||||
(defun make-bell-psi--circuit ()
|
||||
(defun make-bell-psi--circuit (bits)
|
||||
"Return a circuit that makes a Bell psi- state. That is |01>-|10>."
|
||||
(with-build-circuit
|
||||
(with-build-circuit bits
|
||||
(:x 1)
|
||||
(:h 0)
|
||||
(:cnot 1 0)
|
||||
|
@ -12,7 +12,7 @@ bits and finds when the state is equal to TARGET."
|
||||
(assert (> (ash 1 bits) target)
|
||||
(bits target)
|
||||
"Target bit of ~s out of range for state with ~s bits." target bits)
|
||||
(with-build-circuit
|
||||
(with-build-circuit bits
|
||||
;; Setup
|
||||
(loop for i below bits do (:h i))
|
||||
|
||||
|
Reference in New Issue
Block a user