85 lines
2.0 KiB
Common Lisp
85 lines
2.0 KiB
Common Lisp
(defpackage :cl-quantum/math
|
|
(:use :cl)
|
|
(:export #:domatrix
|
|
#:mapmatrix
|
|
#:minor
|
|
#:cofactor
|
|
#:det
|
|
#:invert
|
|
#:transpose
|
|
#:norm
|
|
#:*mm
|
|
#:*mv
|
|
#:*vm
|
|
#:dot
|
|
#:+mm
|
|
#:+vv
|
|
#:-mm
|
|
#:-vv
|
|
#:*ms
|
|
#:*vs
|
|
#:/ms
|
|
#:/vs
|
|
#:mconj
|
|
#:vconj
|
|
#:squarep
|
|
#:singularp
|
|
#:mtrace
|
|
#:make-identity-matrix
|
|
#:copy-matrix
|
|
#:nswap-rows
|
|
#:swap-rows
|
|
#:nscale-row
|
|
#:scale-row
|
|
#:nreplace-row-with-sum
|
|
#:replace-row-with-sum
|
|
#:tensor-mm
|
|
#:tensor-vv
|
|
#:round-to-place
|
|
#:round-vector
|
|
#:round-matrix
|
|
#:count-digits
|
|
#:build-float
|
|
#:mexp
|
|
#:wholep
|
|
#:mexpt
|
|
#:matrix=
|
|
#:vector=))
|
|
|
|
(defpackage :cl-quantum/state
|
|
(:use :cl :cl-quantum/math)
|
|
(:export #:normal-state-p
|
|
#:normalize-state
|
|
#:nnormalize-state
|
|
#:state-bits
|
|
#:make-normal-state
|
|
#:make-uniform-normal-state
|
|
#:bit-unset-index
|
|
#:bit-set-index
|
|
#:bit-probability
|
|
#:nmeasure
|
|
#:measure
|
|
#:make-operator
|
|
#:make-controlled-operator
|
|
#:apply-operator
|
|
#:napply-operator
|
|
#:apply-controlled-operator
|
|
#:napply-controlled-operator
|
|
#:unset-projector
|
|
#:set-projector
|
|
#:identity-2x2
|
|
#:pauli-x-gate
|
|
#:pauli-y-gate
|
|
#:pauli-z-gate
|
|
#:hadamard-gate
|
|
#:phase-gate
|
|
#:pi/8-gate
|
|
#:cnot-gate
|
|
#:cz-gate
|
|
#:swap-gate
|
|
#:ccnot-gate))
|
|
|
|
(defpackage :cl-quantum/circuit
|
|
(:use :cl :cl-quantum/math :cl-quantum/state)
|
|
(:export))
|