cl-quantum/package.lisp

110 lines
2.9 KiB
Common Lisp
Raw Permalink Normal View History

(defpackage :cl-quantum/math
2024-12-08 22:06:58 -08:00
(:documentation "Basic linear algebra subroutines used to implement the
quantum operators.")
(:use :cl)
(:export #:domatrix
#:mapmatrix
2024-12-19 12:25:23 -08:00
#:matrixp
#: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
2024-12-08 22:06:58 -08:00
(:documentation "Functions for creating and applying quantum gates.")
(:use :cl :cl-quantum/math)
2024-12-08 22:06:58 -08:00
(:export #:define-constant
#:+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+
#:normal-state-p
#:normalize-state
#:nnormalize-state
#:state-bits
2024-12-08 22:06:58 -08:00
#:make-zero-state
#:make-normal-state
#:make-uniform-normal-state
#:bit-unset-index
#:bit-set-index
#:bit-probability
#:nmeasure
#:measure
#:ncollapse
#:collapse
#:make-operator
#:make-controlled-operator
2024-12-08 22:06:58 -08:00
#:make-n-toffoli-operator
#:make-n-controlled-z-operator
#:replace-state
#:apply-gate
#:napply-gate
#:apply-controlled-gate
#:napply-controlled-gate))
(defpackage :cl-quantum/circuit
2024-12-08 22:06:58 -08:00
(:documentation "High-level interface for building quantum circuits.")
(:use :cl :cl-quantum/math :cl-quantum/state)
(:export #:*circuit-measure-places*
#:*circuit-operators*
#:make-circuit
#:add-to-circuit
#:with-build-circuit
#:run-circuit))
(defpackage :cl-quantum/pprint
2024-12-08 22:06:58 -08:00
(:documentation "High-level interface for building quantum circuits.")
(:use :cl :cl-quantum/math :cl-quantum/state)
(:export #:pprint-complex
#:pprint-format-bits
#:pprint-format-linear
#:pprint-state))