This is the qvm Reference Manual, version 1.17.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Fri Sep 15 06:26:55 2023 GMT+0.
qvm/qvm.asd
qvm/package.lisp
qvm/grovel-system-constants.lisp
qvm/grovel-shared-memory.lisp
qvm/config.lisp
qvm/impl/allegro.lisp
qvm/impl/clozure.lisp
qvm/impl/sbcl.lisp
qvm/impl/sbcl-intrinsics.lisp
qvm/impl/sbcl-avx-vops.lisp
qvm/impl/sbcl-x86-vops.lisp
qvm/impl/linear-algebra-intrinsics.lisp
qvm/impl/prefetch-intrinsics.lisp
qvm/impl/lispworks.lisp
qvm/utilities.lisp
qvm/floats.lisp
qvm/allocator.lisp
qvm/shm.lisp
qvm/linear-algebra.lisp
qvm/qam.lisp
qvm/classical-memory.lisp
qvm/classical-memory-mixin.lisp
qvm/serial-kernels.lisp
qvm/wavefunction.lisp
qvm/subsystem.lisp
qvm/state-representation.lisp
qvm/qvm.lisp
qvm/mixed-state-qvm.lisp
qvm/compile-gate.lisp
qvm/apply-gate.lisp
qvm/measurement.lisp
qvm/transition.lisp
qvm/transition-classical-instructions.lisp
qvm/stabilizer-qvm.lisp
qvm/execution.lisp
qvm/path-simulate.lisp
qvm/misc.lisp
qvm/noise-models.lisp
qvm/channel-qvm.lisp
qvm/basic-noise-qvm.lisp
qvm/density-qvm.lisp
qvm/noisy-qvm.lisp
qvm/depolarizing-noise.lisp
The main system appears first, followed by any subsystem dependency.
qvm
An implementation of the Quantum Abstract Machine.
Robert Smith <robert@rigetti.com>
Apache License 2.0 (See LICENSE.txt)
1.17.2
cffi-grovel
(system).
alexandria
(system).
abstract-classes
(system).
ieee-floats
(system).
lparallel
(system).
magicl
(system)., at least version "0.7.0"
trivial-garbage
(system).
global-vars
(system).
cffi
(system).
static-vectors
(system)., at least version "1.8.3"
trivial-garbage
(system).
cl-quil
(system)., at least version "1.17.0"
mt19937
(system).
sb-introspect
(system).
trivial-features
(system).
package.lisp
(file).
grovel-system-constants.lisp
(file).
grovel-shared-memory.lisp
(file).
config.lisp
(file).
impl/allegro.lisp
(file).
impl/clozure.lisp
(file).
impl/sbcl.lisp
(file).
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl-avx-vops.lisp
(file).
impl/sbcl-x86-vops.lisp
(file).
impl/linear-algebra-intrinsics.lisp
(file).
impl/prefetch-intrinsics.lisp
(file).
impl/lispworks.lisp
(file).
utilities.lisp
(file).
floats.lisp
(file).
allocator.lisp
(file).
shm.lisp
(file).
linear-algebra.lisp
(file).
qam.lisp
(file).
classical-memory.lisp
(file).
classical-memory-mixin.lisp
(file).
serial-kernels.lisp
(file).
wavefunction.lisp
(file).
subsystem.lisp
(file).
state-representation.lisp
(file).
qvm.lisp
(file).
mixed-state-qvm.lisp
(file).
compile-gate.lisp
(file).
apply-gate.lisp
(file).
measurement.lisp
(file).
transition.lisp
(file).
transition-classical-instructions.lisp
(file).
stabilizer-qvm.lisp
(file).
execution.lisp
(file).
path-simulate.lisp
(file).
misc.lisp
(file).
noise-models.lisp
(file).
channel-qvm.lisp
(file).
basic-noise-qvm.lisp
(file).
density-qvm.lisp
(file).
noisy-qvm.lisp
(file).
depolarizing-noise.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
qvm/qvm.asd
qvm/package.lisp
qvm/grovel-system-constants.lisp
qvm/grovel-shared-memory.lisp
qvm/config.lisp
qvm/impl/allegro.lisp
qvm/impl/clozure.lisp
qvm/impl/sbcl.lisp
qvm/impl/sbcl-intrinsics.lisp
qvm/impl/sbcl-avx-vops.lisp
qvm/impl/sbcl-x86-vops.lisp
qvm/impl/linear-algebra-intrinsics.lisp
qvm/impl/prefetch-intrinsics.lisp
qvm/impl/lispworks.lisp
qvm/utilities.lisp
qvm/floats.lisp
qvm/allocator.lisp
qvm/shm.lisp
qvm/linear-algebra.lisp
qvm/qam.lisp
qvm/classical-memory.lisp
qvm/classical-memory-mixin.lisp
qvm/serial-kernels.lisp
qvm/wavefunction.lisp
qvm/subsystem.lisp
qvm/state-representation.lisp
qvm/qvm.lisp
qvm/mixed-state-qvm.lisp
qvm/compile-gate.lisp
qvm/apply-gate.lisp
qvm/measurement.lisp
qvm/transition.lisp
qvm/transition-classical-instructions.lisp
qvm/stabilizer-qvm.lisp
qvm/execution.lisp
qvm/path-simulate.lisp
qvm/misc.lisp
qvm/noise-models.lisp
qvm/channel-qvm.lisp
qvm/basic-noise-qvm.lisp
qvm/density-qvm.lisp
qvm/noisy-qvm.lisp
qvm/depolarizing-noise.lisp
qvm/grovel-system-constants.lisp
:unix
package.lisp
(file).
qvm
(system).
qvm/config.lisp
grovel-shared-memory.lisp
(file).
grovel-system-constants.lisp
(file).
package.lisp
(file).
qvm
(system).
*compile-before-running*
(special variable).
*qubits-required-for-parallelization*
(special variable).
*transition-verbose*
(special variable).
parallelization-limit
(type).
*compile-measure-chains*
(special variable).
*fuse-gates-during-compilation*
(special variable).
*inline-static-gates-during-compilation*
(special variable).
*optimize-briskly*
(special variable).
*optimize-dangerously-fast*
(special variable).
*optimize-safely*
(special variable).
*qubit-limit-for-using-serial-kernels*
(special variable).
enable-all-qvm-optimizations
(function).
qubit-limit-for-using-serial-kernels
(function).
qvm/impl/allegro.lisp
:allegro
config.lisp
(file).
qvm
(system).
qvm/impl/clozure.lisp
:clozure
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/impl/sbcl.lisp
:sbcl
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
call-at-exit
(function).
shm-vector-allocation-size
(function).
shm-vector-from-pointer
(function).
shm-vector-header-size
(function).
qvm/impl/sbcl-intrinsics.lisp
(:and :sbcl :qvm-intrinsics)
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/impl/sbcl-avx-vops.lisp
(:and :sbcl :qvm-intrinsics :avx2)
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/impl/sbcl-x86-vops.lisp
(:and :sbcl :qvm-intrinsics)
impl/sbcl-avx-vops.lisp
(file).
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/impl/linear-algebra-intrinsics.lisp
:qvm-intrinsics
impl/sbcl-x86-vops.lisp
(file).
impl/sbcl-avx-vops.lisp
(file).
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/impl/prefetch-intrinsics.lisp
:qvm-intrinsics
impl/linear-algebra-intrinsics.lisp
(file).
impl/sbcl-x86-vops.lisp
(file).
impl/sbcl-avx-vops.lisp
(file).
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/impl/lispworks.lisp
:lispworks
impl/prefetch-intrinsics.lisp
(file).
impl/linear-algebra-intrinsics.lisp
(file).
impl/sbcl-x86-vops.lisp
(file).
impl/sbcl-avx-vops.lisp
(file).
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
qvm/utilities.lisp
impl/lispworks.lisp
(file).
impl/prefetch-intrinsics.lisp
(file).
impl/linear-algebra-intrinsics.lisp
(file).
impl/sbcl-x86-vops.lisp
(file).
impl/sbcl-avx-vops.lisp
(file).
impl/sbcl-intrinsics.lisp
(file).
impl/sbcl.lisp
(file).
impl/clozure.lisp
(file).
impl/allegro.lisp
(file).
config.lisp
(file).
qvm
(system).
boolean-bit
(function).
count-logical-cores
(function).
defun-inlinable
(macro).
pdotimes
(macro).
prepare-for-parallelization
(function).
psum-dotimes
(macro).
seeded-random-state
(function).
with-random-state
(macro).
%make-nat-tuple
(function).
+max-nat-tuple-cardinality+
(constant).
copy-hash-table
(function).
do-nat-tuple
(macro).
eject-bit
(function).
eject-bit-code
(function).
gray-bit
(function).
gray-encode
(function).
half
(function).
initialize-random-state
(function).
inject-bit
(function).
inject-bit-code
(function).
map-subdivisions
(function).
measuring-gc
(macro).
nat-tuple
(function).
nat-tuple
(type).
nat-tuple-cardinality
(function).
nat-tuple-cardinality
(type).
nat-tuple-complement
(function).
nat-tuple-element
(type).
nat-tuple-position
(function).
nat-tuple-ref
(function).
power-of-two-p
(function).
probabilistically
(macro).
round-up-to-next-multiple
(function).
subdivide
(function).
sum-dotimes
(macro).
sysconf
(function).
with-parallel-subdivisions
(macro).
qvm/floats.lisp
utilities.lisp
(file).
qvm
(system).
+octets-per-cflonum+
(constant).
+octets-per-flonum+
(constant).
cflonum-vector
(type).
flonum-vector
(type).
qvm/allocator.lisp
floats.lisp
(file).
qvm
(system).
allocate-vector
(generic function).
allocation-length
(generic reader).
c-allocation
(class).
lisp-allocation
(class).
posix-shared-memory-allocation
(class).
allocation-name
(reader method).
dummy-finalizer
(function).
finalizer
(type).
make-lisp-cflonum-vector
(function).
qvm/shm.lisp
:unix
allocator.lisp
(file).
qvm
(system).
allocate-vector
(method).
%close
(function).
%ftruncate
(function).
%make-shared-memory
(function).
%mmap
(function).
%munmap
(function).
%strerror
(function).
copy-posix-shared-memory
(function).
deallocate-all-shared-memories
(function).
free-posix-shared-memory
(function).
getpagesize
(function).
make-posix-shared-memory
(function).
make-shared-array
(function).
make-vector-from-pointer
(function).
posix-shared-memory
(structure).
posix-shared-memory-finalizer
(function).
posix-shared-memory-name
(reader).
(setf posix-shared-memory-name)
(writer).
posix-shared-memory-p
(function).
posix-shared-memory-pointer
(reader).
(setf posix-shared-memory-pointer)
(writer).
posix-shared-memory-size
(reader).
(setf posix-shared-memory-size)
(writer).
round-to-next-page
(function).
shm-open
(macro).
shm-unlink
(function).
simple-array-allocation-size
(function).
qvm/linear-algebra.lisp
shm.lisp
(file).
allocator.lisp
(file).
qvm
(system).
magicl-matrix-to-quantum-operator
(function).
make-load-form
(method).
make-load-form
(method).
make-matrix
(function).
octets-required-for-quantum-state
(function).
octets-required-for-qubits
(function).
print-object
(method).
print-object
(method).
quantum-operator
(type).
quantum-state
(type).
compose-operators
(function).
conjugate-entrywise
(generic function).
dagger
(function).
define-matmul
(macro).
ensure-superoperator
(function).
kraus-list
(function).
kraus-list
(structure).
kraus-list%0
(reader).
kronecker-multiply
(function).
matmul2
(function).
matmul4
(function).
matmul8
(function).
matrix-multiply
(function).
matrix-multiply-code
(function).
outer-multiply
(function).
psum
(function).
single-kraus
(function).
single-kraus
(structure).
single-kraus%0
(reader).
superoperator
(structure).
superoperator-to-component-matrices
(function).
tr
(function).
qvm/qam.lisp
linear-algebra.lisp
(file).
qvm
(system).
measure
(generic function).
measure-all
(generic function).
number-of-qubits
(generic function).
run
(generic function).
compile-loaded-program
(generic function).
measure-and-store
(function).
reset-quantum-state
(generic function).
qvm/classical-memory.lisp
qam.lisp
(file).
qvm
(system).
classical-memory
(structure).
classical-memory-subsystem
(class).
initialize-instance
(method).
make-classical-memory
(function).
make-load-form
(method).
memory-bit-ref
(function).
(setf memory-bit-ref)
(function).
memory-descriptors-to-qvm-memory-model
(function).
memory-index-out-of-bounds
(condition).
memory-integer-ref
(function).
(setf memory-integer-ref)
(function).
memory-octet-ref
(function).
(setf memory-octet-ref)
(function).
memory-real-ref
(function).
(setf memory-real-ref)
(function).
memory-size
(reader).
print-object
(method).
print-object
(method).
quil-bit
(type).
quil-octet
(type).
qvm-integer
(type).
qvm-real
(type).
zero-out-classical-memory
(function).
%make-classical-memory
(function).
allocate-memory-for-model
(function).
assert-in-bounds
(function).
barf-memory
(function).
check-classical-memory-bounds
(function).
classical-memories
(reader method).
classical-memory-model
(reader method).
classical-memory-p
(function).
copy-memory-view
(function).
memory-pointer
(reader).
memory-view
(function).
memory-view
(structure).
memory-view-aliasing-classical-memory
(reader).
memory-view-classical-memory
(function).
memory-view-length
(reader).
memory-view-p
(function).
memory-view-reader
(reader).
memory-view-ref
(function).
(setf memory-view-ref)
(function).
memory-view-root-classical-memory
(reader).
memory-view-writer
(reader).
oob-from
(reader method).
oob-index
(reader method).
oob-name
(reader method).
oob-to
(reader method).
quil-name
(function).
root-memory-view-p
(function).
size-of
(function).
slurp-memory
(function).
typed-reader/writer
(function).
qvm/classical-memory-mixin.lisp
classical-memory.lisp
(file).
qvm
(system).
classical-memory-mixin
(class).
classical-memory-subsystem
(reader method).
load-program
(function).
memory-ref
(function).
(setf memory-ref)
(function).
classical-memories
(method).
classical-memory-model
(method).
current-instruction
(function).
dereference-mref
(function).
(setf dereference-mref)
(function).
gate-definitions
(reader method).
(setf gate-definitions)
(writer method).
install-gates
(function).
loaded-program-length
(function).
lookup-gate
(function).
pc
(reader method).
(setf pc)
(writer method).
program
(reader method).
(setf program)
(writer method).
reset-classical-memory
(function).
wait-function
(reader method).
warning-wait-function
(function).
qvm/serial-kernels.lisp
classical-memory-mixin.lisp
(file).
qvm
(system).
*available-kernels*
(special variable).
apply-1q-operator
(function).
apply-2q-operator
(function).
apply-3q-operator
(function).
define-serial-kernel
(macro).
find-serial-kernel
(function).
qvm/wavefunction.lisp
serial-kernels.lisp
(file).
qvm
(system).
amplitude-address
(type).
apply-matrix-operator
(function).
apply-operator
(function).
copy-wavefunction
(function).
normalize-wavefunction
(function).
probability
(function).
wavefunction-excited-state-probability
(function).
wavefunction-ground-state-probability
(function).
wf
(function).
%serial-norm
(function).
bring-to-zero-state
(function).
cumulative-distribution-function
(function).
extract-amplitudes
(function).
gaussian-random-complex
(function).
index-to-address
(function).
insert-amplitudes
(function).
map-complement
(function).
map-complement-in-parallel
(function).
map-complement-in-parallel-truly
(function).
map-reordered-amplitudes
(function).
map-reordered-amplitudes-in-parallel
(function).
map-reordered-amplitudes-in-parallel-truly
(function).
norm
(function).
randomize-wavefunction
(function).
set-qubit-components-of-amplitude-address
(function).
wavefunction-qubits
(function).
with-modified-amplitudes
(macro).
qvm/subsystem.lisp
wavefunction.lisp
(file).
qvm
(system).
print-object
(method).
%collapse-integer-by-mask
(function).
copy-subsystem
(function).
eject-qubit-from-subsystem
(function).
join-subsystems
(function).
make-subsystem
(function).
make-subsystem-on-qubits
(function).
subsystem
(structure).
subsystem-contains-qubit-p
(function).
subsystem-contains-qubits-p
(function).
subsystem-num-qubits
(function).
subsystem-physical-to-logical-qubit
(function).
subsystem-qubits
(reader).
subsystem-state
(reader).
subsystemp
(function).
qvm/state-representation.lisp
subsystem.lisp
(file).
qvm
(system).
density-matrix-state
(class).
initialize-instance
(method).
initialize-instance
(method).
make-density-matrix-state
(function).
make-pure-state
(function).
pure-state
(class).
set-to-zero-state
(generic function).
state-elements
(generic function).
(setf state-elements)
(method).
(setf state-elements)
(method).
%trial-amplitudes
(reader method).
(setf %trial-amplitudes)
(writer method).
allocation
(reader method).
amplitudes
(reader method).
(setf amplitudes)
(writer method).
check-allocate-computation-space
(method).
check-allocate-computation-space
(method).
density-matrix-state-measurement-probabilities
(function).
elements-vector
(reader method).
(setf elements-vector)
(writer method).
(setf elements-vector)
(method).
matrix-view
(reader method).
num-qubits
(generic function).
original-amplitudes
(reader method).
quantum-system-state
(class).
requires-swapping-amps-p
(generic function).
swap-internal-amplitude-pointers
(generic function).
temporary-state
(reader method).
(setf temporary-state)
(writer method).
qvm/qvm.lisp
state-representation.lisp
(file).
qvm
(system).
initialize-instance
(method).
initialize-instance
(method).
make-qvm
(function).
map-amplitudes
(function).
nth-amplitude
(function).
(setf nth-amplitude)
(function).
number-of-qubits
(reader method).
pure-state-qvm
(class).
qubit-probability
(function).
%set-state
(writer method).
%set-state
(writer method).
amplitudes
(method).
(setf amplitudes)
(method).
base-qvm
(class).
check-superoperators
(function).
compile-loaded-program
(method).
program-compiled-p
(reader method).
(setf program-compiled-p)
(writer method).
reset-quantum-state
(method).
set-superoperator
(method).
state
(reader method).
state
(reader method).
superoperator-definitions
(reader method).
(setf superoperator-definitions)
(writer method).
qvm/mixed-state-qvm.lisp
qvm.lisp
(file).
qvm
(system).
initialize-instance
(method).
%set-state
(writer method).
compile-instruction
(method).
compile-loaded-program
(method).
full-density-number-of-qubits
(function).
make-mixed-state-qvm
(function).
mixed-state-qvm
(class).
mixed-state-qvm-measurement-probabilities
(function).
state
(reader method).
qvm/compile-gate.lisp
mixed-state-qvm.lisp
(file).
qvm
(system).
measure-all
(class).
warm-apply-matrix-operator-cache
(function).
%max-qubit
(method).
bit=
(function).
compile-instruction
(generic function).
compile-lambda
(function).
compile-measure-chains
(function).
compile-operator
(generic function).
compiled-gate-application
(class).
compiled-gate-apply-operator
(reader method).
compiled-inlined-matrix-gate-application
(class).
compiled-instruction
(class).
compiled-matrix
(reader method).
compiled-matrix
(reader method).
compiled-matrix-gate-application
(class).
compiled-measurement
(class).
compiled-permutation-gate-application
(class).
find-measure-chains
(function).
find-or-make-apply-matrix-operator-function
(function).
find-or-make-projector-operator-function
(function).
generate-amplitude-address-code
(function).
generate-complement-iteration
(function).
generate-extraction-code
(function).
generate-gate-application-code
(function).
generate-gate-application-code-with-matrix
(function).
generate-inner-matrix-multiply-code
(function).
generate-permutation-gate-application-code
(function).
generate-permutation-gate-code
(function).
generate-single-qubit-measurement-code
(function).
measure-all-storage
(reader method).
measure-chain-at
(function).
measure-chain-to-instruction
(function).
permutation-to-transpositions
(function).
print-instruction-generic
(method).
print-instruction-generic
(method).
projector-operator
(reader method).
pull-teeth-to-get-a-gate
(function).
source-gate
(reader method).
source-instruction
(reader method).
(setf source-instruction)
(writer method).
qvm/apply-gate.lisp
compile-gate.lisp
(file).
qvm
(system).
apply-gate-to-state
(generic function).
%evolve-density-matrix-with-superoperator
(function).
%evolve-pure-state-stochastically
(function).
convert-to-kraus-list
(function).
qvm/measurement.lisp
apply-gate.lisp
(file).
qvm
(system).
force-measurement
(generic function).
measure
(method).
measure-all
(method).
apply-measure-discard-to-state
(method).
apply-measure-discard-to-state
(method).
get-excited-state-probability
(generic function).
measure-all-state
(generic function).
midpoint
(function).
naive-measure-all
(function).
perturb-measured-bits
(function).
sample-wavefunction-as-distribution
(function).
sample-wavefunction-as-distribution-in-parallel
(function).
sample-wavefunction-as-distribution-in-parallel-truly
(function).
sample-wavefunction-multiple-times
(function).
qvm/transition.lisp
measurement.lisp
(file).
qvm
(system).
invalid-instruction
(reader method).
invalid-instruction-encountered
(condition).
invalid-reason
(reader method).
transition
(generic function).
force-parameter
(function).
qvm/transition-classical-instructions.lisp
transition.lisp
(file).
qvm
(system).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
%perform-and
(function).
%perform-integer-add
(function).
%perform-integer-div
(function).
%perform-integer-mul
(function).
%perform-integer-sub
(function).
%perform-ior
(function).
%perform-move
(function).
%perform-real-add
(function).
%perform-real-div
(function).
%perform-real-mul
(function).
%perform-real-sub
(function).
%perform-xor
(function).
define-binary-transition
(macro).
define-direct-comparator
(macro).
define-indirect-comparator
(macro).
ensure-s64
(function).
ensure-signed-integer
(function).
qvm/stabilizer-qvm.lisp
qvm
(system).
measure
(method).
number-of-qubits
(method).
print-object
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
transition
(method).
clifford-application
(class).
clifford-application-clifford
(reader method).
compile-clifford
(function).
gate-application-to-clifford
(function).
make-clifford-application
(function).
make-stabilizer-qvm
(function).
print-instruction-generic
(method).
random-clifford-program
(function).
random-qubits
(function).
random-range
(function).
stabilizer-qvm
(class).
stabilizer-qvm-tableau
(reader method).
qvm/execution.lisp
stabilizer-qvm.lisp
(file).
qvm
(system).
run
(method).
run
(method).
run
(method).
run-program
(function).
nop-count
(function).
qvm/path-simulate.lisp
execution.lisp
(file).
qvm
(system).
path-simulate
(function).
wavefunction-from-path-simulation
(function).
list-classical-states
(function).
map-classical-state
(function).
qvm/misc.lisp
path-simulate.lisp
(file).
qvm
(system).
program-matrix
(function).
qvm/noise-models.lisp
misc.lisp
(file).
qvm
(system).
add-noise-models
(function).
initialize-instance
(method).
initialize-instance
(method).
make-noise-model
(function).
make-noise-predicate
(function).
make-noise-rule
(function).
match-all-gates
(function).
match-all-nq-gates
(function).
match-any-gates
(function).
match-any-n-qubits
(function).
match-instr-idxs
(function).
match-measure
(function).
match-measure-at-any
(function).
match-measure-at-strict
(function).
match-strict-gate
(function).
match-strict-qubits
(function).
multiply-noise-models
(function).
name
(reader method).
noise-model
(class).
noise-position
(reader method).
noise-position
(type).
noise-predicate
(reader method).
(setf noise-predicate)
(writer method).
noise-predicate
(class).
noise-rule
(class).
noise-rules
(reader method).
(setf noise-rules)
(writer method).
predicate-and
(function).
predicate-function
(reader method).
predicate-not
(method).
predicate-or
(function).
priority
(reader method).
+default-noise-predicate-name+
(constant).
+maxpriority+
(constant).
+minpriority+
(constant).
and-predicate-names
(function).
noise-priority
(type).
not-predicate-name
(function).
operation-elements
(reader method).
or-predicate-names
(function).
(setf qubit-povm)
(function).
readout-povms
(reader method).
(setf readout-povms)
(writer method).
rule-priority>=
(function).
qvm/channel-qvm.lisp
noise-models.lisp
(file).
qvm
(system).
channel-qvm
(class).
initialize-instance
(method).
noise-model
(reader method).
(setf noise-model)
(writer method).
transition
(method).
transition
(method).
transition
(method).
%corrupt-qvm-memory-with-povm
(function).
apply-all-kraus-maps
(generic function).
apply-classical-readout-noise
(generic function).
apply-kraus-map
(generic function).
check-all-kraus-ops
(function).
check-all-povms
(function).
check-kraus-ops
(function).
check-povm
(function).
compile-instruction
(method).
compile-loaded-program
(method).
find-matching-rule
(function).
measure-all-state
(method).
measure-all-state
(method).
perturb-measurement
(function).
rule-matches-instr-p
(function).
qvm/basic-noise-qvm.lisp
channel-qvm.lisp
(file).
qvm
(system).
basic-noise-qvm
(class).
damping-kraus-map
(function).
dephasing-kraus-map
(function).
depolarizing-kraus-map
(function).
initialize-instance
(method).
kraus-kron
(function).
probability
(type).
run
(method).
tphi
(function).
transition
(method).
transition
(method).
%check-depol-entry
(function).
%check-noise-entry
(function).
%check-povm-entry
(function).
apply-all-kraus-maps
(method).
apply-classical-readout-noise
(method).
apply-classical-readout-noise
(method).
apply-classical-readout-noise
(method).
avg-gate-time
(reader method).
calculate-dephasing-map
(function).
depolarization-ops
(reader method).
(setf depolarization-ops)
(writer method).
elapsed-time
(reader method).
(setf elapsed-time)
(writer method).
generate-kraus-ops
(function).
measure-all-state
(method).
measure-all-state
(method).
(setf qubit-depolarization)
(function).
(setf qubit-fro)
(function).
(setf qubit-t1)
(function).
(setf qubit-t2)
(function).
(setf qubit-tphi)
(function).
readout-povms
(reader method).
(setf readout-povms)
(writer method).
t1-vals
(reader method).
(setf t1-vals)
(writer method).
t2-vals
(reader method).
(setf t2-vals)
(writer method).
tphi-vals
(reader method).
(setf tphi-vals)
(writer method).
valid-noise-value
(type).
qvm/density-qvm.lisp
basic-noise-qvm.lisp
(file).
qvm
(system).
density-qvm
(class).
initialize-instance
(method).
make-density-qvm
(function).
measure-all
(method).
set-noisy-gate
(generic function).
transition
(method).
transition
(method).
amplitudes
(method).
(setf amplitudes)
(method).
apply-classical-readout-noise
(method).
apply-classical-readout-noise
(method).
compile-instruction
(method).
compile-loaded-program
(method).
density-operator-matrix-view
(type).
density-qvm-measurement-probabilities
(function).
noisy-gate-definitions
(reader method).
(setf noisy-gate-definitions)
(writer method).
readout-povms
(reader method).
(setf readout-povms)
(writer method).
reset-quantum-state
(method).
set-readout-povm
(generic function).
qvm/noisy-qvm.lisp
density-qvm.lisp
(file).
qvm
(system).
initialize-instance
(method).
make-pauli-noise-map
(function).
measure-all
(method).
noisy-qvm
(class).
set-noisy-gate
(method).
transition
(method).
transition
(method).
%trial-amplitudes
(method).
amplitudes
(method).
(setf amplitudes)
(method).
apply-classical-readout-noise
(method).
apply-classical-readout-noise
(method).
apply-classical-readout-noise
(method).
compile-instruction
(method).
compile-loaded-program
(method).
make-pauli-perturbed-1q-gate
(function).
noisy-gate-definitions
(reader method).
(setf noisy-gate-definitions)
(writer method).
readout-povms
(reader method).
(setf readout-povms)
(writer method).
set-readout-povm
(method).
qvm/depolarizing-noise.lisp
noisy-qvm.lisp
(file).
qvm
(system).
depolarizing-qvm
(class).
transition
(method).
transition
(method).
transition
(method).
add-depolarizing-noise
(function).
compile-loaded-program
(method).
probability-gate-x
(reader method).
(setf probability-gate-x)
(writer method).
probability-gate-y
(reader method).
(setf probability-gate-y)
(writer method).
probability-gate-z
(reader method).
(setf probability-gate-z)
(writer method).
probability-measure-x
(reader method).
(setf probability-measure-x)
(writer method).
probability-measure-y
(reader method).
(setf probability-measure-y)
(writer method).
probability-measure-z
(reader method).
(setf probability-measure-z)
(writer method).
Packages are listed by definition order.
qvm
Package containing an implementation of a quantum virtual machine.
common-lisp
.
org.tfeb.hax.abstract-classes
.
*compile-before-running*
(special variable).
*qubits-required-for-parallelization*
(special variable).
*transition-verbose*
(special variable).
add-noise-models
(function).
allocate-vector
(generic function).
allocation-length
(generic reader).
amplitude-address
(type).
apply-gate-to-state
(generic function).
apply-matrix-operator
(function).
apply-operator
(function).
basic-noise-qvm
(class).
boolean-bit
(function).
c-allocation
(class).
cflonum
(compiler macro).
cflonum
(function).
cflonum
(type).
channel-qvm
(class).
classical-memory
(structure).
classical-memory-mixin
(class).
classical-memory-subsystem
(generic reader).
classical-memory-subsystem
(class).
copy-wavefunction
(function).
count-logical-cores
(function).
damping-kraus-map
(function).
defun-inlinable
(macro).
density-matrix-state
(class).
density-qvm
(class).
dephasing-kraus-map
(function).
depolarizing-kraus-map
(function).
depolarizing-qvm
(class).
flonum
(compiler macro).
flonum
(function).
flonum
(type).
force-measurement
(generic function).
invalid-instruction
(generic reader).
invalid-instruction-encountered
(condition).
invalid-reason
(generic reader).
kraus-kron
(function).
lisp-allocation
(class).
load-program
(function).
magicl-matrix-to-quantum-operator
(function).
make-classical-memory
(function).
make-density-matrix-state
(function).
make-density-qvm
(function).
make-matrix
(function).
make-noise-model
(function).
make-noise-predicate
(function).
make-noise-rule
(function).
make-pauli-noise-map
(function).
make-pure-state
(function).
make-qvm
(function).
map-amplitudes
(function).
match-all-gates
(function).
match-all-nq-gates
(function).
match-any-gates
(function).
match-any-n-qubits
(function).
match-instr-idxs
(function).
match-measure
(function).
match-measure-at-any
(function).
match-measure-at-strict
(function).
match-strict-gate
(function).
match-strict-qubits
(function).
measure
(generic function).
measure-all
(generic function).
measure-all
(class).
memory-bit-ref
(function).
(setf memory-bit-ref)
(function).
memory-descriptors-to-qvm-memory-model
(function).
memory-index-out-of-bounds
(condition).
memory-integer-ref
(function).
(setf memory-integer-ref)
(function).
memory-octet-ref
(function).
(setf memory-octet-ref)
(function).
memory-real-ref
(function).
(setf memory-real-ref)
(function).
memory-ref
(function).
(setf memory-ref)
(function).
memory-size
(reader).
multiply-noise-models
(function).
name
(generic reader).
noise-model
(generic reader).
(setf noise-model)
(generic writer).
noise-model
(class).
noise-position
(generic reader).
noise-position
(type).
noise-predicate
(generic reader).
(setf noise-predicate)
(generic writer).
noise-predicate
(class).
noise-rule
(class).
noise-rules
(generic reader).
(setf noise-rules)
(generic writer).
noisy-qvm
(class).
normalize-wavefunction
(function).
nth-amplitude
(function).
(setf nth-amplitude)
(function).
number-of-qubits
(generic function).
octets-required-for-quantum-state
(function).
octets-required-for-qubits
(function).
parallelization-limit
(type).
path-simulate
(function).
pdotimes
(macro).
posix-shared-memory-allocation
(class).
predicate-and
(function).
predicate-function
(generic reader).
predicate-not
(generic function).
predicate-or
(function).
prepare-for-parallelization
(function).
priority
(generic reader).
probability
(function).
probability
(type).
program-matrix
(function).
psum-dotimes
(macro).
pure-state
(class).
pure-state-qvm
(class).
quantum-operator
(type).
quantum-state
(type).
qubit-probability
(function).
quil-bit
(type).
quil-octet
(type).
qvm-integer
(type).
qvm-real
(type).
run
(generic function).
run-program
(function).
seeded-random-state
(function).
set-noisy-gate
(generic function).
set-to-zero-state
(generic function).
state-elements
(generic function).
(setf state-elements)
(generic function).
tphi
(function).
transition
(generic function).
warm-apply-matrix-operator-cache
(function).
wavefunction-excited-state-probability
(function).
wavefunction-from-path-simulation
(function).
wavefunction-ground-state-probability
(function).
wf
(function).
with-random-state
(macro).
zero-out-classical-memory
(function).
%check-depol-entry
(function).
%check-noise-entry
(function).
%check-povm-entry
(function).
%close
(function).
%collapse-integer-by-mask
(function).
%corrupt-qvm-memory-with-povm
(function).
%evolve-density-matrix-with-superoperator
(function).
%evolve-pure-state-stochastically
(function).
%ftruncate
(function).
%make-classical-memory
(function).
%make-nat-tuple
(function).
%make-shared-memory
(function).
%mmap
(function).
%munmap
(function).
%perform-and
(function).
%perform-integer-add
(function).
%perform-integer-div
(function).
%perform-integer-mul
(function).
%perform-integer-sub
(function).
%perform-ior
(function).
%perform-move
(function).
%perform-real-add
(function).
%perform-real-div
(function).
%perform-real-mul
(function).
%perform-real-sub
(function).
%perform-xor
(function).
%serial-norm
(function).
%set-state
(generic writer).
%strerror
(function).
%trial-amplitudes
(generic function).
(setf %trial-amplitudes)
(generic writer).
*available-kernels*
(special variable).
*compile-measure-chains*
(special variable).
*fuse-gates-during-compilation*
(special variable).
*inline-static-gates-during-compilation*
(special variable).
*optimize-briskly*
(special variable).
*optimize-dangerously-fast*
(special variable).
*optimize-safely*
(special variable).
*qubit-limit-for-using-serial-kernels*
(special variable).
+default-noise-predicate-name+
(constant).
+max-nat-tuple-cardinality+
(constant).
+maxpriority+
(constant).
+minpriority+
(constant).
+octets-per-cflonum+
(constant).
+octets-per-flonum+
(constant).
add-depolarizing-noise
(function).
allocate-memory-for-model
(function).
allocation
(generic reader).
allocation-name
(generic reader).
amplitudes
(generic function).
(setf amplitudes)
(generic function).
and-predicate-names
(function).
apply-1q-operator
(function).
apply-2q-operator
(function).
apply-3q-operator
(function).
apply-all-kraus-maps
(generic function).
apply-classical-readout-noise
(generic function).
apply-kraus-map
(generic function).
apply-measure-discard-to-state
(generic function).
assert-in-bounds
(function).
avg-gate-time
(generic reader).
barf-memory
(function).
base-qvm
(class).
bit=
(function).
bring-to-zero-state
(function).
calculate-dephasing-map
(function).
call-at-exit
(function).
cflonum-vector
(type).
check-all-kraus-ops
(function).
check-all-povms
(function).
check-allocate-computation-space
(generic function).
check-classical-memory-bounds
(function).
check-kraus-ops
(function).
check-povm
(function).
check-superoperators
(function).
classical-memories
(generic function).
classical-memory-model
(generic function).
classical-memory-p
(function).
clifford-application
(class).
clifford-application-clifford
(generic reader).
compile-clifford
(function).
compile-instruction
(generic function).
compile-lambda
(function).
compile-loaded-program
(generic function).
compile-measure-chains
(function).
compile-operator
(generic function).
compiled-gate-application
(class).
compiled-gate-apply-operator
(generic reader).
compiled-inlined-matrix-gate-application
(class).
compiled-instruction
(class).
compiled-matrix
(generic reader).
compiled-matrix-gate-application
(class).
compiled-measurement
(class).
compiled-permutation-gate-application
(class).
compose-operators
(function).
conjugate-entrywise
(generic function).
convert-to-kraus-list
(function).
copy-hash-table
(function).
copy-memory-view
(function).
copy-posix-shared-memory
(function).
copy-subsystem
(function).
cumulative-distribution-function
(function).
current-instruction
(function).
dagger
(function).
deallocate-all-shared-memories
(function).
define-binary-transition
(macro).
define-direct-comparator
(macro).
define-indirect-comparator
(macro).
define-matmul
(macro).
define-serial-kernel
(macro).
density-matrix-state-measurement-probabilities
(function).
density-operator-matrix-view
(type).
density-qvm-measurement-probabilities
(function).
depolarization-ops
(generic reader).
(setf depolarization-ops)
(generic writer).
dereference-mref
(function).
(setf dereference-mref)
(function).
do-nat-tuple
(macro).
dummy-finalizer
(function).
eject-bit
(function).
eject-bit-code
(function).
eject-qubit-from-subsystem
(function).
elapsed-time
(generic reader).
(setf elapsed-time)
(generic writer).
elements-vector
(generic reader).
(setf elements-vector)
(generic function).
enable-all-qvm-optimizations
(function).
ensure-s64
(function).
ensure-signed-integer
(function).
ensure-superoperator
(function).
extract-amplitudes
(function).
finalizer
(type).
find-matching-rule
(function).
find-measure-chains
(function).
find-or-make-apply-matrix-operator-function
(function).
find-or-make-projector-operator-function
(function).
find-serial-kernel
(function).
flonum-vector
(type).
force-parameter
(function).
free-posix-shared-memory
(function).
full-density-number-of-qubits
(function).
gate-application-to-clifford
(function).
gate-definitions
(generic reader).
(setf gate-definitions)
(generic writer).
gaussian-random-complex
(function).
generate-amplitude-address-code
(function).
generate-complement-iteration
(function).
generate-extraction-code
(function).
generate-gate-application-code
(function).
generate-gate-application-code-with-matrix
(function).
generate-inner-matrix-multiply-code
(function).
generate-kraus-ops
(function).
generate-permutation-gate-application-code
(function).
generate-permutation-gate-code
(function).
generate-single-qubit-measurement-code
(function).
get-excited-state-probability
(generic function).
getpagesize
(function).
gray-bit
(function).
gray-encode
(function).
half
(function).
index-to-address
(function).
initialize-random-state
(function).
inject-bit
(function).
inject-bit-code
(function).
insert-amplitudes
(function).
install-gates
(function).
join-subsystems
(function).
kraus-list
(function).
kraus-list
(structure).
kraus-list%0
(reader).
kronecker-multiply
(function).
list-classical-states
(function).
loaded-program-length
(function).
lookup-gate
(function).
make-clifford-application
(function).
make-lisp-cflonum-vector
(function).
make-mixed-state-qvm
(function).
make-pauli-perturbed-1q-gate
(function).
make-posix-shared-memory
(function).
make-shared-array
(function).
make-stabilizer-qvm
(function).
make-subsystem
(function).
make-subsystem-on-qubits
(function).
make-vector-from-pointer
(function).
map-classical-state
(function).
map-complement
(function).
map-complement-in-parallel
(function).
map-complement-in-parallel-truly
(function).
map-reordered-amplitudes
(function).
map-reordered-amplitudes-in-parallel
(function).
map-reordered-amplitudes-in-parallel-truly
(function).
map-subdivisions
(function).
matmul2
(function).
matmul4
(function).
matmul8
(function).
matrix-multiply
(function).
matrix-multiply-code
(function).
matrix-view
(generic reader).
measure-all-state
(generic function).
measure-all-storage
(generic reader).
measure-and-store
(function).
measure-chain-at
(function).
measure-chain-to-instruction
(function).
measuring-gc
(macro).
memory-pointer
(reader).
memory-view
(function).
memory-view
(structure).
memory-view-aliasing-classical-memory
(reader).
memory-view-classical-memory
(function).
memory-view-length
(reader).
memory-view-p
(function).
memory-view-reader
(reader).
memory-view-ref
(function).
(setf memory-view-ref)
(function).
memory-view-root-classical-memory
(reader).
memory-view-writer
(reader).
midpoint
(function).
mixed-state-qvm
(class).
mixed-state-qvm-measurement-probabilities
(function).
naive-measure-all
(function).
nat-tuple
(function).
nat-tuple
(type).
nat-tuple-cardinality
(function).
nat-tuple-cardinality
(type).
nat-tuple-complement
(function).
nat-tuple-element
(type).
nat-tuple-position
(function).
nat-tuple-ref
(function).
noise-priority
(type).
noisy-gate-definitions
(generic reader).
(setf noisy-gate-definitions)
(generic writer).
nop-count
(function).
norm
(function).
not-predicate-name
(function).
num-qubits
(generic function).
oob-from
(generic reader).
oob-index
(generic reader).
oob-name
(generic reader).
oob-to
(generic reader).
operation-elements
(generic reader).
or-predicate-names
(function).
original-amplitudes
(generic reader).
outer-multiply
(function).
pc
(generic reader).
(setf pc)
(generic writer).
permutation-to-transpositions
(function).
perturb-measured-bits
(function).
perturb-measurement
(function).
posix-shared-memory
(structure).
posix-shared-memory-finalizer
(function).
posix-shared-memory-name
(reader).
(setf posix-shared-memory-name)
(writer).
posix-shared-memory-p
(function).
posix-shared-memory-pointer
(reader).
(setf posix-shared-memory-pointer)
(writer).
posix-shared-memory-size
(reader).
(setf posix-shared-memory-size)
(writer).
power-of-two-p
(function).
probabilistically
(macro).
probability-gate-x
(generic reader).
(setf probability-gate-x)
(generic writer).
probability-gate-y
(generic reader).
(setf probability-gate-y)
(generic writer).
probability-gate-z
(generic reader).
(setf probability-gate-z)
(generic writer).
probability-measure-x
(generic reader).
(setf probability-measure-x)
(generic writer).
probability-measure-y
(generic reader).
(setf probability-measure-y)
(generic writer).
probability-measure-z
(generic reader).
(setf probability-measure-z)
(generic writer).
program
(generic reader).
(setf program)
(generic writer).
program-compiled-p
(generic reader).
(setf program-compiled-p)
(generic writer).
projector-operator
(generic reader).
psum
(function).
pull-teeth-to-get-a-gate
(function).
quantum-system-state
(class).
(setf qubit-depolarization)
(function).
(setf qubit-fro)
(function).
qubit-limit-for-using-serial-kernels
(function).
(setf qubit-povm)
(function).
(setf qubit-t1)
(function).
(setf qubit-t2)
(function).
(setf qubit-tphi)
(function).
quil-name
(function).
random-clifford-program
(function).
random-qubits
(function).
random-range
(function).
randomize-wavefunction
(function).
readout-povms
(generic reader).
(setf readout-povms)
(generic writer).
requires-swapping-amps-p
(generic function).
reset-classical-memory
(function).
reset-quantum-state
(generic function).
root-memory-view-p
(function).
round-to-next-page
(function).
round-up-to-next-multiple
(function).
rule-matches-instr-p
(function).
rule-priority>=
(function).
sample-wavefunction-as-distribution
(function).
sample-wavefunction-as-distribution-in-parallel
(function).
sample-wavefunction-as-distribution-in-parallel-truly
(function).
sample-wavefunction-multiple-times
(function).
set-qubit-components-of-amplitude-address
(function).
set-readout-povm
(generic function).
set-superoperator
(generic function).
shm-open
(macro).
shm-unlink
(function).
shm-vector-allocation-size
(function).
shm-vector-from-pointer
(function).
shm-vector-header-size
(function).
simple-array-allocation-size
(function).
single-kraus
(function).
single-kraus
(structure).
single-kraus%0
(reader).
size-of
(function).
slurp-memory
(function).
source-gate
(generic reader).
source-instruction
(generic reader).
(setf source-instruction)
(generic writer).
stabilizer-qvm
(class).
stabilizer-qvm-tableau
(generic reader).
state
(generic reader).
subdivide
(function).
subsystem
(structure).
subsystem-contains-qubit-p
(function).
subsystem-contains-qubits-p
(function).
subsystem-num-qubits
(function).
subsystem-physical-to-logical-qubit
(function).
subsystem-qubits
(reader).
subsystem-state
(reader).
subsystemp
(function).
sum-dotimes
(macro).
superoperator
(structure).
superoperator-definitions
(generic reader).
(setf superoperator-definitions)
(generic writer).
superoperator-to-component-matrices
(function).
swap-internal-amplitude-pointers
(generic function).
sysconf
(function).
t1-vals
(generic reader).
(setf t1-vals)
(generic writer).
t2-vals
(generic reader).
(setf t2-vals)
(generic writer).
temporary-state
(generic reader).
(setf temporary-state)
(generic writer).
tphi-vals
(generic reader).
(setf tphi-vals)
(generic writer).
tr
(function).
typed-reader/writer
(function).
valid-noise-value
(type).
wait-function
(generic reader).
warning-wait-function
(function).
wavefunction-qubits
(function).
with-modified-amplitudes
(macro).
with-parallel-subdivisions
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Compile programs loaded into the QVM before running them.
qvm
.
The number of qubits required of a quantum state before it gets operated on in parallel.
See also *QUBIT-LIMIT-FOR-USING-SERIAL-KERNELS*.
qvm
.
Controls whether each transition is printed with a timing.
qvm
.
Define an INLINE-able function.
qvm
.
Selectively perform DOTIMES or LPARALLEL:DOTIMES, depending on whether the number of iterations N exceeds the threshold set by *QUBITS-REQUIRED-FOR-PARALLELIZATION*.
qvm
.
Compute the sum of BODY for I in ranging over 0 <= I < RANGE. RANGE must be a non-negative fixnum.
qvm
.
Combines two noise models NM1 and NM2 by concatenating their rules. This way, either rule can be matched by an instruction.
qvm
.
Apply the matrix operator OPERATOR to the amplitudes of WAVEFUNCTION specified by the qubits QUBITS.
qvm
.
Apply an operator OPERATOR to the amplitudes of WAVEFUNCTION specified by the qubits QUBITS. OPERATOR shall be a unary function taking a QUANTUM-STATE as an argument and modifying it.
qvm
.
Convert a generalized boolean BOOLEAN into a good ol’ BIT.
qvm
.
Create a copy of the wavefunction WF. If DESTINATION is NIL, allocate a new vector on the Lisp heap. If DESTINATION is provided, copy the wavefunction WF into the DESTINATION vector. Only copy as many elements as can be copied, namely min(|wf|, |destination|).
qvm
.
Compute the number of logical cores on the machine.
qvm
.
Given a value for T1 and a ELAPSED-TIME, generates the kraus operators corresponding to the amplitude damping noise.
qvm
.
Given a value for T-PHI (dephasing time) and a ELAPSED-TIME, calculates the kraus operators corresponding to the dephasing noise.
qvm
.
Given a probability of depolarization PROB, calculate the kraus operation elements for the depolarizing channel.
qvm
.
Calculate the tensor product of two kraus maps K1S and K2S by tensoring their elems. If one of the kraus maps is NIL, tensor the other with the identity matrix.
qvm
.
Load the program PROGRAM into the quantum virtual machine QVM. If SUPERSEDE-MEMORY-SUBSYSTEM is true (default: NIL), then the memory subsystem will be recomputed for the QVM based off of the program.
qvm
.
Convert a MAGICL matrix M to a QUANTUM-OPERATOR.
qvm
.
qvm
.
Make a SIZE x SIZE complex matrix whose elements are ELEMENTS. Each of ELEMENTS must be able to be coerced into a CFLONUM.
qvm
.
Returns a noise model with NOISE-RULES.
qvm
.
Creates a NOISE-PREDICATE with the given PREDICATE-FUNCTION (function designator), PRIORITY, and NOISE-POSITION.
qvm
.
Returns a noise rule with the specified PREDICATE and list KRAUS-MAPS.
qvm
.
Generates a Kraus map for a noisy identity channel:
M[rho] = (1-px-py-pz) rho + px X rho X + py Y rho Y + pz Z rho Z.
The arguments PX, PY and PZ can be interpreted as probabilities of a X, Y or Z error affecting the qubit.
qvm
.
ALLOCATION is an optional argument with the following behavior.
- If NULL (default), then a standard wavefunction in the Lisp heap will be allocated.
- If STRING, then the wavefunction will be allocated as a shared memory object, accessible by that name.
- Otherwise, it’s assumed to be an object that is compatible with the ALLOCATION-LENGTH and ALLOCATE-VECTOR methods.
- will probs have to redo this in multiple places, have a helper function do the allocation stuff.
qvm
.
Make a new quantum virtual machine with NUM-QUBITS number of qubits and a classical memory size of CLASSICAL-MEMORY-SIZE bits. ALLOCATION is an optional argument with the following behavior.
- If NULL (default), then a standard wavefunction in the Lisp heap will be allocated.
- If STRING, then the wavefunction will be allocated as a shared memory object, accessible by that name.
- Otherwise, it’s assumed to be an object that is compatible with the ALLOCATION-LENGTH and ALLOCATE-VECTOR methods
Apply the function F to the amplitudes of the QVM in standard order.
The returned function is true if the instruction contains a gate (not a MEASURE).
qvm
.
The returned function is true if the instruction operates on N qubits.
qvm
.
The returned function is true if there is any intersection between the instruction’s gate and GATES.
qvm
.
The returned function is true if there is any intersection between the instruction’s qubits and the QUBIT-LIST for an N-qubit operation. We need to specify N in the rule because a 2 qubit gate CNOT 0 1 could match a rule with qubits that has operation elements for a 1q gate. We want to prevent this, so we require the user to specify the number of qubits expected in the gate.
qvm
.
The returned function is true if the index of the INSTR in the program PARSED-PROG matches IDXS.
qvm
.
The returned function is true if the instruction is a MEASURE.
qvm
.
The returned function is true if the instruciton is a MEASURE on any of the specified QUBITS.
qvm
.
The returned function is true if the instruciton is a MEASURE on the specified QUBIT.
qvm
.
The returned function is true if the instruction is a GATE-APPLICATION that is exactly equal to GATE.
qvm
.
The returned function is true if QUBITS exactly equals the gate application’s qubits in the same order (CNOT 0 1 does NOT match CNOT 1 0).
qvm
.
Given a list of memory descriptors DESCRS (as if by QUIL:PARSED-PROGRAM-MEMORY-DEFINITIONS), produce a memory model object suitable for creating a CLASSICAL-MEMORY-SUBSYSTEM.
qvm
.
Get the memory named MEMORY-NAME at index I in the QVM.
qvm
.
Set the memory named MEMORY-NAME at index I in the QVM to NEW-VALUE.
qvm
.
Combines two noise models NM1 and NM2 in a way such that both set of rules, or one and not the other could be matched by an instruction.
qvm
.
Normalize the wavefunction WAVEFUNCTION, making it a unit vector in the constituent Hilbert space.
If the length/norm of WAVEFUNCTION is known, it can be passed as the LENGTH parameter.
qvm
.
Get the Nth amplitude of the quantum virtual machine QVM.
Set the Nth amplitude of the quantum virtual machine QVM.
The number of octets reqquired to represent a given quantum state.
qvm
.
The number of octets required to represent a state of N qubits.
qvm
.
Simulate the parsed program PARSED-PROG starting with the initial classical state INITIAL-CLASSICAL-STATE and ending with the final classical states FINAL-CLASSICAL-STATES. FINAL-CLASSICAL-STATES should be a list of classical states.
Return a list of amplitudes associated with the classical states.
PARSED-PROG must be a program that only contains gate applications.
qvm
.
Logical AND of 2 noise predicates. The NOISE-POSITION is taken from NOISE-PREDICATE1 and the priority is taken to be the max PRIORITY between the two predicates.
qvm
.
Logical OR of 2 noise predicates. The NOISE-POSITION is taken from NOISE-PREDICATE1 and the priority is taken to be the max PRIORITY between the two predicates.
qvm
.
Create a worker pool if none exists or if NUM-WORKERS has changed.
If NUM-WORKERS is not provided, the number of workers will be set to the number of logical cores of your machine.
This function does nothing if NUM-WORKERS workers have already been created.
If NUM-WORKERS is provided it should be less than or equal to the number of logical cores of your machine.
NOTE: This must be called before computations can be done.
qvm
.
Compute the matrix of the parsed program PP by way of simulating it on every basis element.
DEPRECATED // The probability that the physical qubit addressed by QUBIT is 1.
Run the program PROGRAM on a QVM of NUM-QUBITS qubits.
qvm
.
Return an MT19937 random state that has been initialized from SEED, which should be either NIL (meaning to use the current value of MT19937:*RANDOM-STATE*), or an integer or a specialized vector of (unsigned-byte 32), which will result in a reproducible random state.
qvm
.
Calculate t_phi from T1 and T2. T-PHI = (2*T1*T2) / (2*T1 + T2). T2 must be strictly less than 2 * T1.
qvm
.
Warm up the **APPLY-MATRIX-OPERATOR-FUNCTIONS** cache for Hilbert spaces B_i and B_i (x) B_j for 0 <= i, j <= MAX-QUBITS.
qvm
.
Compute the probability that qubit QUBIT is in the excited state.
qvm
.
Compute the wavefunction of the program PARSED-PROG using path simulation.
qvm
.
Compute the probability that qubit QUBIT is in the ground state.
qvm
.
Construct a wavefunction from the elements (ELT . ELTS).
qvm
.
Allocate a fresh zero-initialized CFLONUM-VECTOR described by DESCRIPTION. Return two values:
1. The allocated vector (a CFLONUM-VECTOR).
2. A finalizer thunk of type FINALIZER, which should be called when the memory is OK to be freed.
NOTE: Note that the finalizer may close over the allocated vector.
qvm
.
posix-shared-memory-allocation
)) ¶c-allocation
)) ¶lisp-allocation
)) ¶The length of memory to be allocated, measured in the element type of the vector.
qvm
.
posix-shared-memory-allocation
)) ¶automatically generated reader method
c-allocation
)) ¶automatically generated reader method
lisp-allocation
)) ¶automatically generated reader method
Apply a gate GATE to the state STATE on the sub-Hilbert space defined by the NAT-TUPLE of qubit indexes QUBITS. PARAMETERS is a list of numeric parameters passed to a dynamic gate.
qvm
.
simple-gate
) (state pure-state
) qubits &rest parameters) ¶parameterized-gate
) (state pure-state
) qubits &rest parameters) ¶permutation-gate
) (state pure-state
) qubits &rest parameters) ¶controlled-gate
) (state pure-state
) qubits &rest parameters) ¶forked-gate
) (state pure-state
) qubits &rest parameters) ¶dagger-gate
) (state pure-state
) qubits &rest parameters) ¶compiled-matrix-gate-application
) (state pure-state
) qubits &rest parameters) ¶compiled-inlined-matrix-gate-application
) (state pure-state
) qubits &rest parameters) ¶compiled-permutation-gate-application
) (state pure-state
) qubits &rest parameters) ¶superoperator
) (state pure-state
) qubits &rest parameters) ¶superoperator
) (state density-matrix-state
) qubits &rest parameters) ¶gate
) (state density-matrix-state
) qubits &rest parameters) ¶qvm
.
classical-memory-mixin
)) ¶The classical memory subsystem of the QVM. No memory by default.
Manipulate the STATE as to force the QUBIT in STATE to collapse to the MEASURED-VALUE. EXCTIED-PROBABILITY is the probability that the specified QUBIT measures to |1>, regardless of the MEASURED-VALUE it is being forced to.
qvm
.
density-matrix-state
) excited-probability) ¶Force the density-matrix-state STATE to have the qubit QUBIT collapse/measure to MEASURED-VALUE. Modify the density matrix appropriately.EXCITED-PROBABILITY should be the probability that QUBIT measured to |1>, regardless of what it’s being forced as.
pure-state
) excited-probability) ¶Force the quantum system of the PURE-STATE STATE to have the qubit QUBIT collapse/measure to MEASURED-VALUE. Modify the amplitudes of all other qubits accordingly. EXCITED-PROBABILITY should be the probability that QUBIT measured to |1>, regardless of what it’s being forced as.
qvm
.
invalid-instruction-encountered
)) ¶qvm
.
invalid-instruction-encountered
)) ¶Non-deterministically perform a measurement on the qubit addressed by Q in the quantum abstract machine QAM.
Return two values:
1. The resulting QAM.
2. The measured classical bit.
qvm
.
stabilizer-qvm
) q) ¶Non-deterministically perform a measurement on all qubits in the quantum abstract machine QAM.
Return two values:
1. The resulting QAM.
2. A list of measured bits.
qvm
.
noise-predicate
)) ¶Name or descriptor for noise.
name
.
qvm
.
channel-qvm
)) ¶automatically generated reader method
qvm
.
channel-qvm
)) ¶automatically generated writer method
qvm
.
noise-predicate
)) ¶Should application of a channel happen before or after the instruction?
qvm
.
noise-rule
)) ¶noise-rule
)) ¶A function that is true when an instruction is matched, false otherwise.
qvm
.
noise-model
)) ¶noise-model
)) ¶A list of NOISE-RULEs.
Return the number of qubits configured on the quantum abstract machine QAM.
qvm
.
stabilizer-qvm
)) ¶qvm
.
noise-predicate
)) ¶Does the instruction trigger the application of a channel?
qvm
.
noise-predicate
)) ¶For ordering when checking for an instruction’s matching predicates. The convention we use is that more specific predicates get higher priorities.
Simulate the quantum abstract machine QAM until completion. Return the QAM in its end state.
qvm
.
basic-noise-qvm
)) ¶classical-memory-mixin
)) ¶pure-state-qvm
)) ¶Add noisy gate definition to QVM for a SIMPLE-GATE specified by
GATE-NAME in terms of the Kraus operator representation
rho -> sum_{j=1}^n K_j rho K_j^H.
The argument KRAUS-OPS should hold the Kraus operators as list of MAGICL matrices ’(K1 K2 ... Kn).
qvm
.
density-qvm
) gate-name qubits kraus-ops) ¶Set the initial state to the pure zero state.
qvm
.
density-matrix-state
)) ¶pure-state
)) ¶Extract the state data from the STATE. This is AMPLITUDES for a PURE-STATE, or ELEMENTS-VECTOR for a DENSITY-MATRIX-STATE.
qvm
.
density-matrix-state
)) ¶pure-state
)) ¶qvm
.
density-matrix-state
)) ¶pure-state
)) ¶Execute the instruction INSTR on the QVM.
Return just the resulting (possibly modified) QVM after executing INSTR. (Historical note: used to also return pc)
qvm
.
depolarizing-qvm
) (instr measurement
)) ¶depolarizing-qvm
) (instr reset
)) ¶depolarizing-qvm
) (instr application
)) ¶density-qvm
) (instr measurement
)) ¶density-qvm
) (instr gate-application
)) ¶basic-noise-qvm
) (instr measurement
)) ¶basic-noise-qvm
) (instr gate-application
)) ¶channel-qvm
) (instr measurement
)) ¶channel-qvm
) (instr gate-application
)) ¶channel-qvm
) (instr gate-application
)) ¶pure-state-qvm
) (instr clifford-application
)) ¶stabilizer-qvm
) (instr clifford-application
)) ¶stabilizer-qvm
) (instr gate-application
)) ¶stabilizer-qvm
) (instr measure-discard
)) ¶stabilizer-qvm
) (instr measure
)) ¶stabilizer-qvm
) (instr reset-qubit
)) ¶stabilizer-qvm
) (instr reset
)) ¶classical-memory-mixin
) (instr wait
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/real/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/integer/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/octet/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/bit/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/real/real
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/integer/integer
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/octet/octet
)) ¶classical-memory-mixin
) (instr classical-greater-equal-bit/bit/bit
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/real/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/integer/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/octet/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/bit/immediate
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/real/real
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/integer/integer
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/octet/octet
)) ¶classical-memory-mixin
) (instr classical-greater-than-bit/bit/bit
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/real/immediate
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/integer/immediate
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/octet/immediate
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/bit/immediate
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/real/real
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/integer/integer
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/octet/octet
)) ¶classical-memory-mixin
) (instr classical-less-equal-bit/bit/bit
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/real/immediate
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/integer/immediate
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/octet/immediate
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/bit/immediate
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/real/real
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/integer/integer
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/octet/octet
)) ¶classical-memory-mixin
) (instr classical-less-than-bit/bit/bit
)) ¶classical-memory-mixin
) (instr classical-equality-bit/real/immediate
)) ¶classical-memory-mixin
) (instr classical-equality-bit/integer/immediate
)) ¶classical-memory-mixin
) (instr classical-equality-bit/octet/immediate
)) ¶classical-memory-mixin
) (instr classical-equality-bit/bit/immediate
)) ¶classical-memory-mixin
) (instr classical-equality-bit/real/real
)) ¶classical-memory-mixin
) (instr classical-equality-bit/integer/integer
)) ¶classical-memory-mixin
) (instr classical-equality-bit/octet/octet
)) ¶classical-memory-mixin
) (instr classical-equality-bit/bit/bit
)) ¶classical-memory-mixin
) (instr classical-store
)) ¶classical-memory-mixin
) (instr classical-load
)) ¶classical-memory-mixin
) (instr classical-division-real/immediate
)) ¶classical-memory-mixin
) (instr classical-division-real/real
)) ¶classical-memory-mixin
) (instr classical-division-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-division-integer/integer
)) ¶classical-memory-mixin
) (instr classical-multiplication-real/immediate
)) ¶classical-memory-mixin
) (instr classical-multiplication-real/real
)) ¶classical-memory-mixin
) (instr classical-multiplication-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-multiplication-integer/integer
)) ¶classical-memory-mixin
) (instr classical-subtraction-real/immediate
)) ¶classical-memory-mixin
) (instr classical-subtraction-real/real
)) ¶classical-memory-mixin
) (instr classical-subtraction-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-subtraction-integer/integer
)) ¶classical-memory-mixin
) (instr classical-addition-real/immediate
)) ¶classical-memory-mixin
) (instr classical-addition-real/real
)) ¶classical-memory-mixin
) (instr classical-addition-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-addition-integer/integer
)) ¶classical-memory-mixin
) (instr classical-convert-bit/real
)) ¶classical-memory-mixin
) (instr classical-convert-bit/integer
)) ¶classical-memory-mixin
) (instr classical-convert-real/bit
)) ¶classical-memory-mixin
) (instr classical-convert-real/integer
)) ¶classical-memory-mixin
) (instr classical-convert-integer/bit
)) ¶classical-memory-mixin
) (instr classical-convert-integer/real
)) ¶classical-memory-mixin
) (instr classical-exchange
)) ¶classical-memory-mixin
) (instr classical-move-real/immediate
)) ¶classical-memory-mixin
) (instr classical-move-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-move-bit/immediate
)) ¶classical-memory-mixin
) (instr classical-move-octet/immediate
)) ¶classical-memory-mixin
) (instr classical-move-real/real
)) ¶classical-memory-mixin
) (instr classical-move-integer/integer
)) ¶classical-memory-mixin
) (instr classical-move-bit/bit
)) ¶classical-memory-mixin
) (instr classical-move-octet/octet
)) ¶classical-memory-mixin
) (instr classical-exclusive-or-octet/immediate
)) ¶classical-memory-mixin
) (instr classical-exclusive-or-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-exclusive-or-bit/immediate
)) ¶classical-memory-mixin
) (instr classical-exclusive-or-octet/octet
)) ¶classical-memory-mixin
) (instr classical-exclusive-or-integer/integer
)) ¶classical-memory-mixin
) (instr classical-exclusive-or-bit/bit
)) ¶classical-memory-mixin
) (instr classical-inclusive-or-octet/immediate
)) ¶classical-memory-mixin
) (instr classical-inclusive-or-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-inclusive-or-bit/immediate
)) ¶classical-memory-mixin
) (instr classical-inclusive-or-octet/octet
)) ¶classical-memory-mixin
) (instr classical-inclusive-or-integer/integer
)) ¶classical-memory-mixin
) (instr classical-inclusive-or-bit/bit
)) ¶classical-memory-mixin
) (instr classical-and-octet/immediate
)) ¶classical-memory-mixin
) (instr classical-and-integer/immediate
)) ¶classical-memory-mixin
) (instr classical-and-bit/immediate
)) ¶classical-memory-mixin
) (instr classical-and-octet/octet
)) ¶classical-memory-mixin
) (instr classical-and-integer/integer
)) ¶classical-memory-mixin
) (instr classical-and-bit/bit
)) ¶classical-memory-mixin
) (instr classical-not-integer
)) ¶classical-memory-mixin
) (instr classical-not-octet
)) ¶classical-memory-mixin
) (instr classical-not-bit
)) ¶classical-memory-mixin
) (instr classical-negate-integer
)) ¶classical-memory-mixin
) (instr classical-negate-real
)) ¶pure-state-qvm
) (instr compiled-measurement
)) ¶pure-state-qvm
) (instr compiled-gate-application
)) ¶base-qvm
) (instr measure-all
)) ¶classical-memory-mixin
) (instr jump-unless
)) ¶classical-memory-mixin
) (instr jump-when
)) ¶classical-memory-mixin
) (instr unconditional-jump
)) ¶pure-state-qvm
) (instr reset-qubit
)) ¶classical-memory-mixin
) (instr halt
)) ¶classical-memory-mixin
) (instr pragma
)) ¶classical-memory-mixin
) (instr no-operation
)) ¶unresolved-application
)) ¶pure-state-qvm
) &rest args) ¶pure-state
) &key num-qubits &allow-other-keys) ¶noise-predicate
) &rest args) ¶density-matrix-state
) &key num-qubits &allow-other-keys) ¶basic-noise-qvm
) &rest args) ¶noise-model
) &rest args) ¶classical-memory-subsystem
) &rest initargs) ¶density-qvm
) &rest args) ¶channel-qvm
) &rest args) ¶mixed-state-qvm
) &rest args) ¶classical-memory
) &optional env) ¶single-kraus
) &optional environment-3) ¶kraus-list
) &optional environment-3) ¶classical-memory
) stream) ¶single-kraus
) stream) ¶clifford-application
) stream) ¶memory-view
) stream) ¶kraus-list
) stream) ¶An error raised when a gate is invoked incorrectly.
qvm
.
error
.
A representation of a chunk of allocated classical memory.
qvm
.
structure-object
.
alexandria:non-negative-fixnum
0
This slot is read-only.
cffi-sys:foreign-pointer
(cffi-sys:null-pointer)
This slot is read-only.
BASIC-NOISE-QVM is a QVM that supports a noise model defined by T1, T2, T-phi, depolarization probability, and readout fidelities on each qubit. At each instruction, damping, dephasing, and depolarizing noise is applied for the qubits involved in the instruction. If READOUT-POVMS are defined for a qubit, the readout noise is applied after a MEASURE instruction on that qubit.
qvm
.
apply-all-kraus-maps
.
apply-classical-readout-noise
.
apply-classical-readout-noise
.
apply-classical-readout-noise
.
avg-gate-time
.
(setf depolarization-ops)
.
depolarization-ops
.
(setf elapsed-time)
.
elapsed-time
.
initialize-instance
.
measure-all-state
.
measure-all-state
.
(setf readout-povms)
.
readout-povms
.
run
.
(setf t1-vals)
.
t1-vals
.
(setf t2-vals)
.
t2-vals
.
(setf tphi-vals)
.
tphi-vals
.
transition
.
transition
.
Initarg | Value |
---|---|
:t1-vals | (make-hash-table test (quote eql)) |
:tphi-vals | (make-hash-table test (quote eql)) |
:t2-vals | (make-hash-table test (quote eql)) |
:depolarization-ops | (make-hash-table test (quote eql)) |
:readout-povms | (make-hash-table test (quote eql)) |
:avg-gate-time | (error :avg-gate-time is a required initarg to basic-noise-qvm) |
:elapsed-time | 0.0d0 |
Hash table of qubit idx to T1 value for each qubit to simulate
:t1-vals
Hash table of qubit idx to T2 value for each qubit to simulate
:t2-vals
Hash table of qubit idx to TPHI value for each qubit to simulate.
:tphi-vals
A hash table of qubit to depolarization operators, representing gate application noise. Gate over-rotations and under-rotations average out to the depolarizing channel.
:depolarization-ops
A hash-table of qubit idx to a list of povms, representing the readout assignment probabilities (p(0|0) p(0|1) p(1|0) p(1|1)).
:readout-povms
To calculate the kraus operators for T1, T2, etc. noise, a gate time value is needed. Ideally, this gate time should be the duration of the gate preceding the application of the kraus noise. As an approximation, this value should represent the average gate time of the gates that will be run.
:avg-gate-time
This slot is read-only.
A value to keep track of the elpased time of the program. The elapsed time is used for calculating the kraus operators of some noise value at a given point in the program.
:elapsed-time
A description of an allocation in foreign memory.
The CHANNEL-QVM is a QVM that supports a fully explicit NOISE-MODEL. The NOISE-MODEL is an explicit definition of where and how different channels should be applied to a program running in the CHANNEL-QVM.
A mixin for quantum abstract machines making use of a classical memory subsystem and a program vector.
qvm
.
classical-memories
.
classical-memory-model
.
classical-memory-subsystem
.
(setf gate-definitions)
.
gate-definitions
.
(setf pc)
.
pc
.
(setf program)
.
program
.
run
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
transition
.
wait-function
.
Initarg | Value |
---|---|
:classical-memory-subsystem | (make-instance (quote classical-memory-subsystem)) |
:wait-function | (quote warning-wait-function) |
:gate-definitions | (copy-hash-table **default-gate-definitions**) |
The classical memory subsystem of the QVM. No memory by default.
:classical-memory-subsystem
This slot is read-only.
The program to be executed.
#()
A unary function taking a QVM and implementing Quil’s WAIT logic. (The default does nothing and just warns.)
:wait-function
This slot is read-only.
A table mapping gate names to their GATE-instance definition.
:gate-definitions
The standard Quil memory subsystem.
qvm
.
Initarg | Value |
---|---|
:classical-memory-model | **empty-memory-model** |
A description of the structure of the memory of the abstract machine.
cl-quil:memory-model
:classical-memory-model
This slot is read-only.
A table mapping names to allocated memories.
hash-table
This slot is read-only.
A DENSITY-MATRIX-STATE is a general quantum state of N qubits described by a density matrix ρ, representing a statistical mixture of PURE-STATEs. The elements of ρ are represented by the length 2^(2*N) vector ELEMENTS-VECTOR which is in row-major order. MATRIX-VIEW is the 2D ’traditional’ matrix representation of ρ.
qvm
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-measure-discard-to-state
.
check-allocate-computation-space
.
(setf elements-vector)
.
(setf elements-vector)
.
elements-vector
.
force-measurement
.
get-excited-state-probability
.
initialize-instance
.
matrix-view
.
measure-all-state
.
measure-all-state
.
measure-all-state
.
num-qubits
.
requires-swapping-amps-p
.
set-to-zero-state
.
(setf state-elements)
.
state-elements
.
(setf temporary-state)
.
temporary-state
.
Initarg | Value |
---|---|
:elements-vector | nil |
:temporary-state | nil |
The contents of a density matrix ρ as a one-dimensional vector. For a state of N qubits, this vector should be of length 2^(2*N).
:elements-vector
2D array displaced to ELEMENTS-VECTOR
This slot is read-only.
A placeholder for computations on the elements-vector of a DENSITY-MATRIX-STATE.
:temporary-state
A density matrix simulator.
qvm
.
amplitudes
.
apply-classical-readout-noise
.
apply-classical-readout-noise
.
compile-instruction
.
compile-loaded-program
.
initialize-instance
.
measure-all
.
(setf noisy-gate-definitions)
.
noisy-gate-definitions
.
(setf readout-povms)
.
readout-povms
.
reset-quantum-state
.
set-noisy-gate
.
set-readout-povm
.
transition
.
transition
.
(make-hash-table :test (quote equalp))
:noisy-gate-definitions
(make-hash-table)
:readout-povms
A quantum virtual machine with parametric depolarizing noise.
qvm
.
compile-loaded-program
.
(setf probability-gate-x)
.
probability-gate-x
.
(setf probability-gate-y)
.
probability-gate-y
.
(setf probability-gate-z)
.
probability-gate-z
.
(setf probability-measure-x)
.
probability-measure-x
.
(setf probability-measure-y)
.
probability-measure-y
.
(setf probability-measure-z)
.
probability-measure-z
.
transition
.
transition
.
transition
.
Initarg | Value |
---|---|
:x | 0.0 |
:y | 0.0 |
:z | 0.0 |
:measure-x | 0.0 |
:measure-y | 0.0 |
:measure-z | 0.0 |
Probability of a Pauli X gate happening after a gate application or reset.
:x
Probability of a Pauli Y gate happening after a gate application or reset.
:y
Probability of a Pauli Z gate happening after a gate application or reset.
:z
Probability of a Pauli X gate happening before a measurement.
:measure-x
Probability of a Pauli Y gate happening before a measurement.
:measure-y
Probability of a Pauli Z gate happening before a measurement.
:measure-z
A description of an allocation on the Lisp heap.
A pseudo-instruction for measuring all qubits simultaneously.
A NOISE-MODEL is a collection of NOISE-RULES, describing what type of noise should be applied to a program that goes through a QVM, and where that noise should be applied.
qvm
.
Initarg | Value |
---|---|
:noise-rules | nil |
:readout-povms | (make-hash-table test (quote eql)) |
A list of NOISE-RULEs.
:noise-rules
A hash table of qubit to readout noise assignment probabilities, given as a 4-element list ((p(0|0) p(0|1) p(1|0) p(1|1)).
:readout-povms
A NOISE-PREDICATE describes a collection of program instructions. When used in a NOISE-RULE, the NOISE-PREDICATE describes which instructions should be matched by the noise described in the OPERATION-ELEMENTS. Optionally, the NOISE-PREDICATE can be given a NAME. If none is provided, use the default ’NOISE-NAME’.
qvm
.
Initarg | Value |
---|---|
:predicate-function | nil |
:priority | 10 |
:noise-position | (quote after) |
:name | +default-noise-predicate-name+ |
Does the instruction trigger the application of a channel?
:predicate-function
This slot is read-only.
For ordering when checking for an instruction’s matching predicates. The convention we use is that more specific predicates get higher priorities.
:priority
This slot is read-only.
Should application of a channel happen before or after the instruction?
qvm:noise-position
:noise-position
This slot is read-only.
A NOISE-RULE consists of noise data (OPERATION-ELEMENTS) and a specification of where the noise data should be applied to the program (NOISE-PREDICATE).
qvm
.
A function that is true when an instruction is matched, false otherwise.
:noise-predicate
A list of kraus maps to apply when the rule is matched. Each kraus map is a list of kraus operators.
:operation-elements
This slot is read-only.
qvm
.
%trial-amplitudes
.
(setf amplitudes)
.
amplitudes
.
apply-classical-readout-noise
.
apply-classical-readout-noise
.
apply-classical-readout-noise
.
compile-instruction
.
compile-loaded-program
.
initialize-instance
.
measure-all
.
(setf noisy-gate-definitions)
.
noisy-gate-definitions
.
(setf readout-povms)
.
readout-povms
.
set-noisy-gate
.
set-readout-povm
.
transition
.
transition
.
Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.
(make-hash-table :test (quote equalp))
:noisy-gate-definitions
Noisy readout encoded as diagonal single qubit
POVM given as a 4-element list
(p(0|0) p(0|1)
p(1|0) p(1|1))
which for each qubit gives the probability p(j|k) of measuring outcome j given actual state k. Note that we model purely classical readout error, i.e., the post measurement qubit state is always k, but the recorded outcome j may be different.
(make-hash-table :test (quote eql))
:readout-povms
A description of an allocation in POSIX shared memory.
A PURE-STATE contains the quantum mechanical state for a system that can be described by a vector |ψ> of N qubits with unit length in a Hilbert space. The elements of this length 2^N vector is represented by AMPLITUDES.
qvm
.
(setf %trial-amplitudes)
.
%trial-amplitudes
.
(setf amplitudes)
.
amplitudes
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-gate-to-state
.
apply-measure-discard-to-state
.
check-allocate-computation-space
.
force-measurement
.
get-excited-state-probability
.
initialize-instance
.
measure-all-state
.
measure-all-state
.
measure-all-state
.
num-qubits
.
original-amplitudes
.
requires-swapping-amps-p
.
set-to-zero-state
.
state-elements
.
(setf state-elements)
.
swap-internal-amplitude-pointers
.
Initarg | Value |
---|---|
:amplitudes | nil |
:trial-amplitudes | nil |
:original-amplitudes | nil |
The wavefunction of a pure state.
:amplitudes
A second wavefunction used when applying a noisy quantum channel. Applying a Kraus map generally requires evaluating psi_j = K_j * psi for several different j, making it necessary to keep the original wavefunction around. This value should be a QUANTUM-STATE whose size is compatible with the number of qubits of the CHANNEL-QVM. The actual values can be initialized in any way because they will be overwritten. As such, it merely is scratch space for intermediate computations, and hence should not be otherwise directly accessed.
:trial-amplitudes
A reference to the original pointer of amplitude memory, so the amplitudes can sit in the right place at the end of a computation.
This slot is read-only.
An pure-state implementation of the Quantum Abstract Machine.
The complex float type used in computations. Typically these will represent wavefunction amplitudes.
qvm
.
Describes the position of a noise rule relative to an instruction. Should the noise be applied :BEFORE or :AFTER the instruction is executed?
qvm
.
A limit on the number of qubits that can be parallelized across.
qvm
.
A representation of an operator on a quantum state. This will be a unitary square matrix where each dimension is a power-of-two.
qvm
.
A representation of a quantum state. This will have a power-of-2 length.
qvm
.
An association list of kernels. The keys are integers representing number of qubits, and values are symbols designating function names corresponding to an operator whose lambda list is that described in DEFINE-SERIAL-KERNEL.
qvm
.
Compile chains of measures into an efficient sampling.
qvm
.
Should gates be fused during compilation?
qvm
.
Inline the actual gate matrices into the compiled instructions.
qvm
.
Optimization qualities for when the code should go fast, but have safety.
qvm
.
Optimization qualities for when the code should go as fast as possible.
qvm
.
Optimization qualities for when the code should emphasize safety and debugability.
qvm
.
The maximum number of qubits allowed in order to use a specified serial kernel.
qvm
.
Define a matrix multiplier function named NAME for square matrices operating on vectors of length SIZE. The defined function will take three arguments:
1. MATRIX: An object of type QUANTUM-OPERATOR, the multiplier.
2. COLUMN: An object of type QUANTUM-STATE, the vector being multipled.
3. RESULT: An object of type QUANTUM-STATE, where the result is deposited.
The function will just return NIL, and modify the contents of RESULT.
qvm
.
Define a function named NAME which has the lambda list
(OP WF Q0 ... Qn-1)
which applies the gate OP (represented as a QUANTUM-OPERATOR) to the wavefunction WF (represented as a QUANTUM-STATE) with qubits Q0 ... Qn-1, where N = NUM-QUBITS.
This function mutates WF and is unsafe.
qvm
.
Iterate over the elements of the nat tuple NT in increasing order. The return value is unspecified.
ELT will be bound to the element itself.
qvm
.
Execute BODY setting TIME-VAR to the number of milliseconds spent garbage collecting, and BYTES-VAR to roughly the number of bytes allocated.
qvm
.
Execute BODY with probability 0 <= P <= 1.
qvm
.
Compute the sum of BODY for I in ranging over 0 <= I < RANGE. RANGE must be a non-negative fixnum.
qvm
.
Given a quantum state WAVEFUNCTION, a NAT-TUPLE of qubits QUBITS, and a starting address STARTING-ADDRESS, bind dynamically to the symbol COL the list of amplitudes that correspond to the qubits provided.
qvm
.
qvm
.
Check that a key value pair in the DEPOLARIZATION-OPS slot is valid. The QUBIT must be a non-negative integer, and the KRAUS-MAP must be a valid kraus map.
qvm
.
Check that a key value pair in T1-VALS, T2-VALS, or TPHI-VALS is valid. The QUBIT must be a NON-NEGATIVE INTEGER, and the NOISE-VAL must be of VALID-NOISE-VALUE type for T1-VALS, T2-VALS, and TPHI-VALS.
qvm
.
Check that a key value pair in READOUT-POVMS is valid. The QUBIT must be a NON-NEGATIVE INTEGER, and the POVM must be a correctly formatted POVM.
qvm
.
Let INTEGER and MASK be integers of the same bit-length. Remove the bits of INTEGER that correspond to the zeros of MASK.
qvm
.
Apply POVM-MAP to the measured result of the INSTR application.
qvm
.
Apply a superoperator SOP to a vectorized density matrix given in the DENSITY-MATRIX-STATE STATE, where QUBITS and GHOST-QUBITS are tuples of qubit indices which the superoperator acts on (from the left and right respectively). The computation may require the STATE’s TEMPORARY-STATE, a vector of the same length as the AMPLITUDES of the STATE. Returns the pair of updated STATE and (perhaps freshly allocated) TEMPORARY-STORAGE.
qvm
.
Uniformly at random select one of the kraus operators in KRAUS-MAP to apply for the PURE-STATE STATE. Randomly select one of the Kraus operators by inverse transform sampling (cf [1]): We divide the unit interval [0,1] into n bins where the j-th bin size equals the probability p_j with which the j-th Kraus operator k_j should be applied. We know that the Kraus operators are normalized such that p_j = <psi|k_j^H k_j |psi> where x^H denotes hermitian conjugation of x and can therefore perform this sampling lazily:
First generate a uniformly sampled random number r in [0,1]. Next, find j such that
sum_{k=1}^{j-1} p_k < r <= sum_{k=1}^{j} p_k
This is possible by evaluating only all p_k for k<=j. Then pick this j as the choice of Kraus operator to apply.
[1]: https://en.wikipedia.org/wiki/Inverse_transform_sampling
qvm
.
Apply depolarizing noise to the list QUBITS of the QVM with the following probabilities:
* Probability of an X-gate PX,
* Probability of a Y-gate PY, and
* Probability of a Z-gate PZ.
It should be that PX + PY + PZ <= 1.
qvm
.
Allocate memory for a given MEMORY-MODEL MODEL.
Return a hash table mapping memory names to their MEMORY-VIEWs which contain allocated CLASSICAL-MEMORYs.
If BYPASS-SIZE-LIMIT is T (default: NIL), then the size limit dictated by **CLASSICAL-MEMORY-SIZE-LIMIT** will be ignored.
qvm
.
Returns the concatenated predicate name (NAME1 & NAME2)
qvm
.
Apply a 1-qubit operator OP to the wavefunction WF on qubits Q0.
Note: This function is raw and unsafe. Pass bad data => get a crash.
qvm
.
Apply a 2-qubits operator OP to the wavefunction WF on qubits Q0, Q1.
Note: This function is raw and unsafe. Pass bad data => get a crash.
qvm
.
Apply a 3-qubits operator OP to the wavefunction WF on qubits Q0, Q1, Q2.
Note: This function is raw and unsafe. Pass bad data => get a crash.
qvm
.
Barf out the memory designated by the vector of QUIL-OCTETS into the pointer POINTER.
qvm
.
Build the dephasing map. If TPHI is not null, use that to calculate the dephasing map. In the absence of a TPHI value, use T1 and T2 to calculate TPHI if those values exist. T2 is upper bounded by 2 * T1.
qvm
.
Ensure that FUN is called when the Lisp implementation stops.
qvm
.
Call CHECK-KRAUS-OPS on each element of SEQ.
qvm
.
Verify that a list KRAUS-OPS of Kraus operators given as MAGICL:MATRIX objects encodes a proper kraus map. In particular, we require that the Kraus operators are all of equal matrix dimension with equal numbers of rows and columns. Furthermore, to ensure that the Kraus map preserves trace, they must be normalized such that sum_{j=1}^n K_j^H K_j = I, where I is the identity matrix of equal dimensions.
qvm
.
Verify that the list POVM contains a valid single qubit diagonal POVM, given as the list (p(0|0) p(0|1) p(1|0) p(1|1)).
qvm
.
Convert each SUPEROPERATOR in SUPEROPERATORS to a matrix and call CHECK-ALL-KRAUS-OPS on the resulting list.
Compile the lambda form FORM into a FUNCTION object.
qvm
.
Given a code vector CODE of N qubits, compile all measure chains.
qvm
.
Compute the product of the matrices A and B.
qvm
.
Converts a list of magicl matrices KRAUS-OPS to a SUPEROPERATOR KRAUS-LIST, which is a list of SINGLE-KRAUS.
qvm
.
Copy the hash table HASH-TABLE.
NOTE: This will not copy any multiprocessing aspects.
qvm
.
Compute the CDF of a quantum state STATE. This is a vector C such that C_i = sum_{0 <= j <= i} Pr(j).
qvm
.
What is the next instruction to be executed on the QVM?
qvm
.
Computes the probability distribution of measurement outcomes (a vector)
associated with the specified density matrix state in the MIXED-STATE-QVM.
For example, if (NUMBER-OF-QUBITS QVM) is 2, then this will return a vector
#(p[0,0] p[0,1] p[1,0] p[1,1])
where p[i,j] denotes the probability that a simultaneous measurement of qubits 0,1 results in the outcome i,j.
qvm
.
Computes the probability distribution of measurement outcomes (a vector) associated with the STATE of the DENSITY-QVM.
qvm
.
Look up the value of the quil:memory-ref MREF in the QVM.
qvm
.
Set the value at the quil:memory-ref MREF in the QVM to NEW-VALUE.
qvm
.
A "finalizer" that does nothing. Used for objects managed by the GC.
qvm
.
Remove the nth bit. Example:
(EJECT-BIT #b1101 1) => #b111
qvm
.
Eject the qubit QUBIT from the subsystem SS. Return two values:
1. A subsystem with the qubit factored out. (If the qubit is not a part of the system, it is assumed to be in the zero state.)
2. The state of the factored out qubit.
qvm
.
Ensure that an integer N is in range of a 64-bit 2’s complement signed integer. Wrap-around if needed.
qvm
.
Converts a magicl matrix MAT into a SINGLE-KRAUS SUPEROPERATOR.
qvm
.
Returns a column vector of amplitudes represented by the tuple of qubits QUBITS.
qvm
.
Return the first rule that matches INSTR/POSITION in the list RULES.
qvm
.
Find measure chains containing all qubits 0 <= q < n.
qvm
.
Find a matrix application function for the Hilbert subspace designated by QUBITS (a NAT-TUPLE).
This function will compile new ones on-demand.
qvm
.
Find a projector function for the Hilbert subspace designated by QUBIT (a QUIL:QUBIT).
This function will compile new ones on-demand.
qvm
.
Find a serial gate application kernel for an N-qubit operator.
qvm
.
Force evaluation of an application parameter PARAM, with respect to the specified QVM.
qvm
.
Computes the number of qubits encoded by a vectorized density matrix.
qvm
.
Return a complex number with Gaussian-random real and imaginary parts.
qvm
.
Generate code (a single form) to modify a base address ADDRESS (as produced by a complement iteration loop; represented by a symbol bound to that address) with the flags FLAGS (a non-negative FIXNUM) and qubits QUBITS (a NAT-TUPLE).
This function is similar to the function SET-QUBIT-COMPONENTS-OF-AMPLITUDE-ADDRESS. See its documentation for details.
qvm
.
Generate the complement iteration loop for an operator acting on the qubits QUBITS operating on the wavefunction WAVEFUNCTION.
BODY-GEN should be a unary function which takes as an argument the symbol referring to the generated address, and produces a form that uses that address. This form should act as the operator.
DOTIMES-ITERATOR specifies the DOTIMES-like macro that is used for iteration.
qvm
.
Generate LET-like code that extracts amplitudes designated by the qubits QUBITS.
COMPLEMENT-ADDRESS should be a symbol which should be (eventually) bound to the complement address, like that produced by GENERATE-COMPLEMENT-ITERATION.
WAVEFUNCTION should be a symbol which should be (eventually) bound to a wavefunction.
BODY-GEN should be a two-argument function. The first argument will be a list of symbols that will be bound to the wavefunction-addressed values in order. The second argument will be a list of SETF-able accessor forms for those values.
GENERATE-EXTRACTIONS will enable or disable the generation of the values. Setting this to NIL will cause the first argument of BODY-GEN to be NIL.
qvm
.
Generate a lambda form which takes two arguments, a QUANTUM-OPERATOR and a QUANTUM-STATE, which efficiently applies that operator to that state, lifted from the Hilbert space designated by QUBITS.
QUBITS should be a NAT-TUPLE of qubits representing the Hilbert space.
qvm
.
Generate a lambda form which takes two arguments, a QUANTUM-OPERATOR and a QUANTUM-STATE, which efficiently applies that operator to that state, lifted from the Hilbert space designated by QUBITS. QUBITS should be a NAT-TUPLE of qubits representing the Hilbert space.
qvm
.
Generate N x N matrix multiplication code.
MATRIX should either be:
- a symbol which should (eventually) be bound to a QUANTUM-OPERATOR object.
- a QUANTUM-OPERATOR.
COLUMN should be a list of symbols all of which should (eventually) be bound to the vector being multiplied.
RESULT should be a list of SETF-able forms to which the result will be assigned.
qvm
.
Builds a list of kraus operators from the base matrices in STANDARD-MATRICES, each scaled by a corresponding probability in PROBS.
qvm
.
Generate a lambda form which takes one argument, a QUANTUM-STATE, which efficiently applies a permuting operator to that state, lifted from the Hilbert space designated by QUBITS.
PERMUTATION should be the permutation representation of that operator.
QUBITS should be a NAT-TUPLE of qubits representing the Hilbert space.
qvm
.
Given a list of accessor forms ACCESSORS, generate a form which permutes those according to the permutation PERMUTATION.
This function is used to permute wavefunction amplitudes.
qvm
.
Generate a lambda expression which takes a wavefunction and non-deterministically measures QUBIT. The lambda will mutate the wavefunction and return the bit measured.
DOTIMES-ITERATOR controls which style of DOTIMES is used.
qvm
.
Let G(n) be the Nth number in Gray code order with G(0) = 0, i.e., GRAY-ENCODE. Then (G (1+ n)) == (LOGXOR (G n) (ASH 1 (GRAY-BIT n))).
qvm
.
Given an amplitude index INDEX, find the amplitude address for the INDEX’th basis state with QUBIT in the STATE state.
Specifically, given an integer whose bit string is
INDEX = LLLLRRRR,
compute the address
Result = LLLL{0,1}RRRR
which is the index with a {1, 0} injected at the QUBIT’th position.
qvm
.
Initialize the active MT19937 random state using the current time.
qvm
.
Inject a 0 at the nth position. Example:
(INJECT-BIT #b1111 1) => #b11101
qvm
.
Given a column vector of amplitudes COLUMN representing the qubits QUBITS, insert this state back into WAVEFUNCTION.
qvm
.
Install the gates specified by the program PROGRAM into the QVM.
This will not clear previously installed gates from the QVM.
qvm
.
Join two (disjoint) qubit subsystems SS1 and SS2 into a larger qubit subsystem.
qvm
.
Compute the Kronecker product of matrices A and B.
qvm
.
List all of the bitstring states in the order that QUBITS are specified, using CLASSICAL-STATE as the base state.
qvm
.
Number of executable instructions in the program loaded into the QVM.
qvm
.
Look up the definition of the gate named GATE (a symbol or string) within the QVM. Return NIL if not found.
If ERROR is T, then signal an error when the gate wasn’t found.
qvm
.
Build a MIXED-STATE-QVM with a DENSITY-MATRIX-STATE representing NUM-QUBITS qubits.
qvm
.
Generate a Kraus map that represents a noisy version of the standard gate U identified by GATE-NAME. The resulting gate is equivalent to I’ * U, i.e., the ideal gate U followed by a noisy identity gate I’ as defined in MAKE-PAULI-NOISE-MAP.
qvm
.
Allocate POSIX shared memory, named by NAME whose size is at least SIZE octets. (It will be rounded to the next multiple of a page.)
Return a POSIX-SHARED-MEMORY object.
Make a subsystem (in the zero-state) for the qubits QUBITS.
Note: Duplicate qubits are ignored.
qvm
.
Map the classical state CLASSICAL-STATE to its component amplitudes under the transformation dictated by the Quil instruction INSTRUCTION, which should be a gate application.
Return two values:
1. A list of the classical states that this state maps to.
2. A list of complex amplitude factors associated with those states.
qvm
.
An optimized call to
(MAP-REORDERED-AMPLITUDES 0 FUNCTION (NAT-TUPLE-COMPLEMENT N QUBITS))
up to amplitude ordering.
qvm
.
A parallel version of #’MAP-COMPLEMENT, when the number of qubits is large enough.
qvm
.
A parallel version of #’MAP-COMPLEMENT.
qvm
.
Iterate through all variations of the amplitude address STARTING-ADDRESS, varying the qubits specified by the tuple QUBITS. For each newly loaded address, call the function FUNCTION.
FUNCTION should be a binary function, and will receive (1) an index running from 0 below 2^|qubits|, and (2) the varied amplitude address.
qvm
.
Parallel version of #’MAP-REORDERED-AMPLITUDES, when the number of qubits is large enough.
qvm
.
Parallel version of #’MAP-REORDERED-AMPLITUDES.
qvm
.
Call the function F on the endpoints of NUM-RANGES half-open (on the right) intervals whose union is [0, TOTAL). The signature of F should be
START * END -> NIL.
qvm
.
Compute the product of the complex matrix (represented as a square array of CFLONUMs) and a complex vector (represented as a CFLONUM vector) in-place.
qvm
.
Generate code to compute the product of the N x N complex matrix (represented as a square array of CFLONUMs) and a length-N complex column vector (represented as a CFLONUM vector).
qvm
.
Performs a measurement on the qubit addressed by Q in the quantum abstract machine QAM, and stores the measured
bit in the classical bit addressed by C.
Return two values:
1. The resulting QAM.
2. The measured classical bit.
Convert a measure chain into a MEASURE-ALL pseudo-instruction.
qvm
.
qvm
.
Return the CLASSICAL-MEMORY that can be read to/written from as viewed by MEMORY-VIEW.
qvm
.
Find the midpoint of two non-negative fixnums A and B where A <= B.
qvm
.
Computes the probability distribution of measurement outcomes (a vector) associated with the STATE of the DENSITY-QVM.
qvm
.
Create a new nat tuple with the elements ELEMENTS (each of type NAT-TUPLE-ELEMENT).
qvm
.
Compute the number of elements in the nat tuple NT.
qvm
.
Compute the complement of the nat tuple NT in a universe of (0 1 2 ... N-1).
qvm
.
In what position is ELT in the nat-tuple NT?
qvm
.
Compute the length/L2 norm of the wavefunction WAVEFUNCTION.
qvm
.
Returns the concatenated predicate name !NAME
qvm
.
Returns the concatenated predicate name NAME1|NAME2
qvm
.
Compute the outer product of two equally-sized column vectors U and V (specifically UV^dagger).
qvm
.
Decompose a permutation PERMUTATION represented as a sequence of non-negative integers into a list of transpositions represented as conses.
qvm
.
Randomly perturb the values of the bits in MEASURED-BITS in accordance with any available readout POVMs on the QVM. Returns an updated list of measured bits.
qvm
.
Given the readout error encoded in the assignment probabilities P00, P01, P10, P11, randomly sample the observed (potentially corrupted) measurement outcome.
qvm
.
Is N equal to some non-negative integer power of two?
qvm
.
Compute the sum of F(X) for X in STATE, in parallel. F should be a unary function mapping CFLONUMs to FLONUMs.
qvm
.
Produce a valid, applicable gate from the application GATE-APPLICATION.
qvm
.
Save the DEPOLARIZATION-PROBABILITY for QUBIT. The depolarizing channel represents the average gate over-rotation/under-rotation noise. It is specified by DEPOLARIZATION-PROBABILITY, which is the probability of overrotation/underrotation for the given QUBIT.
qvm
.
Save the readout POVMs for the FRO on the specified QUBIT on the QVM. The FRO is assumed to be the average readout fidelity (avg of p(1|1) and p(0|0)) so as an approximation, we set p(0|0) = p(1|1) = fR0 in the READOUT-POVMS assignment probabilities.
qvm
.
The maximum number of qubits allowed in order to use a specified serial kernel. The value of this function also takes into account *QUBITS-REQUIRED-FOR-PARALLELIZATION*.
qvm
.
Set the POVM for a QUBIT in this NOISE-MODEL.
qvm
.
Evaluate that T1 is valid, and save it for the specified QUBIT in the QVM.
qvm
.
Evaluate that T2 is valid and save it for the specified QUBIT in the QVM.
qvm
.
Evaluate that TPHI is valid and save it for the specified QUBIT in the QVM.
qvm
.
qvm
.
Randomize the elements of WAVEFUNCTION resulting in a valid complex unit vector.
qvm
.
Zero out all of the classical memory of the qvm QVM.
qvm
.
Round X up to the next multiple of MULTIPLE.
qvm
.
Check if RULE is matched by instruction data INSTR and the POSITION of the match request.
qvm
.
Comparator function for the PRIORITY of 2 noise rules. Returns true if the priority of R1 is >= to the priority of R2.
qvm
.
Implementation of SAMPLE-WAVEFUNCTION-AS-DISTRIBUTION-IN-PARALLEL-TRULY, un-parallelized,
but for every probability in the PS (type: (VECTOR FLONUM)). Return a
vector of sampled amplitude addresses.
qvm
.
Sample the wavefunction as if it was a probability distribution.
Specifically, let C(b) = sum_{k=0}^{b} |wf[k]|^2. Compute the smallest b’ such that C(b’) > p.
qvm
.
Produce NUM-SAMPLES bitstring samples of the wavefunction WF according to its interpretation as a probability distribution.
qvm
.
Set the amplitude address to the bits within the non-negative integer FLAGS for the corresponding tuple of qubit indices QUBITS. (Ordered LSB to MSB.)
qvm
.
Return the size, in octets, needed to store a simple-array of NUM-ELEMENTS ELEMENT-TYPE objects.
qvm
.
Return two values: a specialized vector of NUM-ELEMENTS for ELEMENT-TYPE created at POINTER, and a finalizer that is called to clean up that vector.
qvm
.
Slurp all of the memory of MEMORY into a vector.
qvm
.
Subdivide TOTAL (probably representing a vector length) into NUM-RANGES as-equal-as-possible ranges.
The result will be a list of cons cells representing half-open intervals (on the right) whose union is [0, total).
qvm
.
Does the subsystem SS contain the qubits QUBIT?
qvm
.
Does the subsystem SS contain the qubits designated by the bit-set QUBIT-SET?
qvm
.
How many qubits does the subsystem SS represent?
qvm
.
What logical qubit number does the physical qubit PHYS-QUBIT have in the subsystem SS?
(The "logical qubit" is the relative position of the qubit in the system.)
qvm
.
Convert SOP into a MAGICL:MATRIX or a LIST of them.
qvm
.
The number of qubits represented by the wavefunction WAVEFUNCTION.
qvm
.
qvm
.
mixed-state-qvm
) mixed-state-qvm) ¶automatically generated writer method
pure-state-qvm
) pure-state-qvm) ¶The unpermuted wavefunction in standard order.
qvm
.
pure-state
)) ¶A second wavefunction used when applying a noisy quantum channel. Applying a Kraus map generally requires evaluating psi_j = K_j * psi for several different j, making it necessary to keep the original wavefunction around. This value should be a QUANTUM-STATE whose size is compatible with the number of qubits of the CHANNEL-QVM. The actual values can be initialized in any way because they will be overwritten. As such, it merely is scratch space for intermediate computations, and hence should not be otherwise directly accessed.
qvm
.
pure-state
)) ¶A second wavefunction used when applying a noisy quantum channel. Applying a Kraus map generally requires evaluating psi_j = K_j * psi for several different j, making it necessary to keep the original wavefunction around. This value should be a QUANTUM-STATE whose size is compatible with the number of qubits of the CHANNEL-QVM. The actual values can be initialized in any way because they will be overwritten. As such, it merely is scratch space for intermediate computations, and hence should not be otherwise directly accessed.
qvm
.
quantum-system-state
)) ¶automatically generated reader method
qvm
.
posix-shared-memory-allocation
)) ¶automatically generated reader method
name
.
qvm
.
density-qvm
)) ¶pure-state
)) ¶The wavefunction of a pure state.
Apply every kraus map in the list KRAUS-MAPS to the state of the system.
qvm
.
basic-noise-qvm
) (instr gate-application
) kraus-ops) ¶channel-qvm
) (instr gate-application
) kraus-maps) ¶Given a QVM and a (measurement) instruction INSTR, corrupt the readout bit according to the POVM specifications of QVM.
qvm
.
noisy-qvm
) (instr compiled-measurement
)) ¶density-qvm
) (instr measure-discard
)) ¶density-qvm
) (instr measure
)) ¶basic-noise-qvm
) (instr measure-discard
)) ¶basic-noise-qvm
) (instr compiled-measurement
)) ¶basic-noise-qvm
) (instr measure
)) ¶channel-qvm
) (instr measure-discard
)) ¶channel-qvm
) (instr measure
)) ¶channel-qvm
) (instr compiled-measurement
)) ¶Apply noise from a kraus map KRAUS-OPS to the system. Randomly select a kraus operator from KRAUS-OPS using inverse transform sampling to apply to the STATE of the QVM system.
qvm
.
qvm
.
density-matrix-state
) (instr measure-discard
)) ¶pure-state
) (instr measure-discard
)) ¶qvm
.
basic-noise-qvm
)) ¶To calculate the kraus operators for T1, T2, etc. noise, a gate time value is needed. Ideally, this gate time should be the duration of the gate preceding the application of the kraus noise. As an approximation, this value should represent the average gate time of the gates that will be run.
qvm
.
density-matrix-state
)) ¶pure-state
)) ¶qvm
.
classical-memory-mixin
)) ¶classical-memory-subsystem
)) ¶A table mapping names to allocated memories.
qvm
.
classical-memory-mixin
)) ¶classical-memory-subsystem
)) ¶A description of the structure of the memory of the abstract machine.
qvm
.
clifford-application
)) ¶automatically generated reader method
Compile the instruction ISN to some more efficient representation, if possible. May return the same ISN back.
qvm
.
density-qvm
) isn) ¶channel-qvm
) isn) ¶pure-state-qvm
) (isn measurement
)) ¶gate-application
)) ¶compiled-instruction
)) ¶mixed-state-qvm
) isn) ¶Compile the program loaded into the qam QAM so as to optimize execution.
qvm
.
depolarizing-qvm
)) ¶density-qvm
)) ¶channel-qvm
)) ¶mixed-state-qvm
)) ¶pure-state-qvm
)) ¶Compile the operator OP into an efficient representation. Return two values:
1. The class name to instantiate.
2. The COMPILED-GATE-APPLICATION initargs.
If the gate can’t be compiled, return (VALUES NIL NIL).
qvm
.
compiled-gate-application
)) ¶The operator (a FUNCTION) which, at least as one of its arguments, modifies the wavefunction.
qvm
.
compiled-inlined-matrix-gate-application
)) ¶The (static) matrix represented by this application.
compiled-matrix-gate-application
)) ¶The (static) matrix represented by this application.
Construct a new gate from GATE with corresponding matrix entries conjugated.
qvm
.
basic-noise-qvm
)) ¶basic-noise-qvm
)) ¶A hash table of qubit to depolarization operators, representing gate application noise. Gate over-rotations and under-rotations average out to the depolarizing channel.
qvm
.
basic-noise-qvm
)) ¶basic-noise-qvm
)) ¶A value to keep track of the elpased time of the program. The elapsed time is used for calculating the kraus operators of some noise value at a given point in the program.
qvm
.
density-matrix-state
)) ¶The contents of a density matrix ρ as a one-dimensional vector. For a state of N qubits, this vector should be of length 2^(2*N).
qvm
.
density-matrix-state
)) ¶density-matrix-state
)) ¶The contents of a density matrix ρ as a one-dimensional vector. For a state of N qubits, this vector should be of length 2^(2*N).
qvm
.
classical-memory-mixin
)) ¶classical-memory-mixin
)) ¶A table mapping gate names to their GATE-instance definition.
Get the excited state probability from the wavefunction (if PURE-STATE) or density matrix (if DENSITY-MATRIX-STATE).
qvm
.
pure-state
) qubit) ¶density-matrix-state
) qubit) ¶qvm
.
density-matrix-state
)) ¶2D array displaced to ELEMENTS-VECTOR
The protocol for MEASURE-ALL differs by the STATE type of the QVM.
qvm
.
density-matrix-state
) (qvm basic-noise-qvm
)) ¶pure-state
) (qvm basic-noise-qvm
)) ¶density-matrix-state
) (qvm channel-qvm
)) ¶pure-state
) (qvm channel-qvm
)) ¶density-matrix-state
) (qvm base-qvm
)) ¶pure-state
) (qvm base-qvm
)) ¶qvm
.
measure-all
)) ¶A list of qubit-mref pairs to store, in order.
qvm
.
noisy-qvm
)) ¶Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.
density-qvm
)) ¶automatically generated reader method
qvm
.
noisy-qvm
)) ¶Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.
density-qvm
)) ¶automatically generated writer method
Return the number of qubits represented by the STATE.
qvm
.
density-matrix-state
)) ¶pure-state
)) ¶qvm
.
memory-index-out-of-bounds
)) ¶from
.
qvm
.
memory-index-out-of-bounds
)) ¶qvm
.
memory-index-out-of-bounds
)) ¶name
.
qvm
.
memory-index-out-of-bounds
)) ¶to
.
qvm
.
noise-rule
)) ¶A list of kraus maps to apply when the rule is matched. Each kraus map is a list of kraus operators.
qvm
.
pure-state
)) ¶A reference to the original pointer of amplitude memory, so the amplitudes can sit in the right place at the end of a computation.
qvm
.
classical-memory-mixin
)) ¶classical-memory-mixin
)) ¶The program counter.
qvm
.
depolarizing-qvm
)) ¶depolarizing-qvm
)) ¶Probability of a Pauli X gate happening after a gate application or reset.
qvm
.
depolarizing-qvm
)) ¶depolarizing-qvm
)) ¶Probability of a Pauli Y gate happening after a gate application or reset.
qvm
.
depolarizing-qvm
)) ¶depolarizing-qvm
)) ¶Probability of a Pauli Z gate happening after a gate application or reset.
qvm
.
depolarizing-qvm
)) ¶depolarizing-qvm
)) ¶Probability of a Pauli X gate happening before a measurement.
qvm
.
depolarizing-qvm
)) ¶depolarizing-qvm
)) ¶Probability of a Pauli Y gate happening before a measurement.
qvm
.
depolarizing-qvm
)) ¶depolarizing-qvm
)) ¶Probability of a Pauli Z gate happening before a measurement.
qvm
.
classical-memory-mixin
)) ¶classical-memory-mixin
)) ¶The program to be executed.
qvm
.
compiled-measurement
)) ¶Projection function which takes a WAVEFUNCTION as an argument and returns the measured bit result.
qvm
.
noisy-qvm
)) ¶Noisy readout encoded as diagonal single qubit
POVM given as a 4-element list
(p(0|0) p(0|1)
p(1|0) p(1|1))
which for each qubit gives the probability p(j|k) of measuring outcome j given actual state k. Note that we model purely classical readout error, i.e., the post measurement qubit state is always k, but the recorded outcome j may be different.
density-qvm
)) ¶automatically generated reader method
basic-noise-qvm
)) ¶A hash-table of qubit idx to a list of povms, representing the readout assignment probabilities (p(0|0) p(0|1) p(1|0) p(1|1)).
noise-model
)) ¶A hash table of qubit to readout noise assignment probabilities, given as a 4-element list ((p(0|0) p(0|1) p(1|0) p(1|1)).
qvm
.
noisy-qvm
)) ¶Noisy readout encoded as diagonal single qubit
POVM given as a 4-element list
(p(0|0) p(0|1)
p(1|0) p(1|1))
which for each qubit gives the probability p(j|k) of measuring outcome j given actual state k. Note that we model purely classical readout error, i.e., the post measurement qubit state is always k, but the recorded outcome j may be different.
density-qvm
)) ¶automatically generated writer method
basic-noise-qvm
)) ¶A hash-table of qubit idx to a list of povms, representing the readout assignment probabilities (p(0|0) p(0|1) p(1|0) p(1|1)).
noise-model
)) ¶A hash table of qubit to readout noise assignment probabilities, given as a 4-element list ((p(0|0) p(0|1) p(1|0) p(1|1)).
Determine whether the state-elements are in the correct QVM slot after doing a computation that requires the additional space. This is only relevant for a PURE-STATE.
qvm
.
density-matrix-state
)) ¶pure-state
)) ¶Bring all qubits of the quantum abstract machine QAM to the zero state.
qvm
.
density-qvm
)) ¶For a QUBIT belonging to a QVM specify a POVM to encode
possible readout errors.
POVM must be a 4-element list of double-floats.
qvm
.
density-qvm
) qubit povm) ¶qvm
.
compiled-gate-application
)) ¶The gate object being represented by this application.
qvm
.
compiled-instruction
)) ¶compiled-instruction
)) ¶The instruction that was compiled to produce this one.
qvm
.
stabilizer-qvm
)) ¶automatically generated reader method
qvm
.
mixed-state-qvm
)) ¶automatically generated reader method
pure-state-qvm
)) ¶The unpermuted wavefunction in standard order.
qvm
.
base-qvm
)) ¶base-qvm
)) ¶A hash table of gate name to SUPEROPERATOR. These superoperator definitions are meant to override the gate name definitions stored in GATE-DEFINITIONS, such that a superoperator will be applied to the state of the QVM if the current gate name matches an entry in the SUPEROPERATOR-DEFINITIONS.
Only relevant for PURE-STATE – swap AMPLITUDES with TRIAL-AMPLITUDES.
qvm
.
pure-state
)) ¶qvm
.
basic-noise-qvm
)) ¶basic-noise-qvm
)) ¶Hash table of qubit idx to T1 value for each qubit to simulate
qvm
.
basic-noise-qvm
)) ¶basic-noise-qvm
)) ¶Hash table of qubit idx to T2 value for each qubit to simulate
qvm
.
density-matrix-state
)) ¶density-matrix-state
)) ¶A placeholder for computations on the elements-vector of a DENSITY-MATRIX-STATE.
qvm
.
basic-noise-qvm
)) ¶basic-noise-qvm
)) ¶Hash table of qubit idx to TPHI value for each qubit to simulate.
qvm
.
classical-memory-mixin
)) ¶A unary function taking a QVM and implementing Quil’s WAIT logic. (The default does nothing and just warns.)
measure-all
)) ¶cl-quil
.
measure-all
) stream) ¶cl-quil
.
compiled-instruction
) stream) ¶cl-quil
.
clifford-application
) stream) ¶cl-quil
.
A "view" into a chunk of (possibly aliased) classical memory. The view constitutes the memory itself along with functions to read and write that memory.
qvm
.
structure-object
.
common-lisp
.
unsigned-byte
(error "you need to provide the length.")
This slot is read-only.
qvm:classical-memory
(error "you need a root classical memory.")
This slot is read-only.
(or null qvm:classical-memory)
This slot is read-only.
function
This slot is read-only.
function
This slot is read-only.
Representation of some POSIX shared memory.
Representation of the state of a subsystem of qubits.
Representation of a linear operator on density operators.
qvm
.
algebraic-data-type
.
qvm
.
%set-state
.
(setf amplitudes)
.
amplitudes
.
initialize-instance
.
measure
.
measure-all
.
measure-all-state
.
measure-all-state
.
number-of-qubits
.
(setf program-compiled-p)
.
program-compiled-p
.
reset-quantum-state
.
run
.
set-superoperator
.
state
.
(setf superoperator-definitions)
.
superoperator-definitions
.
transition
.
transition
.
transition
.
transition
.
transition
.
Number of qubits being simulated by the QVM.
alexandria:non-negative-fixnum
(error ":number-of-qubits is a required initarg to base-qvm.")
:number-of-qubits
This slot is read-only.
The state of the quantum system simulated by the QVM.
:state
Has the loaded program been compiled?
A hash table of gate name to SUPEROPERATOR. These superoperator definitions are meant to override the gate name definitions stored in GATE-DEFINITIONS, such that a superoperator will be applied to the state of the QVM if the current gate name matches an entry in the SUPEROPERATOR-DEFINITIONS.
(make-hash-table :test (quote equalp))
:superoperator-definitions
A gate application that’s actually a Clifford.
A representation of a compiled gate application.
qvm
.
compiled-instruction
.
gate-application
.
The gate object being represented by this application.
:source-gate
This slot is read-only.
The operator (a FUNCTION) which, at least as one of its arguments, modifies the wavefunction.
:apply-operator
This slot is read-only.
A compiled GATE-APPLICATION that has the matrix inlined. Note that this is a subclass of GATE-APPLICATION.
A compiled GATE-APPLICATION. Note that this is a subclass of GATE-APPLICATION.
A compiled MEASURE, regardless of its classical effect.
qvm
.
compiled-instruction
.
measurement
.
Projection function which takes a WAVEFUNCTION as an argument and returns the measured bit result.
:projector-operator
This slot is read-only.
A compiled GATE-APPLICATION where the gate happens to be a permutation gate.
qvm
.
A qvm for simulating mixed-state quantum systems.
A QUANTUM-SYSTEM-STATE contains the quantum mechanical state of the QVM and any additional helper objects used in performing computations on the state.
A QVM that can efficiently simulate Clifford circuits and measurement.
A finalizer thunk. Used for the effect of freeing some memory.
qvm
.
The NAT-TUPLE type. A "nat tuple" represents an ordered list of non-negative integer indexes.
In the context of the QVM, this represents a particular Hilbert space.
qvm
.