The qvm Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The qvm Reference Manual

This is the qvm Reference Manual, version 1.8.1, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 09:40:16 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Rigetti Quantum Virtual Machine

pipeline status

This directory contains two projects. The first, qvm, is a classical implementation of the Quantum Abstract Machine (QAM), called a "Quantum Virtual Machine" (QVM). The second, qvm-app, is the application interface to interacting with the QVM, either directly through the qvm binary or via its server interface.

The definition of the QAM was developed at Rigetti in a paper titled A Practical Quantum Instruction Set Architecture.

QVM, the library

The QVM library is contained within ./src/, and provides the implementation of the Quantum Abstract Machine. It evaluates Quil programs (parsed and compiled by quilc) on a virtual machine that can model various characteristics of (though without needing access to) a true quantum computer.

The library is released under the Apache license 2.0.

Usage

The QVM library is available on Quicklisp, but of course may not have the latest features. It can be loaded simply with:

* (ql:quickload :qvm)

Alternatively, one can download and load it manually. Please read and follow the instructions in lisp-setup.md#install-quicklisp to get Quicklisp installed. Pay particular attention to the section "Telling Quicklisp Where Your Code Is".

Download both this repository and quilc into the ql:*local-project-directories* location. If all is correct, the qvm library can be loaded with

$ sbcl
* (ql:quickload :qvm)
(:QVM)

QVM objects are created with (qvm:make-qvm n) where n is the number of qubits the QVM should support; a program can then be loaded into the QVM object with (qvm:load-program *qvm* *program*) where *qvm* is a QVM object and *program* is a cl-quil:parsed-program object.

Alternatively, the qvm:run-program function will handle QVM object creation. For example,

* (setq *qvm* (qvm:run-program 2 (cl-quil:parse-quil "H 0")))

creates a 2-qubit QVM object and on it runs the Quil program H 0.

The qubit amplitudes can be inspected

* (qvm::amplitudes *qvm*)
#(#C(0.7071067811865475d0 0.0d0) #C(0.7071067811865475d0 0.0d0)
  #C(0.0d0 0.0d0) #C(0.0d0 0.0d0))

which shows, as expected, that H 0 has put qubit-0 (the first two complex numbers above) into an equal superposition of states |0> and |1>.

Measurement of a quantum state causes it to collapse into one of its basis states (|0> or |1>). This can be simulated with

* (qvm:measure-all *qvm*)
#<PURE-STATE-QVM {1004039753}>
(0 0)

Inspecting the QVM object's state shows that this effect mutates the information stored on the QVM; i.e. the previous state information is lost

* (qvm::amplitudes *qvm*)
#(#C(1.0d0 0.0d0) #C(0.0d0 0.0d0)
  #C(0.0d0 0.0d0) #C(0.0d0 0.0d0))

Qubit zero's state has collapsed into the state |0>. Repeating this process (from creating the QVM object to measuring qubits) would show that both states would each come up with probability 0.5.

* (loop :with results := (vector 0 0)
        :with program := (cl-quil:parse-quil "H 0")
        :repeat 100
        :for (qvm state) := (multiple-value-list (qvm:measure (qvm:run-program 1 program) 0))
        :do (incf (aref results state))
        :finally (return results))
#(54 46)

Examples

The QVM comes with some example code to illustrate usage of the QVM. The example code can be found under ./examples/. To run the example code, first load qvm-examples

* (ql:quickload :qvm-examples)
(:QVM-EXAMPLES)

The function bit-reversal-circuit takes a list of qubit indices and returns a list of instructions that will reverse the qubit amplitudes in "bit-reversal order" (e.g., the coefficient of |1110> gets mapped to |0111>): that the amplitudes get reversed

(qvm-examples:bit-reversal-circuit '(1 2 3 4))
(#<SWAP 1 4> #<SWAP 2 3>)

For a given list of qubit indices, the function qft-circuit returns a Quantum Fourier transform Quil program ready to be passed to quilc for compilation.

* (qvm-examples:qft-circuit '(1 2 3 4))
#<CL-QUIL:PARSED-PROGRAM {10040ABEE3}>

To inspect the object, we can use the cl-quil::print-parsed-program function

* (cl-quil::print-parsed-program (qvm-examples:qft-circuit '(1 2 3 4)))
H 4
CPHASE(pi/2) 3 4
H 3
CPHASE(pi/4) 2 4
CPHASE(pi/2) 2 3
H 2
CPHASE(pi/8) 1 4
CPHASE(pi/4) 1 3
CPHASE(pi/2) 1 2
H 1
SWAP 1 4
SWAP 2 3

QVM, the application

The QVM application is contained with ./app/src/, and provides a stand-alone interface to the QVM library. It can be invoked directly with the binary executable, or alternatively it can provide a server that can be used over the network. Each has their benefits: the former permits a simplified interface using the command-line switches (see output of qvm --help), while the latter allows many remote connections to a single in-memory QVM.

The application is released under the GNU Affero General Public License v3.0.

Usage

To build the QVM application follow instructions in lisp-setup.md. In the top-level directory, run the Makefile with

$ make qvm

This will produce a binary executable qvm in the same directory.

In some situtations, using a large number of qubits may cause heap exhaustion. There are two options to ameliorate this.

The first is to increase the memory available for the QVM, recompile and specify the workspace size (in MB)

$ make QVM_WORKSPACE=4096 qvm

The second is to use a different allocator when running the QVM, by using the --default-allocator argument with "foreign". For example, to run a 30 qubit benchmark on a QVM configured for far less memory, one can do:

$ qvm --default-allocator "foreign" --benchmark 30 -c

This is not the default since this memory is not fully managed by the application.

The QVM application has a few command-line switches used to configure the QVM. To explore those options, see the output of the following command:

$ ./qvm --help

By default, the QVM accepts programs from stdin and writes results to stdout. Log messages are written to stderr.

$ echo 'H 0' | ./qvm
******************************
* Welcome to the Rigetti QVM *
******************************
Copyright (c) 2016-2019 Rigetti Computing.

(Configured with 8192 MiB of workspace and 8 workers.)

<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Selected simulation method: pure-state
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Reading program.
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Allocating memory for QVM of 1 qubits.
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Allocation completed in 7 ms.
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Loading quantum program.
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Executing quantum program.
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Execution completed in 4 ms.
<134>1 2019-03-07T22:56:55Z workstation.local qvm 21177 - - Printing classical memory and 1-qubit state.
Classical memory (low -> high indexes):
    No memory.
Amplitudes:
    |0>: 0.7071067811865475,                                    P= 50.0%
    |1>: 0.7071067811865475,                                    P= 50.0%

Alternatively the QVM can be started as a server that will accept instructions over a network connection

$ ./qvm -S
******************************
* Welcome to the Rigetti QVM *
******************************
Copyright (c) 2016-2019 Rigetti Computing.

(Configured with 2048 MiB of workspace and 8 workers.)

<134>1 2019-01-28T19:06:07Z workstation.local qvm 3118 - - Selected simulation method: pure-state
<134>1 2019-01-28T19:06:07Z workstation.local qvm 3118 - - Starting server on port 5000.

This is how the pyQuil Python library communicates with a QVM.

Testing

Tests can be run from the Makefile

make test

or from within SBCL

* (asdf:test-system :qvm)

Any contribution to this project should foremost not break any current tests (run tests before making a pull request), and should be accompanied by relevant new tests.

Clearing the Cache

Lisp caches a lot of builds so that not every single file needs to be recompiled. In rare instances, there's confusion and the cache doesn't get properly invalidated. (This can happen when moving files across machines, for example.) Lisp's cache and Quicklisp's system index can be cleaned by doing the following command:

make cleanall

This will delete any built executables as well.

Automated Packaging with Docker

The CI pipeline for qvm produces a Docker image, available at rigetti/qvm.

To get the latest stable version of qvm, run docker pull rigetti/qvm.

Running the QVM with Docker

As outlined above, the QVM supports two modes of operation: stdin and server.

To run the qvm in stdin mode, do the following:

echo "H 0" | docker run --rm -i rigetti/qvm

To run the qvm in server mode, do the following:

docker run --rm -it -p 5000:5000 rigetti/qvm -S

If you would like to change the port of the server to PORT, you can alter the command as follows:

docker run --rm -it -p PORT:PORT rigetti/qvm -S -p PORT

Release Process

  1. Update VERSION.txt and dependency versions (if applicable) and push the commit to master.
  2. Push a git tag vX.Y.Z that contains the same version number as in VERSION.txt.
  3. Verify that the resulting build (triggered by pushing the tag) completes successfully.
  4. Publish a release using the tag as the name.
  5. Close the milestone associated with this release, and migrate incomplete issues to the next one.

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 qvm

Author

Robert Smith <robert@rigetti.com>

License

Apache License 2.0 (See LICENSE.txt)

Description

An implementation of the Quantum Abstract Machine.

Version

1.8.1

Defsystem Dependency

cffi-grovel

Dependencies
Source

qvm.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 qvm.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/qvm.asd

Systems

qvm (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 qvm/package.lisp

Parent

qvm (system)

Location

package.lisp

Packages

qvm


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 qvm/grovel-system-constants.lisp

If Feature

unix

Dependency

package.lisp (file)

Parent

qvm (system)

Location

grovel-system-constants.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 qvm/grovel-shared-memory.lisp

If Feature

unix

Dependency

grovel-system-constants.lisp (file)

Parent

qvm (system)

Location

grovel-shared-memory.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 qvm/config.lisp

Dependency

grovel-shared-memory.lisp (file)

Parent

qvm (system)

Location

config.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.6 qvm/impl/clozure.lisp

If Feature

clozure

Dependency

config.lisp (file)

Parent

qvm (system)

Location

impl/clozure.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.7 qvm/impl/sbcl.lisp

If Feature

sbcl

Dependency

impl/clozure.lisp (file)

Parent

qvm (system)

Location

impl/sbcl.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.8 qvm/impl/lispworks.lisp

If Feature

lispworks

Dependency

impl/sbcl.lisp (file)

Parent

qvm (system)

Location

impl/lispworks.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.9 qvm/utilities.lisp

Dependency

impl/lispworks.lisp (file)

Parent

qvm (system)

Location

utilities.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.10 qvm/floats.lisp

Dependency

utilities.lisp (file)

Parent

qvm (system)

Location

floats.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.11 qvm/allocator.lisp

Dependency

floats.lisp (file)

Parent

qvm (system)

Location

allocator.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.12 qvm/shm.lisp

If Feature

unix

Dependency

allocator.lisp (file)

Parent

qvm (system)

Location

shm.lisp

Exported Definitions

allocate-vector (method)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.13 qvm/linear-algebra.lisp

Dependency

shm.lisp (file)

Parent

qvm (system)

Location

linear-algebra.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.14 qvm/qam.lisp

Dependency

linear-algebra.lisp (file)

Parent

qvm (system)

Location

qam.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.15 qvm/classical-memory.lisp

Dependency

qam.lisp (file)

Parent

qvm (system)

Location

classical-memory.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.16 qvm/wavefunction.lisp

Dependency

classical-memory.lisp (file)

Parent

qvm (system)

Location

wavefunction.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.17 qvm/compile-gate.lisp

Dependency

wavefunction.lisp (file)

Parent

qvm (system)

Location

compile-gate.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.18 qvm/apply-gate.lisp

Dependency

compile-gate.lisp (file)

Parent

qvm (system)

Location

apply-gate.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.19 qvm/qvm.lisp

Dependency

apply-gate.lisp (file)

Parent

qvm (system)

Location

qvm.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.20 qvm/measurement.lisp

Dependency

qvm.lisp (file)

Parent

qvm (system)

Location

measurement.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.21 qvm/transition.lisp

Dependency

measurement.lisp (file)

Parent

qvm (system)

Location

transition.lisp

Exported Definitions
Internal Definitions

force-parameter (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.22 qvm/transition-classical-instructions.lisp

Dependency

transition.lisp (file)

Parent

qvm (system)

Location

transition-classical-instructions.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.23 qvm/depolarizing-noise.lisp

Dependency

transition-classical-instructions.lisp (file)

Parent

qvm (system)

Location

depolarizing-noise.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.24 qvm/noisy-qvm.lisp

Dependency

depolarizing-noise.lisp (file)

Parent

qvm (system)

Location

noisy-qvm.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.25 qvm/density-qvm.lisp

Dependency

noisy-qvm.lisp (file)

Parent

qvm (system)

Location

density-qvm.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.26 qvm/execution.lisp

Dependency

density-qvm.lisp (file)

Parent

qvm (system)

Location

execution.lisp

Exported Definitions
Internal Definitions

nop-count (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.27 qvm/path-simulate.lisp

Dependency

execution.lisp (file)

Parent

qvm (system)

Location

path-simulate.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.28 qvm/misc.lisp

Dependency

path-simulate.lisp (file)

Parent

qvm (system)

Location

misc.lisp

Exported Definitions

program-matrix (function)


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 qvm

Package containing an implementation of a quantum virtual machine.

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *compile-before-running*

Compile programs loaded into the QVM before running them.

Package

qvm

Source

config.lisp (file)

Special Variable: *qubits-required-for-parallelization*

The number of qubits required of a quantum state before it gets operated on in parallel.

Package

qvm

Source

config.lisp (file)

Special Variable: *transition-verbose*

Controls whether each transition is printed with a timing.

Package

qvm

Source

config.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: with-random-state (STATE) &body BODY
Package

qvm

Source

utilities.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Compiler macros

Compiler Macro: cflonum X
Package

qvm

Source

floats.lisp (file)

Compiler Macro: flonum X
Package

qvm

Source

floats.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Functions

Function: apply-matrix-operator ()

Apply the matrix operator OPERATOR to the amplitudes of WAVEFUNCTION specified by the qubits QUBITS.

Package

qvm

Source

wavefunction.lisp (file)

Function: apply-operator ()

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.

Package

qvm

Source

wavefunction.lisp (file)

Function: cflonum X

Coerce X into a CFLONUM.

Package

qvm

Source

floats.lisp (file)

Function: copy-wavefunction ()

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|).

Package

qvm

Source

wavefunction.lisp (file)

Function: count-logical-cores ()

Compute the number of logical cores on the machine.

Package

qvm

Source

utilities.lisp (file)

Function: flonum X

Coerce X into a FLONUM.

Package

qvm

Source

floats.lisp (file)

Function: force-measurement ()

Force the quantum system QVM 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.

Package

qvm

Source

measurement.lisp (file)

Function: load-program QVM PROGRAM &key SUPERSEDE-MEMORY-SUBSYSTEM

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.

Package

qvm

Source

qvm.lisp (file)

Function: make-classical-memory SIZE

Allocate SIZE octets of memory.

Package

qvm

Source

classical-memory.lisp (file)

Function: make-density-qvm NUM-QUBITS &rest INITARGS &key ALLOCATION &allow-other-keys
Package

qvm

Source

density-qvm.lisp (file)

Function: make-pauli-noise-map PX PY PZ

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.

Package

qvm

Source

noisy-qvm.lisp (file)

Function: make-qvm NUM-QUBITS &key CLASSICAL-MEMORY-MODEL ALLOCATION

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 it’s NULL (default), then a standard wavefunction in the Lisp heap will be allocated.

- If it’s a 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

Package

qvm

Source

qvm.lisp (file)

Function: map-amplitudes QVM F

Apply the function F to the amplitudes of the quantum virtual machine QVM in standard order.

Package

qvm

Source

qvm.lisp (file)

Function: memory-bit-ref MEM I
Function: (setf memory-bit-ref) NEW-BIT MEM I
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-descriptors-to-qvm-memory-model DESCRS

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.

Package

qvm

Source

classical-memory.lisp (file)

Function: memory-integer-ref MEM I
Function: (setf memory-integer-ref) NEW-INT MEM I
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-octet-ref MEM I
Function: (setf memory-octet-ref) NEW-OCT MEM I
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-real-ref MEM I
Function: (setf memory-real-ref) NEW-REAL MEM I
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-ref QVM MEMORY-NAME I

Get the memory named MEMORY-NAME at index I in the QVM.

Package

qvm

Source

qvm.lisp (file)

Writer

(setf memory-ref) (function)

Function: (setf memory-ref) NEW-VALUE QVM MEMORY-NAME I

Set the memory named MEMORY-NAME at index I in the QVM to NEW-VALUE.

Package

qvm

Source

qvm.lisp (file)

Reader

memory-ref (function)

Function: normalize-wavefunction ()

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.

Package

qvm

Source

wavefunction.lisp (file)

Function: nth-amplitude QVM N

Get the Nth amplitude of the quantum virtual machine QVM.

Package

qvm

Source

qvm.lisp (file)

Writer

(setf nth-amplitude) (function)

Function: (setf nth-amplitude) NEW-VALUE QVM N

Set the Nth amplitude of the quantum virtual machine QVM.

Package

qvm

Source

qvm.lisp (file)

Reader

nth-amplitude (function)

Function: octets-required-for-quantum-state STATE

The number of octets reqquired to represent a given quantum state.

Package

qvm

Source

linear-algebra.lisp (file)

Function: octets-required-for-qubits N

The number of octets required to represent a state of N qubits.

Package

qvm

Source

linear-algebra.lisp (file)

Function: path-simulate PARSED-PROG INITIAL-CLASSICAL-STATE FINAL-CLASSICAL-STATES

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.

Package

qvm

Source

path-simulate.lisp (file)

Function: prepare-for-parallelization &optional NUM-WORKERS

Prepare for parallelization with the correct number of workers scaling with the number of logical cores of your machine.

If NUM-WORKERS is provided, it can force the number of workers. If it’s greater than 1, then it should be less than the number of logical cores of your machine.

NOTE: This must be done before computations can be done.

Package

qvm

Source

utilities.lisp (file)

Function: probability ()

Convert an amplitude into a probability.

Package

qvm

Source

wavefunction.lisp (file)

Function: program-matrix PP

Compute the matrix of the parsed program PP by way of simulating it on every basis element.

Package

qvm

Source

misc.lisp (file)

Function: qubit-probability ()

The probability that the physical qubit addressed by QUBIT is 1.

Package

qvm

Source

measurement.lisp (file)

Function: run-program NUM-QUBITS PROGRAM

Run the program PROGRAM on a QVM of NUM-QUBITS qubits.

Package

qvm

Source

execution.lisp (file)

Function: seeded-random-state SEED

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.

Package

qvm

Source

utilities.lisp (file)

Function: warm-apply-matrix-operator-cache &key MAX-QUBITS

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: wavefunction-from-path-simulation PARSED-PROG

Compute the wavefunction of the program PARSED-PROG using path simulation.

Package

qvm

Source

path-simulate.lisp (file)

Function: zero-out-classical-memory MEM

Zero out the classical memory MEM.

Package

qvm

Source

classical-memory.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.5 Generic functions

Generic Function: allocate-vector DESCRIPTION

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.

Package

qvm

Source

allocator.lisp (file)

Methods
Method: allocate-vector (DESCR posix-shared-memory-allocation)
Source

shm.lisp (file)

Method: allocate-vector (DESCR c-allocation)
Method: allocate-vector (DESCR lisp-allocation)
Generic Function: allocation-length DESCRIPTION

The length of memory to be allocated, measured in the element type of the vector.

Package

qvm

Source

allocator.lisp (file)

Methods
Method: allocation-length (POSIX-SHARED-MEMORY-ALLOCATION posix-shared-memory-allocation)

automatically generated reader method

Method: allocation-length (C-ALLOCATION c-allocation)

automatically generated reader method

Method: allocation-length (LISP-ALLOCATION lisp-allocation)

automatically generated reader method

Generic Function: apply-gate GATE WAVEFUNCTION QUBITS &rest PARAMETERS

Apply a gate GATE to the wavefunction WAVEFUNCTION 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.

Package

qvm

Source

apply-gate.lisp (file)

Methods
Method: apply-gate (GATE simple-gate) WAVEFUNCTION QUBITS &rest PARAMETERS
Method: apply-gate (GATE parameterized-gate) WAVEFUNCTION QUBITS &rest PARAMETERS
Method: apply-gate (GATE permutation-gate) WAVEFUNCTION QUBITS &rest PARAMETERS
Method: apply-gate (GATE controlled-gate) WAVEFUNCTION QUBITS &rest PARAMETERS
Method: apply-gate (GATE dagger-gate) WAVEFUNCTION QUBITS &rest PARAMETERS
Method: apply-gate (GATE compiled-matrix-gate-application) WAVEFUNCTION QUBITS &rest PARAMETERS
Method: apply-gate (GATE compiled-permutation-gate-application) WAVEFUNCTION QUBITS &rest PARAMETERS
Generic Function: classical-memory-subsystem OBJECT
Package

qvm

Methods
Method: classical-memory-subsystem (PURE-STATE-QVM pure-state-qvm)

The classical memory subsystem of the QVM. No memory by default.

Source

qvm.lisp (file)

Generic Function: invalid-instruction CONDITION
Package

qvm

Methods
Method: invalid-instruction (CONDITION invalid-instruction-encountered)
Source

transition.lisp (file)

Generic Function: invalid-reason CONDITION
Package

qvm

Methods
Method: invalid-reason (CONDITION invalid-instruction-encountered)
Source

transition.lisp (file)

Generic Function: measure QAM Q

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.

Package

qvm

Source

qam.lisp (file)

Methods
Method: measure (QVM density-qvm) Q
Source

density-qvm.lisp (file)

Method: measure (QVM pure-state-qvm) Q
Source

measurement.lisp (file)

Generic Function: measure-all QAM

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.

Package

qvm

Source

qam.lisp (file)

Methods
Method: measure-all (QVM density-qvm)
Source

density-qvm.lisp (file)

Method: measure-all (QVM noisy-qvm)
Source

noisy-qvm.lisp (file)

Method: measure-all (QVM pure-state-qvm)
Source

measurement.lisp (file)

Method: measure-all QAM
Generic Function: number-of-qubits QAM

Return the number of qubits configured on the quantum abstract machine QAM.

Package

qvm

Source

qam.lisp (file)

Methods
Method: number-of-qubits (PURE-STATE-QVM pure-state-qvm)

Number of qubits being simulated.

Source

qvm.lisp (file)

Generic Function: run QAM

Simulate the quantum abstract machine QAM until completion. Return the QAM in its end state.

Package

qvm

Source

qam.lisp (file)

Methods
Method: run (QVM pure-state-qvm)
Source

execution.lisp (file)

Method: run (QVM noisy-qvm) after
Source

noisy-qvm.lisp (file)

Generic Function: set-noisy-gate QVM GATE-NAME QUBITS KRAUS-OPS

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).

Package

qvm

Source

noisy-qvm.lisp (file)

Methods
Method: set-noisy-gate (QVM density-qvm) GATE-NAME QUBITS KRAUS-OPS
Source

density-qvm.lisp (file)

Method: set-noisy-gate (QVM noisy-qvm) GATE-NAME QUBITS KRAUS-OPS
Generic Function: transition QVM INSTR

Execute the instruction INSTR on the QVM.

Return two values:

1. The resulting (possibly modified) QVM after executing INSTR.

2. The new value the program counter should be to execute the next relevant instruction. If this value is null, then execution should be halted.

Package

qvm

Source

transition.lisp (file)

Methods
Method: transition (QVM density-qvm) (INSTR measure)
Source

density-qvm.lisp (file)

Method: transition (QVM density-qvm) (INSTR gate-application)
Source

density-qvm.lisp (file)

Method: transition (QVM noisy-qvm) (INSTR measure)
Source

noisy-qvm.lisp (file)

Method: transition (QVM noisy-qvm) (INSTR gate-application)
Source

noisy-qvm.lisp (file)

Method: transition (QVM depolarizing-qvm) (INSTR measurement) before
Source

depolarizing-noise.lisp (file)

Method: transition (QVM depolarizing-qvm) (INSTR reset) after
Source

depolarizing-noise.lisp (file)

Method: transition (QVM depolarizing-qvm) (INSTR application) after
Source

depolarizing-noise.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-equal-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-greater-than-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-equal-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-less-than-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-equality-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-store)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-load)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-division-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-division-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-division-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-division-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-multiplication-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-multiplication-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-multiplication-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-multiplication-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-subtraction-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-subtraction-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-subtraction-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-subtraction-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-addition-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-addition-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-addition-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-addition-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-convert-bit/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-convert-bit/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-convert-real/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-convert-real/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-convert-integer/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-convert-integer/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exchange)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-move-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exclusive-or-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exclusive-or-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exclusive-or-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exclusive-or-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exclusive-or-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-exclusive-or-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-inclusive-or-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-inclusive-or-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-inclusive-or-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-inclusive-or-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-inclusive-or-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-inclusive-or-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-and-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-and-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-and-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-and-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-and-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-and-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-not-integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-not-octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-not-bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-negate-integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR classical-negate-real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR compiled-gate-application)
Method: transition (QVM pure-state-qvm) (INSTR gate-application)
Method: transition (QVM pure-state-qvm) (INSTR measure-all)
Method: transition (QVM pure-state-qvm) (INSTR measure-discard)
Method: transition (QVM pure-state-qvm) (INSTR measure)
Method: transition (QVM pure-state-qvm) (INSTR jump-unless)
Method: transition (QVM pure-state-qvm) (INSTR jump-when)
Method: transition (QVM pure-state-qvm) (INSTR unconditional-jump)
Method: transition (QVM pure-state-qvm) (INSTR wait)
Method: transition (QVM pure-state-qvm) (INSTR reset-qubit)
Method: transition (QVM pure-state-qvm) (INSTR reset)
Method: transition (QVM pure-state-qvm) (INSTR halt)
Method: transition (QVM pure-state-qvm) (INSTR pragma)
Method: transition (QVM pure-state-qvm) (INSTR no-operation)
Method: transition QVM (INSTR unresolved-application)
Method: transition QVM INSTR around

Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.6 Conditions

Condition: invalid-instruction-encountered ()

An error raised when a gate is invoked incorrectly.

Package

qvm

Source

transition.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: instruction
Initargs

:instruction

Readers

invalid-instruction (generic function)

Slot: reason
Initargs

:because

Readers

invalid-reason (generic function)

Direct Default Initargs
InitargValue
:becausenil
Condition: memory-index-out-of-bounds ()
Package

qvm

Source

classical-memory.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: index
Initargs

:index

Readers

oob-index (generic function)

Slot: from
Initargs

:from

Readers

oob-from (generic function)

Slot: to
Initargs

:to

Readers

oob-to (generic function)

Slot: name
Initargs

:name

Initform

(quote nil)

Readers

oob-name (generic function)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.7 Structures

Structure: classical-memory ()

A representation of a chunk of allocated classical memory.

Package

qvm

Source

classical-memory.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods
  • make-load-form (method)
  • print-object (method)
Direct slots
Slot: size
Type

qvm::non-negative-fixnum

Initform

0

Readers

memory-size (function)

Writers

(setf memory-size) (function)

Slot: pointer
Type

cffi-sys:foreign-pointer

Initform

(cffi-sys:null-pointer)

Readers

memory-pointer (function)

Writers

(setf memory-pointer) (function)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.8 Classes

Class: c-allocation ()

A description of an allocation in foreign memory.

Package

qvm

Source

allocator.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: length
Initargs

:length

Readers

allocation-length (generic function)

Class: classical-memory-subsystem ()

The standard Quil memory subsystem.

Package

qvm

Source

classical-memory.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: classical-memory-model

A description of the structure of the memory of the abstract machine.

Type

cl-quil:memory-model

Initargs

:classical-memory-model

Readers

classical-memory-model (generic function)

Slot: classical-memories

A table mapping names to allocated memories.

Type

hash-table

Readers

classical-memories (generic function)

Direct Default Initargs
InitargValue
:classical-memory-modelcl-quil:**empty-memory-model**
Class: density-qvm ()

A density matrix simulator.

Package

qvm

Source

density-qvm.lisp (file)

Direct superclasses

pure-state-qvm (class)

Direct methods
Direct slots
Slot: matrix-view

This is a 2D array displaced to the underlying QVM amplitudes.

Readers

density-matrix-view (generic function)

Slot: temporary-state

Sometimes the simulation needs to use some temporary state. We save it so we don’t have to alloc/dealloc frequently.

Readers

temporary-state (generic function)

Writers

(setf temporary-state) (generic function)

Slot: noisy-gate-definitions

Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.

Initargs

:noisy-gate-definitions

Initform

(make-hash-table :test (quote equalp))

Readers

noisy-gate-definitions (generic function)

Writers

(setf noisy-gate-definitions) (generic function)

Slot: readout-povms

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.

Initargs

:readout-povms

Initform

(make-hash-table)

Readers

readout-povms (generic function)

Writers

(setf readout-povms) (generic function)

Class: depolarizing-qvm ()

A quantum virtual machine with parametric depolarizing noise.

Package

qvm

Source

depolarizing-noise.lisp (file)

Direct superclasses

pure-state-qvm (class)

Direct methods
Direct slots
Slot: probability-gate-x

Probability of a Pauli X gate happening after a gate application or reset.

Initargs

:x

Readers

probability-gate-x (generic function)

Writers

(setf probability-gate-x) (generic function)

Slot: probability-gate-y

Probability of a Pauli Y gate happening after a gate application or reset.

Initargs

:y

Readers

probability-gate-y (generic function)

Writers

(setf probability-gate-y) (generic function)

Slot: probability-gate-z

Probability of a Pauli Z gate happening after a gate application or reset.

Initargs

:z

Readers

probability-gate-z (generic function)

Writers

(setf probability-gate-z) (generic function)

Slot: probability-measure-x

Probability of a Pauli X gate happening before a measurement.

Initargs

:measure-x

Readers

probability-measure-x (generic function)

Writers

(setf probability-measure-x) (generic function)

Slot: probability-measure-y

Probability of a Pauli Y gate happening before a measurement.

Initargs

:measure-y

Readers

probability-measure-y (generic function)

Writers

(setf probability-measure-y) (generic function)

Slot: probability-measure-z

Probability of a Pauli Z gate happening before a measurement.

Initargs

:measure-z

Readers

probability-measure-z (generic function)

Writers

(setf probability-measure-z) (generic function)

Direct Default Initargs
InitargValue
:x0.0
:y0.0
:z0.0
:measure-x0.0
:measure-y0.0
:measure-z0.0
Class: lisp-allocation ()

A description of an allocation on the Lisp heap.

Package

qvm

Source

allocator.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: length
Initargs

:length

Readers

allocation-length (generic function)

Class: measure-all ()

A pseudo-instruction for measuring all qubits simultaneously.

Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: storage

A list of qubit-mref pairs to store, in order.

Initargs

:storage

Readers

measure-all-storage (generic function)

Class: noisy-qvm ()

A quantum virtual machine with noisy gates and readout.

Package

qvm

Source

noisy-qvm.lisp (file)

Direct superclasses

pure-state-qvm (class)

Direct methods
Direct slots
Slot: noisy-gate-definitions

Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.

Initargs

:noisy-gate-definitions

Initform

(make-hash-table :test (quote equalp))

Readers

noisy-gate-definitions (generic function)

Writers

(setf noisy-gate-definitions) (generic function)

Slot: readout-povms

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.

Initargs

:readout-povms

Initform

(make-hash-table)

Readers

readout-povms (generic function)

Writers

(setf readout-povms) (generic function)

Slot: original-amplitude-pointer

A reference to the original pointer of amplitude memory, so the amplitudes can sit in the right place at the end of a computation.

Readers

original-amplitude-pointer (generic function)

Slot: trial-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 NOISY-QVM. The actual values can be initialized in any way, however, because it will be overwritten. As such, it merely is scratch space for intermediate computations, and hence should not be otherwise directly accessed.

Readers

%trial-amplitudes (generic function)

Writers

(setf %trial-amplitudes) (generic function)

Class: posix-shared-memory-allocation ()

A description of an allocation in POSIX shared memory.

Package

qvm

Source

allocator.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: length
Initargs

:length

Readers

allocation-length (generic function)

Slot: name
Initargs

:name

Readers

allocation-name (generic function)

Class: pure-state-qvm ()

An pure-state implementation of the Quantum Abstract Machine.

Package

qvm

Source

qvm.lisp (file)

Direct superclasses

quantum-abstract-machine (class)

Direct subclasses
Direct methods
Direct slots
Slot: number-of-qubits

Number of qubits being simulated.

Type

qvm::non-negative-fixnum

Initargs

:number-of-qubits

Initform

(error ":number-of-qubits is a required initarg ~ to pure-state-qvm")

Readers

number-of-qubits (generic function)

Slot: amplitudes

The unpermuted wavefunction in standard order.

Type

(or null qvm:quantum-state)

Initargs

:amplitudes

Readers

amplitudes (generic function)

Writers

(setf amplitudes) (generic function)

Slot: classical-memory-subsystem

The classical memory subsystem of the QVM. No memory by default.

Initargs

:classical-memory-subsystem

Readers

classical-memory-subsystem (generic function)

Slot: program-counter

The program counter.

Initform

0

Readers

pc (generic function)

Writers

(setf pc) (generic function)

Slot: program

The program to be executed.

Initform

#()

Readers

program (generic function)

Writers

(setf program) (generic function)

Slot: program-compiled-p

Has the loaded program been compiled?

Readers

program-compiled-p (generic function)

Writers

(setf program-compiled-p) (generic function)

Slot: gate-definitions

A table mapping gate names to their GATE-instance definition.

Initargs

:gate-definitions

Readers

gate-definitions (generic function)

Writers

(setf gate-definitions) (generic function)

Direct Default Initargs
InitargValue
:classical-memory-subsystem(make-instance (quote qvm:classical-memory-subsystem))
:gate-definitions(qvm::copy-hash-table cl-quil::**default-gate-definitions**)
Class: quantum-abstract-machine ()

A class representing implementations of the quantum abstract machine.

Package

qvm

Source

qam.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

pure-state-qvm (class)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.9 Types

Type: cflonum ()

The complex float type used in computations. Typically these will represent wavefunction amplitudes.

Package

qvm

Source

floats.lisp (file)

Type: flonum &optional MIN

The float type used in computations.

Package

qvm

Source

floats.lisp (file)

Type: parallelization-limit ()

A limit on the number of qubits that can be parallelized across.

Package

qvm

Source

config.lisp (file)

Type: quantum-operator &optional N

A representation of an operator on a quantum state. This will be a unitary square matrix where each dimension is a power-of-two.

Package

qvm

Source

linear-algebra.lisp (file)

Type: quantum-state &optional N

A representation of a quantum state. This will have a power-of-2 length.

Package

qvm

Source

linear-algebra.lisp (file)

Type: quil-bit ()
Package

qvm

Source

classical-memory.lisp (file)

Type: quil-octet ()
Package

qvm

Source

classical-memory.lisp (file)

Type: qvm-integer ()
Package

qvm

Source

classical-memory.lisp (file)

Type: qvm-real ()
Package

qvm

Source

classical-memory.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: $map-failed
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $map-shared
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $o-creat
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $o-excl
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $o-rdwr
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $prot-read
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $prot-write
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: $sc-nprocessors-onln
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-system-constants.processed-grovel-file

Constant: $sc-page-size
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-system-constants.processed-grovel-file

Constant: +max-nat-tuple-cardinality+
Package

qvm

Source

utilities.lisp (file)

Constant: +octets-per-cflonum+
Package

qvm

Source

floats.lisp (file)

Constant: +octets-per-flonum+
Package

qvm

Source

floats.lisp (file)

Constant: size-of-mode_t
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: size-of-off_t
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Constant: size-of-size_t
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Special variables

Special Variable: *optimize-briskly*

Optimization qualities for when the code should go fast, but have safety.

Package

qvm

Source

config.lisp (file)

Special Variable: *optimize-dangerously-fast*

Optimization qualities for when the code should go as fast as possible.

Package

qvm

Source

config.lisp (file)

Special Variable: *optimize-safely*

Optimization qualities for when the code should emphasize safety and debugability.

Package

qvm

Source

config.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Symbol macros

Symbol Macro: %errno
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Expansion

(qvm::%var-accessor-%errno)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Macros

Macro: define-binary-transition CLASS COMPUTE-FN ACCESSOR
Package

qvm

Source

transition-classical-instructions.lisp (file)

Macro: define-direct-comparator COMPARATOR &rest CLASSES
Package

qvm

Source

transition-classical-instructions.lisp (file)

Macro: define-indirect-comparator COMPARATOR &rest CLASSES
Package

qvm

Source

transition-classical-instructions.lisp (file)

Macro: define-matmul NAME SIZE

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.

Package

qvm

Source

linear-algebra.lisp (file)

Macro: defun-inlinable NAME LAMBDA-LIST &body BODY

Define an INLINE-able function.

Package

qvm

Source

utilities.lisp (file)

Macro: do-nat-tuple (ELT NT) &body BODY

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.

Package

qvm

Source

utilities.lisp (file)

Macro: measuring-gc (TIME-VAR BYTES-VAR) &body BODY

Execute BODY setting TIME-VAR to the number of milliseconds spent garbage collecting, and BYTES-VAR to roughly the number of bytes allocated.

Package

qvm

Source

utilities.lisp (file)

Macro: pdotimes (I N &optional RET) &body BODY

Selectively perform DOTIMES or LPARALLEL:DOTIMES, depending on whether the number of iterations N exceeds the threshold set by *QUBITS-REQUIRED-FOR-PARALLELIZATION*.

Package

qvm

Source

utilities.lisp (file)

Macro: probabilistically P &body BODY

Execute BODY with probability 0 <= P <= 1.

Package

qvm

Source

utilities.lisp (file)

Macro: psum-dotimes (I RANGE) &body BODY

Compute the sum of BODY for I in ranging over 0 <= I < RANGE. RANGE must be a non-negative fixnum.

Package

qvm

Source

utilities.lisp (file)

Macro: shm-open NAME OFLAG &rest VARARGS0
Package

qvm

Source

shm.lisp (file)

Macro: with-modified-amplitudes ()

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.

Package

qvm

Source

wavefunction.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Functions

Function: %close FD
Package

qvm

Source

shm.lisp (file)

Function: %ftruncate FD OFFSET
Package

qvm

Source

shm.lisp (file)

Function: %make-classical-memory SIZE POINTER
Package

qvm

Source

classical-memory.lisp (file)

Function: %make-nat-tuple N
Package

qvm

Source

utilities.lisp (file)

Function: %make-shared-memory &key (NAME NAME) (SIZE SIZE) (POINTER POINTER)
Package

qvm

Source

shm.lisp (file)

Function: %mmap ADDR LEN PROT FLAGS FD OFFSET
Package

qvm

Source

shm.lisp (file)

Function: %munmap ADDR LEN
Package

qvm

Source

shm.lisp (file)

Function: %perform-and QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-integer-add QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-integer-div QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-integer-mul QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-integer-sub QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-ior QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-move QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-real-add QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-real-div QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-real-mul QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-real-sub QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %perform-xor QVM TARGET-MREF LEFT RIGHT
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: %serial-norm ()
Package

qvm

Source

wavefunction.lisp (file)

Function: %strerror ERRNUM
Package

qvm

Source

shm.lisp (file)

Function: %var-accessor-%errno ()
Function: (setf %var-accessor-%errno) VALUE
Package

qvm

Source

/home/quickref/.cache/common-lisp/sbcl-1.5.0-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.8.1/src/grovel-shared-memory.processed-grovel-file

Function: add-depolarizing-noise QVM QUBIT PX PY PZ

Apply depolarizing noise to the qubit numbered QUBIT 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.

Package

qvm

Source

depolarizing-noise.lisp (file)

Function: allocate-memory-for-model MODEL &key BYPASS-SIZE-LIMIT

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.

Package

qvm

Source

classical-memory.lisp (file)

Function: assert-in-bounds I A B &optional NAME
Package

qvm

Source

classical-memory.lisp (file)

Function: barf-memory VECTOR POINTER

Barf out the memory designated by the vector of QUIL-OCTETS into the pointer POINTER.

Package

qvm

Source

classical-memory.lisp (file)

Function: boolean-bit BOOLEAN

Convert a generalized boolean BOOLEAN into a good ol’ BIT.

Package

qvm

Source

utilities.lisp (file)

Function: bring-to-zero-state ()

Modify the quantum state V to be |...000>.

Package

qvm

Source

wavefunction.lisp (file)

Function: call-at-exit FUN

Ensure that FUN is called when the Lisp implementation stops.

Package

qvm

Source

impl/sbcl.lisp (file)

Function: check-classical-memory-bounds I TYPE-NAME MEM
Package

qvm

Source

classical-memory.lisp (file)

Function: check-kraus-ops KRAUS-OPS

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.

Package

qvm

Source

noisy-qvm.lisp (file)

Function: check-povm POVM

Verify that the list POVM contains a valid single qubit diagonal POVM. Also see the documentation for the READOUT-POVMS slot of NOISY-QVM.

Package

qvm

Source

noisy-qvm.lisp (file)

Function: classical-memory-p OBJECT
Package

qvm

Source

classical-memory.lisp (file)

Function: compile-lambda FORM

Compile the lambda form FORM into a FUNCTION object.

Package

qvm

Source

compile-gate.lisp (file)

Function: compile-measure-chains CODE N

Given a code vector CODE of N qubits, compile all measure chains.

Package

qvm

Source

compile-gate.lisp (file)

Function: compose-operators A B

Compute the product of the matrices A and B.

Package

qvm

Source

linear-algebra.lisp (file)

Function: copy-hash-table HASH-TABLE

Copy the hash table HASH-TABLE.

NOTE: This will not copy any multiprocessing aspects.

Package

qvm

Source

utilities.lisp (file)

Function: copy-memory-view INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: copy-posix-shared-memory INSTANCE
Package

qvm

Source

shm.lisp (file)

Function: corrupt-measurement-outcome QVM MEASURE-INSTR

Randomly corrupt the outcome of the measurement indicated by MEASURE-INSTR after it has been executed on a QVM supporting readout POVMs (e.g. a NOISY-QVM or DENSITY-QVM).

Package

qvm

Source

noisy-qvm.lisp (file)

Function: cumulative-distribution-function ()

Compute the CDF of a quantum state STATE. This is a vector C such that C_i = sum_{0 <= j <= i} Pr(j).

Package

qvm

Source

wavefunction.lisp (file)

Function: current-instruction QVM

What is the next instruction to be executed on the QVM?

Package

qvm

Source

qvm.lisp (file)

Function: dagger M

Compute the Hermitian transpose of M in-place.

Package

qvm

Source

linear-algebra.lisp (file)

Function: deallocate-all-shared-memories ()

Deallocate all valid shared memories that we’ve remembered.

Package

qvm

Source

shm.lisp (file)

Function: density-qvm-force-measurement MEASURED-VALUE QUBIT QVM EXCITED-PROBABILITY

Force the QVM 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.

Package

qvm

Source

density-qvm.lisp (file)

Function: density-qvm-measurement-probabilities QVM

Computes the probability distribution of measurement outcomes (a vector) associated with the specified density matrix 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.

Package

qvm

Source

density-qvm.lisp (file)

Function: density-qvm-qubit-probability QVM QUBIT

The probability that the physical qubit addressed by QUBIT is 1.

Package

qvm

Source

density-qvm.lisp (file)

Function: dereference-mref QVM MREF

Look up the value of the quil:memory-ref MREF in the QVM.

Package

qvm

Source

qvm.lisp (file)

Writer

(setf dereference-mref) (function)

Function: (setf dereference-mref) NEW-VALUE QVM MREF

Set the value at the quil:memory-ref MREF in the QVM to NEW-VALUE.

Package

qvm

Source

qvm.lisp (file)

Reader

dereference-mref (function)

Function: dummy-finalizer ()

A "finalizer" that does nothing. Used for objects managed by the GC.

Package

qvm

Source

allocator.lisp (file)

Function: eject-bit ()

Remove the nth bit. Example:

(EJECT-BIT #b1101 1) => #b111

Package

qvm

Source

utilities.lisp (file)

Function: eject-bit-code N
Package

qvm

Source

utilities.lisp (file)

Function: ensure-s64 N

Ensure that an integer N is in range of a 64-bit 2’s complement signed integer. Wrap-around if needed.

Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: ensure-signed-integer N BITS
Package

qvm

Source

transition-classical-instructions.lisp (file)

Function: extract-amplitudes ()

Returns a column vector of amplitudes represented by the tuple of qubits QUBITS.

Package

qvm

Source

wavefunction.lisp (file)

Function: find-measure-chains N CODE

Find measure chains containing all qubits 0 <= q < n.

Package

qvm

Source

compile-gate.lisp (file)

Function: find-or-make-apply-matrix-operator-function QUBITS

Find a matrix application function for the Hilbert subspace designated by QUBITS.

This function will compile new ones on-demand.

Package

qvm

Source

compile-gate.lisp (file)

Function: force-parameter PARAM QVM

Force evaluation of an application parameter PARAM, with respect to the specified QVM.

Package

qvm

Source

transition.lisp (file)

Function: free-posix-shared-memory SHM

Free the memory associated with the POSIX shared memory object SHM.

Package

qvm

Source

shm.lisp (file)

Function: full-density-number-of-qubits VEC-DENSITY

Computes the number of qubits encoded by a vectorized density matrix.

Package

qvm

Source

density-qvm.lisp (file)

Function: generate-amplitude-address-code ADDRESS FLAGS QUBITS

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-complement-iteration QUBITS WAVEFUNCTION BODY-GEN &key DOTIMES-ITERATOR

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-extraction-code COMPLEMENT-ADDRESS WAVEFUNCTION QUBITS BODY-GEN &key GENERATE-EXTRACTIONS

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-gate-application-code QUBITS

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-inner-matrix-multiply-code N MATRIX COLUMN RESULT

Generate N x N matrix multiplication code.

MATRIX should be a symbol which should (eventually) be bound to a QUANTUM-OPERATOR object.

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-permutation-gate-application-code QUBITS PERMUTATION

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-permutation-gate-code PERMUTATION ACCESSORS

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.

Package

qvm

Source

compile-gate.lisp (file)

Function: getpagesize ()
Package

qvm

Source

shm.lisp (file)

Function: half X

Compute the floor of half of the real number X.

Package

qvm

Source

utilities.lisp (file)

Function: index-to-address ()

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.

Package

qvm

Source

measurement.lisp (file)

Function: initialize-random-state ()

Initialize the active MT19937 random state using the current time.

Package

qvm

Source

utilities.lisp (file)

Function: inject-bit ()

Inject a 0 at the nth position. Example:

(INJECT-BIT #b1111 1) => #b11101

Package

qvm

Source

utilities.lisp (file)

Function: inject-bit-code N
Package

qvm

Source

utilities.lisp (file)

Function: insert-amplitudes ()

Given a column vector of amplitudes COLUMN representing the qubits QUBITS, insert this state back into WAVEFUNCTION.

Package

qvm

Source

wavefunction.lisp (file)

Function: install-gates QVM PROGRAM

Install the gates specified by the program PROGRAM into the QVM.

This will not clear previously installed gates from the QVM.

Package

qvm

Source

qvm.lisp (file)

Function: kraus-list %0
Package

qvm

Source

density-qvm.lisp (file)

Function: kraus-list%0 INSTANCE
Package

qvm

Source

density-qvm.lisp (file)

Function: kronecker-multiply A B

Compute the Kronecker product of matrices A and B.

Package

qvm

Source

linear-algebra.lisp (file)

Function: lift-matrix-to-superoperator MAT

Converts a magicl matrix MAT into a superoperator.

Package

qvm

Source

density-qvm.lisp (file)

Function: list-classical-states CLASSICAL-STATE QUBITS

List all of the bitstring states in the order that QUBITS are specified, using CLASSICAL-STATE as the base state.

Package

qvm

Source

path-simulate.lisp (file)

Function: loaded-program-length QVM

Number of executable instructions in the program loaded into the QVM.

Package

qvm

Source

qvm.lisp (file)

Function: lookup-gate QVM GATE &key ERROR

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.

Package

qvm

Source

qvm.lisp (file)

Function: magicl-matrix-to-quantum-operator M

Convert a MAGICL matrix M to a QUANTUM-OPERATOR.

Package

qvm

Source

linear-algebra.lisp (file)

Function: make-lisp-cflonum-vector LENGTH
Package

qvm

Source

allocator.lisp (file)

Function: make-matrix SIZE &rest ELEMENTS

Make a SIZE x SIZE complex matrix whose elements are ELEMENTS. Each of ELEMENTS must be able to be coerced into a CFLONUM.

Package

qvm

Source

linear-algebra.lisp (file)

Function: make-pauli-perturbed-1q-gate GATE-NAME PX PY PZ

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.

Package

qvm

Source

noisy-qvm.lisp (file)

Function: make-posix-shared-memory NAME SIZE

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.

Package

qvm

Source

shm.lisp (file)

Function: make-shared-array NAME LENGTH ELEMENT-TYPE

Return an array allocated to shared memory, along with a thunk which releases this memory.

Package

qvm

Source

shm.lisp (file)

Function: make-vector-from-pointer POINTER NUM-ELEMENTS ELEMENT-TYPE
Package

qvm

Source

shm.lisp (file)

Function: map-classical-state INSTRUCTION CLASSICAL-STATE

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.

Package

qvm

Source

path-simulate.lisp (file)

Function: map-complement ()

An optimized call to

(MAP-REORDERED-AMPLITUDES 0 FUNCTION (NAT-TUPLE-COMPLEMENT QUBITS))

up to amplitude ordering.

Package

qvm

Source

wavefunction.lisp (file)

Function: map-complement-in-parallel ()

A parallel version of #’MAP-COMPLEMENT, when the number of qubits is large enough.

Package

qvm

Source

wavefunction.lisp (file)

Function: map-complement-in-parallel-truly ()

A parallel version of #’MAP-COMPLEMENT.

Package

qvm

Source

wavefunction.lisp (file)

Function: map-reordered-amplitudes ()

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.

Package

qvm

Source

wavefunction.lisp (file)

Function: map-reordered-amplitudes-in-parallel ()

Parallel version of #’MAP-REORDERED-AMPLITUDES, when the number of qubits is large enough.

Package

qvm

Source

wavefunction.lisp (file)

Function: map-reordered-amplitudes-in-parallel-truly ()

Parallel version of #’MAP-REORDERED-AMPLITUDES.

Package

qvm

Source

wavefunction.lisp (file)

Function: matmul2 ()
Package

qvm

Source

linear-algebra.lisp (file)

Function: matmul4 ()
Package

qvm

Source

linear-algebra.lisp (file)

Function: matmul8 ()
Package

qvm

Source

linear-algebra.lisp (file)

Function: matrix-multiply ()

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.

Package

qvm

Source

linear-algebra.lisp (file)

Function: matrix-multiply-code N MATRIX COLUMN RESULT

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).

Package

qvm

Source

linear-algebra.lisp (file)

Function: measure-and-store QAM Q C

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.

Package

qvm

Source

qam.lisp (file)

Function: measure-chain-at I CODE

Is there a measure chain at I in CODE?

Package

qvm

Source

compile-gate.lisp (file)

Function: measure-chain-to-instruction CHAIN

Convert a measure chain into a MEASURE-ALL pseudo-instruction.

Package

qvm

Source

compile-gate.lisp (file)

Function: memory-pointer INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-size INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view ROOT-CLASSICAL-MEMORY &key LENGTH READER WRITER (ALIASING-MEMORY ALIASING-CLASSICAL-MEMORY)
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-aliasing-classical-memory INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-classical-memory MV

Return the CLASSICAL-MEMORY that can be read to/written from as viewed by MEMORY-VIEW.

Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-length INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-p OBJECT
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-reader INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-ref MV I
Function: (setf memory-view-ref) NEW-VALUE MV I
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-root-classical-memory INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: memory-view-writer INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: midpoint ()

Find the midpoint of two non-negative fixnums A and B where A <= B.

Package

qvm

Source

measurement.lisp (file)

Function: naive-measure-all QAM
Package

qvm

Source

density-qvm.lisp (file)

Function: nat-tuple &rest ELEMENTS

Create a new nat tuple with the elements ELEMENTS (each of type NAT-TUPLE-ELEMENT).

Package

qvm

Source

utilities.lisp (file)

Function: nat-tuple-cardinality NT

Compute the number of elements in the nat tuple NT.

Package

qvm

Source

utilities.lisp (file)

Function: nat-tuple-complement N NT

Compute the complement of the nat tuple NT in a universe of (0 1 2 ... N-1).

Package

qvm

Source

utilities.lisp (file)

Function: nop-count CODE

Number of NOPs in a vector of instructions CODE.

Package

qvm

Source

execution.lisp (file)

Function: norm ()

Compute the length/L2 norm of the wavefunction WAVEFUNCTION.

Package

qvm

Source

wavefunction.lisp (file)

Function: outer-multiply U V

Compute the outer product of two equally-sized column vectors U and V (specifically UV^dagger).

Package

qvm

Source

linear-algebra.lisp (file)

Function: permutation-to-transpositions PERMUTATION

Decompose a permutation PERMUTATION represented as a sequence of non-negative integers into a list of transpositions represented as conses.

Package

qvm

Source

compile-gate.lisp (file)

Function: perturb-measured-bits QVM MEASURED-BITS

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.

Package

qvm

Source

noisy-qvm.lisp (file)

Function: perturb-measurement ACTUAL-OUTCOME P00 P01 P10 P11

Given the readout error encoded in the POVM (see documentation of NOISY-QVM) randomly sample the observed (potentially corrupted) measurement outcome.

Package

qvm

Source

noisy-qvm.lisp (file)

Function: posix-shared-memory-finalizer SHM

Return a thunk suitable to releasing the memory associated with the POSIX-SHARED-MEMORY object SHM.

Package

qvm

Source

shm.lisp (file)

Function: posix-shared-memory-name INSTANCE
Function: (setf posix-shared-memory-name) VALUE INSTANCE
Package

qvm

Source

shm.lisp (file)

Function: posix-shared-memory-p OBJECT
Package

qvm

Source

shm.lisp (file)

Function: posix-shared-memory-pointer INSTANCE
Function: (setf posix-shared-memory-pointer) VALUE INSTANCE
Package

qvm

Source

shm.lisp (file)

Function: posix-shared-memory-size INSTANCE
Function: (setf posix-shared-memory-size) VALUE INSTANCE
Package

qvm

Source

shm.lisp (file)

Function: psum F STATE

Compute the sum of F(X) for X in STATE, in parallel. F should be a unary function mapping CFLONUMs to FLONUMs.

Package

qvm

Source

linear-algebra.lisp (file)

Function: pull-teeth-to-get-a-gate GATE-APP

Produce a valid, applicable gate from the application GATE-APPLICATION.

Package

qvm

Source

compile-gate.lisp (file)

Function: quil-name TYPE-NAME
Package

qvm

Source

classical-memory.lisp (file)

Function: requires-swapping-p QVM

Does the noisy qvm QVM require swapping of internal pointers?

Package

qvm

Source

noisy-qvm.lisp (file)

Function: reset-classical-memory QVM

Zero out all of the classical memory of the qvm QVM.

Package

qvm

Source

qvm.lisp (file)

Function: root-memory-view-p MV

Is the MEMORY-VIEW MV a root memory?

Package

qvm

Source

classical-memory.lisp (file)

Function: round-to-next-page SIZE
Package

qvm

Source

shm.lisp (file)

Function: round-up-to-next-multiple X MULTIPLE

Round X up to the next multiple of MULTIPLE.

Package

qvm

Source

utilities.lisp (file)

Function: sample-wavefunction-as-distribution WF PS

Implementation of SAMPLE-WAVEFUNCTION-AS-DISTRIBUTION-IN-PARALLEL-TRULY, unparallelized, but for every probability in the PS (type: (VECTOR FLONUM)). Return a
vector of sampled amplitude addresses.

Package

qvm

Source

measurement.lisp (file)

Function: sample-wavefunction-as-distribution-in-parallel WF P
Package

qvm

Source

measurement.lisp (file)

Function: sample-wavefunction-as-distribution-in-parallel-truly WF P

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.

Package

qvm

Source

measurement.lisp (file)

Function: sample-wavefunction-multiple-times WF NUM-SAMPLES

Produce NUM-SAMPLES bitstring samples of the wavefunction WF according to its interpretation as a probability distribution.

Package

qvm

Source

measurement.lisp (file)

Function: set-qubit-components-of-amplitude-address ()

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.)

Package

qvm

Source

wavefunction.lisp (file)

Package

qvm

Source

shm.lisp (file)

Function: shm-vector-allocation-size NUM-ELEMENTS ELEMENT-TYPE

Return the size, in octets, needed to store a simple-array of NUM-ELEMENTS ELEMENT-TYPE objects.

Package

qvm

Source

impl/sbcl.lisp (file)

Function: shm-vector-from-pointer POINTER NUM-ELEMENTS ELEMENT-TYPE

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.

Package

qvm

Source

impl/sbcl.lisp (file)

Function: shm-vector-header-size ()
Package

qvm

Source

impl/sbcl.lisp (file)

Function: simple-array-allocation-size NUM-ELEMENTS ELEMENT-TYPE
Package

qvm

Source

shm.lisp (file)

Function: single-kraus %0
Package

qvm

Source

density-qvm.lisp (file)

Function: single-kraus%0 INSTANCE
Package

qvm

Source

density-qvm.lisp (file)

Function: size-of TYPE-NAME

The size of a type in octets.

Package

qvm

Source

classical-memory.lisp (file)

Function: slurp-memory MEMORY

Slurp all of the memory of MEMORY into a vector.

Package

qvm

Source

classical-memory.lisp (file)

Function: subdivide TOTAL NUM-RANGES

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).

Package

qvm

Source

utilities.lisp (file)

Function: sysconf NAME
Package

qvm

Source

utilities.lisp (file)

Function: tr M

Compute the trace of M.

Package

qvm

Source

linear-algebra.lisp (file)

Function: typed-reader/writer TY
Package

qvm

Source

classical-memory.lisp (file)

Function: wavefunction-qubits ()

The number of qubits represented by the wavefunction WAVEFUNCTION.

Package

qvm

Source

wavefunction.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Generic functions

Generic Function: %trial-amplitudes OBJECT
Generic Function: (setf %trial-amplitudes) NEW-VALUE OBJECT
Package

qvm

Methods
Method: %trial-amplitudes (NOISY-QVM noisy-qvm)
Method: (setf %trial-amplitudes) NEW-VALUE (NOISY-QVM noisy-qvm)

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 NOISY-QVM. The actual values can be initialized in any way, however, because it will be overwritten. As such, it merely is scratch space for intermediate computations, and hence should not be otherwise directly accessed.

Source

noisy-qvm.lisp (file)

Generic Function: allocation-name OBJECT
Package

qvm

Methods
Method: allocation-name (POSIX-SHARED-MEMORY-ALLOCATION posix-shared-memory-allocation)

automatically generated reader method

Source

allocator.lisp (file)

Generic Function: amplitudes OBJECT
Generic Function: (setf amplitudes) NEW-VALUE OBJECT
Package

qvm

Methods
Method: amplitudes (PURE-STATE-QVM pure-state-qvm)
Method: (setf amplitudes) NEW-VALUE (PURE-STATE-QVM pure-state-qvm)

The unpermuted wavefunction in standard order.

Source

qvm.lisp (file)

Generic Function: apply-superoperator SOP VEC-DENSITY QUBITS GHOST-QUBITS &key TEMPORARY-STORAGE PARAMS
Package

qvm

Methods
Method: apply-superoperator SOP VEC-DENSITY QUBITS GHOST-QUBITS &key TEMPORARY-STORAGE PARAMS

Apply a superoperator SOP to a vectorized density matrix VEC-DENSITY, 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 TEMPORARY-STORAGE, a vector of the same length as VEC-DENSITY. If no TEMPORARY-STORAGE is provided, it will be allocated as needed. Returns the pair of updated VEC-DENSITY and (perhaps freshly allocated) TEMPORARY-STORAGE.

Source

density-qvm.lisp (file)

Generic Function: classical-memories OBJECT
Package

qvm

Methods
Method: classical-memories (QVM pure-state-qvm)
Source

qvm.lisp (file)

Method: classical-memories (CLASSICAL-MEMORY-SUBSYSTEM classical-memory-subsystem)

A table mapping names to allocated memories.

Source

classical-memory.lisp (file)

Generic Function: classical-memory-model OBJECT
Package

qvm

Methods
Method: classical-memory-model (QVM pure-state-qvm)
Source

qvm.lisp (file)

Method: classical-memory-model (CLASSICAL-MEMORY-SUBSYSTEM classical-memory-subsystem)

A description of the structure of the memory of the abstract machine.

Source

classical-memory.lisp (file)

Generic Function: compile-instruction QVM ISN

Compile the instruction ISN to some more efficient representation, if possible. May return the same ISN back.

Package

qvm

Source

compile-gate.lisp (file)

Methods
Method: compile-instruction QVM (ISN gate-application)
Method: compile-instruction QVM (ISN compiled-gate-application)
Method: compile-instruction QVM ISN
Generic Function: compile-loaded-program QAM

Compile the program loaded into the qam QAM so as to optimize execution.

Package

qvm

Source

qam.lisp (file)

Methods
Method: compile-loaded-program (QVM density-qvm)
Source

density-qvm.lisp (file)

Method: compile-loaded-program (QVM noisy-qvm)
Source

noisy-qvm.lisp (file)

Method: compile-loaded-program (QVM depolarizing-qvm)
Source

depolarizing-noise.lisp (file)

Method: compile-loaded-program (QVM pure-state-qvm)

Compile the loaded program on the QVM QVM.

Source

qvm.lisp (file)

Generic Function: compile-operator OP QUBITS PARAMETERS

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).

Package

qvm

Source

compile-gate.lisp (file)

Methods
Method: compile-operator (OP permutation-gate) QUBITS PARAMETERS
Method: compile-operator (OP parameterized-gate) QUBITS PARAMETERS
Method: compile-operator (OP simple-gate) QUBITS PARAMETERS
Method: compile-operator OP QUBITS PARAMETERS
Generic Function: compiled-gate-apply-operator OBJECT
Package

qvm

Methods
Method: compiled-gate-apply-operator (COMPILED-GATE-APPLICATION compiled-gate-application)

The operator (a FUNCTION) which, at least as one of its arguments, modifies the wavefunction.

Source

compile-gate.lisp (file)

Generic Function: compiled-matrix OBJECT
Package

qvm

Methods
Method: compiled-matrix (COMPILED-MATRIX-GATE-APPLICATION compiled-matrix-gate-application)

The (static) matrix represented by this application.

Source

compile-gate.lisp (file)

Generic Function: conjugate-entrywise GATE

Construct a new gate from GATE with corresponding matrix entries conjugated.

Package

qvm

Source

density-qvm.lisp (file)

Methods
Method: conjugate-entrywise (GATE simple-gate)
Method: conjugate-entrywise (GATE permutation-gate)
Method: conjugate-entrywise (GATE parameterized-gate)
Generic Function: density-matrix-view OBJECT
Package

qvm

Methods
Method: density-matrix-view (DENSITY-QVM density-qvm)

This is a 2D array displaced to the underlying QVM amplitudes.

Source

density-qvm.lisp (file)

Generic Function: gate-definitions OBJECT
Generic Function: (setf gate-definitions) NEW-VALUE OBJECT
Package

qvm

Methods
Method: gate-definitions (PURE-STATE-QVM pure-state-qvm)
Method: (setf gate-definitions) NEW-VALUE (PURE-STATE-QVM pure-state-qvm)

A table mapping gate names to their GATE-instance definition.

Source

qvm.lisp (file)

Generic Function: measure-all-storage OBJECT
Package

qvm

Methods
Method: measure-all-storage (MEASURE-ALL measure-all)

A list of qubit-mref pairs to store, in order.

Source

compile-gate.lisp (file)

Generic Function: noisy-gate-definitions OBJECT
Generic Function: (setf noisy-gate-definitions) NEW-VALUE OBJECT
Package

qvm

Methods
Method: noisy-gate-definitions (DENSITY-QVM density-qvm)
Method: (setf noisy-gate-definitions) NEW-VALUE (DENSITY-QVM density-qvm)

Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.

Source

density-qvm.lisp (file)

Method: noisy-gate-definitions (NOISY-QVM noisy-qvm)
Method: (setf noisy-gate-definitions) NEW-VALUE (NOISY-QVM noisy-qvm)

Noisy gate definitions that, if present, override those stored in GATE-DEFINITIONS.

Source

noisy-qvm.lisp (file)

Generic Function: oob-from CONDITION
Package

qvm

Methods
Method: oob-from (CONDITION memory-index-out-of-bounds)
Source

classical-memory.lisp (file)

Generic Function: oob-index CONDITION
Package

qvm

Methods
Method: oob-index (CONDITION memory-index-out-of-bounds)
Source

classical-memory.lisp (file)

Generic Function: oob-name CONDITION
Package

qvm

Methods
Method: oob-name (CONDITION memory-index-out-of-bounds)
Source

classical-memory.lisp (file)

Generic Function: oob-to CONDITION
Package

qvm

Methods
Method: oob-to (CONDITION memory-index-out-of-bounds)
Source

classical-memory.lisp (file)

Generic Function: original-amplitude-pointer OBJECT
Package

qvm

Methods
Method: original-amplitude-pointer (NOISY-QVM noisy-qvm)

A reference to the original pointer of amplitude memory, so the amplitudes can sit in the right place at the end of a computation.

Source

noisy-qvm.lisp (file)

Generic Function: pc OBJECT
Generic Function: (setf pc) NEW-VALUE OBJECT
Package

qvm

Methods
Method: pc (PURE-STATE-QVM pure-state-qvm)
Method: (setf pc) NEW-VALUE (PURE-STATE-QVM pure-state-qvm)

The program counter.

Source

qvm.lisp (file)

Generic Function: probability-gate-x OBJECT
Generic Function: (setf probability-gate-x) NEW-VALUE OBJECT
Package

qvm

Methods
Method: probability-gate-x (DEPOLARIZING-QVM depolarizing-qvm)
Method: (setf probability-gate-x) NEW-VALUE (DEPOLARIZING-QVM depolarizing-qvm)

Probability of a Pauli X gate happening after a gate application or reset.

Source

depolarizing-noise.lisp (file)

Generic Function: probability-gate-y OBJECT
Generic Function: (setf probability-gate-y) NEW-VALUE OBJECT
Package

qvm

Methods
Method: probability-gate-y (DEPOLARIZING-QVM depolarizing-qvm)
Method: (setf probability-gate-y) NEW-VALUE (DEPOLARIZING-QVM depolarizing-qvm)

Probability of a Pauli Y gate happening after a gate application or reset.

Source

depolarizing-noise.lisp (file)

Generic Function: probability-gate-z OBJECT
Generic Function: (setf probability-gate-z) NEW-VALUE OBJECT
Package

qvm

Methods
Method: probability-gate-z (DEPOLARIZING-QVM depolarizing-qvm)
Method: (setf probability-gate-z) NEW-VALUE (DEPOLARIZING-QVM depolarizing-qvm)

Probability of a Pauli Z gate happening after a gate application or reset.

Source

depolarizing-noise.lisp (file)

Generic Function: probability-measure-x OBJECT
Generic Function: (setf probability-measure-x) NEW-VALUE OBJECT
Package

qvm

Methods
Method: probability-measure-x (DEPOLARIZING-QVM depolarizing-qvm)
Method: (setf probability-measure-x) NEW-VALUE (DEPOLARIZING-QVM depolarizing-qvm)

Probability of a Pauli X gate happening before a measurement.

Source

depolarizing-noise.lisp (file)

Generic Function: probability-measure-y OBJECT
Generic Function: (setf probability-measure-y) NEW-VALUE OBJECT
Package

qvm

Methods
Method: probability-measure-y (DEPOLARIZING-QVM depolarizing-qvm)
Method: (setf probability-measure-y) NEW-VALUE (DEPOLARIZING-QVM depolarizing-qvm)

Probability of a Pauli Y gate happening before a measurement.

Source

depolarizing-noise.lisp (file)

Generic Function: probability-measure-z OBJECT
Generic Function: (setf probability-measure-z) NEW-VALUE OBJECT
Package

qvm

Methods
Method: probability-measure-z (DEPOLARIZING-QVM depolarizing-qvm)
Method: (setf probability-measure-z) NEW-VALUE (DEPOLARIZING-QVM depolarizing-qvm)

Probability of a Pauli Z gate happening before a measurement.

Source

depolarizing-noise.lisp (file)

Generic Function: program OBJECT
Generic Function: (setf program) NEW-VALUE OBJECT
Package

qvm

Methods
Method: program (PURE-STATE-QVM pure-state-qvm)
Method: (setf program) NEW-VALUE (PURE-STATE-QVM pure-state-qvm)

The program to be executed.

Source

qvm.lisp (file)

Generic Function: program-compiled-p OBJECT
Generic Function: (setf program-compiled-p) NEW-VALUE OBJECT
Package

qvm

Methods
Method: program-compiled-p (PURE-STATE-QVM pure-state-qvm)
Method: (setf program-compiled-p) NEW-VALUE (PURE-STATE-QVM pure-state-qvm)

Has the loaded program been compiled?

Source

qvm.lisp (file)

Generic Function: readout-povms OBJECT
Generic Function: (setf readout-povms) NEW-VALUE OBJECT
Package

qvm

Methods
Method: readout-povms (DENSITY-QVM density-qvm)
Method: (setf readout-povms) NEW-VALUE (DENSITY-QVM density-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.

Source

density-qvm.lisp (file)

Method: readout-povms (NOISY-QVM noisy-qvm)
Method: (setf readout-povms) NEW-VALUE (NOISY-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.

Source

noisy-qvm.lisp (file)

Generic Function: reset-quantum-state QAM

Bring all qubits of the quantum abstract machine QAM to the zero state.

Package

qvm

Source

qam.lisp (file)

Methods
Method: reset-quantum-state (QVM density-qvm)
Source

density-qvm.lisp (file)

Method: reset-quantum-state (QVM pure-state-qvm)
Source

qvm.lisp (file)

Generic Function: set-readout-povm QVM QUBIT POVM

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.

Package

qvm

Source

noisy-qvm.lisp (file)

Methods
Method: set-readout-povm (QVM density-qvm) QUBIT POVM
Source

density-qvm.lisp (file)

Method: set-readout-povm (QVM noisy-qvm) QUBIT POVM
Generic Function: source-gate OBJECT
Package

qvm

Methods
Method: source-gate (COMPILED-GATE-APPLICATION compiled-gate-application)

The gate object being represented by this application.

Source

compile-gate.lisp (file)

Generic Function: source-instruction OBJECT
Generic Function: (setf source-instruction) NEW-VALUE OBJECT
Package

qvm

Methods
Method: source-instruction (COMPILED-GATE-APPLICATION compiled-gate-application)
Method: (setf source-instruction) NEW-VALUE (COMPILED-GATE-APPLICATION compiled-gate-application)

The instruction that was compiled to produce this one.

Source

compile-gate.lisp (file)

Generic Function: temporary-state OBJECT
Generic Function: (setf temporary-state) NEW-VALUE OBJECT
Package

qvm

Methods
Method: temporary-state (DENSITY-QVM density-qvm)
Method: (setf temporary-state) NEW-VALUE (DENSITY-QVM density-qvm)

Sometimes the simulation needs to use some temporary state. We save it so we don’t have to alloc/dealloc frequently.

Source

density-qvm.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.7 Structures

Structure: kraus-list ()
Package

qvm

Source

density-qvm.lisp (file)

Direct superclasses

superoperator (structure)

Direct methods
  • make-load-form (method)
  • print-object (method)
Direct slots
Slot: %0
Type

list

Initform

(error "unspecified field.")

Readers

kraus-list%0 (function)

Writers

(setf kraus-list%0) (function)

Structure: memory-view ()

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.

Package

qvm

Source

classical-memory.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods

print-object (method)

Direct slots
Slot: length
Type

unsigned-byte

Initform

(error "you need to provide the length.")

Readers

memory-view-length (function)

Writers

(setf memory-view-length) (function)

Slot: root-classical-memory
Type

qvm:classical-memory

Initform

(error "you need a root classical memory.")

Readers

memory-view-root-classical-memory (function)

Writers

(setf memory-view-root-classical-memory) (function)

Slot: aliasing-classical-memory
Type

(or null qvm:classical-memory)

Readers

memory-view-aliasing-classical-memory (function)

Writers

(setf memory-view-aliasing-classical-memory) (function)

Slot: reader
Type

function

Readers

memory-view-reader (function)

Writers

(setf memory-view-reader) (function)

Slot: writer
Type

function

Readers

memory-view-writer (function)

Writers

(setf memory-view-writer) (function)

Structure: posix-shared-memory ()

Representation of some POSIX shared memory.

Package

qvm

Source

shm.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: name
Readers

posix-shared-memory-name (function)

Writers

(setf posix-shared-memory-name) (function)

Slot: size
Readers

posix-shared-memory-size (function)

Writers

(setf posix-shared-memory-size) (function)

Slot: pointer
Readers

posix-shared-memory-pointer (function)

Writers

(setf posix-shared-memory-pointer) (function)

Structure: single-kraus ()
Package

qvm

Source

density-qvm.lisp (file)

Direct superclasses

superoperator (structure)

Direct methods
  • make-load-form (method)
  • print-object (method)
Direct slots
Slot: %0
Type

cl-quil:gate

Initform

(error "unspecified field.")

Readers

single-kraus%0 (function)

Writers

(setf single-kraus%0) (function)

Structure: superoperator ()

Representation of a linear operator on density operators.

Package

qvm

Source

density-qvm.lisp (file)

Direct superclasses

algebraic-data-type (structure)

Direct subclasses

Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.8 Classes

Class: compiled-gate-application ()

A representation of a compiled gate application.

Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses

gate-application (class)

Direct subclasses
Direct methods
Direct slots
Slot: source-instruction

The instruction that was compiled to produce this one.

Initargs

:source-instruction

Readers

source-instruction (generic function)

Writers

(setf source-instruction) (generic function)

Slot: source-gate

The gate object being represented by this application.

Initargs

:source-gate

Readers

source-gate (generic function)

Slot: apply-operator

The operator (a FUNCTION) which, at least as one of its arguments, modifies the wavefunction.

Initargs

:apply-operator

Readers

compiled-gate-apply-operator (generic function)

Class: compiled-matrix-gate-application ()

A compiled GATE-APPLICATION. Note that this is a subclass of GATE-APPLICATION.

Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses

compiled-gate-application (class)

Direct methods
Direct slots
Slot: gate-matrix

The (static) matrix represented by this application.

Initargs

:gate-matrix

Readers

compiled-matrix (generic function)

Class: compiled-permutation-gate-application ()

A compiled GATE-APPLICATION where the gate happens to be a permutation gate.

Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses

compiled-gate-application (class)

Direct methods

apply-gate (method)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.9 Types

Type: amplitude-address ()

An address into an array of amplitudes.

Package

qvm

Source

wavefunction.lisp (file)

Type: cflonum-vector &optional LENGTH
Package

qvm

Source

floats.lisp (file)

Type: finalizer ()

A finalizer thunk. Used for the effect of freeing some memory.

Package

qvm

Source

allocator.lisp (file)

Type: flonum-vector &optional LENGTH
Package

qvm

Source

floats.lisp (file)

Type: nat-tuple ()

The NAT-TUPLE type. A "nat tuple" represents an ordered list of non-negative integer indexes.

Package

qvm

Source

utilities.lisp (file)

Type: nat-tuple-cardinality ()

A representation of the set of cardinalities of a nat tuple.

Package

qvm

Source

utilities.lisp (file)

Type: nat-tuple-element ()

The set of valid elements in a nat tuple.

Package

qvm

Source

utilities.lisp (file)

Type: non-negative-fixnum ()

A non-negative fixnum.

Package

qvm

Source

utilities.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   Q  
Index Entry  Section

F
File, Lisp, qvm.asd: The qvm<dot>asd file
File, Lisp, qvm/allocator.lisp: The qvm/allocator<dot>lisp file
File, Lisp, qvm/apply-gate.lisp: The qvm/apply-gate<dot>lisp file
File, Lisp, qvm/classical-memory.lisp: The qvm/classical-memory<dot>lisp file
File, Lisp, qvm/compile-gate.lisp: The qvm/compile-gate<dot>lisp file
File, Lisp, qvm/config.lisp: The qvm/config<dot>lisp file
File, Lisp, qvm/density-qvm.lisp: The qvm/density-qvm<dot>lisp file
File, Lisp, qvm/depolarizing-noise.lisp: The qvm/depolarizing-noise<dot>lisp file
File, Lisp, qvm/execution.lisp: The qvm/execution<dot>lisp file
File, Lisp, qvm/floats.lisp: The qvm/floats<dot>lisp file
File, Lisp, qvm/grovel-shared-memory.lisp: The qvm/grovel-shared-memory<dot>lisp file
File, Lisp, qvm/grovel-system-constants.lisp: The qvm/grovel-system-constants<dot>lisp file
File, Lisp, qvm/impl/clozure.lisp: The qvm/impl/clozure<dot>lisp file
File, Lisp, qvm/impl/lispworks.lisp: The qvm/impl/lispworks<dot>lisp file
File, Lisp, qvm/impl/sbcl.lisp: The qvm/impl/sbcl<dot>lisp file
File, Lisp, qvm/linear-algebra.lisp: The qvm/linear-algebra<dot>lisp file
File, Lisp, qvm/measurement.lisp: The qvm/measurement<dot>lisp file
File, Lisp, qvm/misc.lisp: The qvm/misc<dot>lisp file
File, Lisp, qvm/noisy-qvm.lisp: The qvm/noisy-qvm<dot>lisp file
File, Lisp, qvm/package.lisp: The qvm/package<dot>lisp file
File, Lisp, qvm/path-simulate.lisp: The qvm/path-simulate<dot>lisp file
File, Lisp, qvm/qam.lisp: The qvm/qam<dot>lisp file
File, Lisp, qvm/qvm.lisp: The qvm/qvm<dot>lisp file
File, Lisp, qvm/shm.lisp: The qvm/shm<dot>lisp file
File, Lisp, qvm/transition-classical-instructions.lisp: The qvm/transition-classical-instructions<dot>lisp file
File, Lisp, qvm/transition.lisp: The qvm/transition<dot>lisp file
File, Lisp, qvm/utilities.lisp: The qvm/utilities<dot>lisp file
File, Lisp, qvm/wavefunction.lisp: The qvm/wavefunction<dot>lisp file

L
Lisp File, qvm.asd: The qvm<dot>asd file
Lisp File, qvm/allocator.lisp: The qvm/allocator<dot>lisp file
Lisp File, qvm/apply-gate.lisp: The qvm/apply-gate<dot>lisp file
Lisp File, qvm/classical-memory.lisp: The qvm/classical-memory<dot>lisp file
Lisp File, qvm/compile-gate.lisp: The qvm/compile-gate<dot>lisp file
Lisp File, qvm/config.lisp: The qvm/config<dot>lisp file
Lisp File, qvm/density-qvm.lisp: The qvm/density-qvm<dot>lisp file
Lisp File, qvm/depolarizing-noise.lisp: The qvm/depolarizing-noise<dot>lisp file
Lisp File, qvm/execution.lisp: The qvm/execution<dot>lisp file
Lisp File, qvm/floats.lisp: The qvm/floats<dot>lisp file
Lisp File, qvm/grovel-shared-memory.lisp: The qvm/grovel-shared-memory<dot>lisp file
Lisp File, qvm/grovel-system-constants.lisp: The qvm/grovel-system-constants<dot>lisp file
Lisp File, qvm/impl/clozure.lisp: The qvm/impl/clozure<dot>lisp file
Lisp File, qvm/impl/lispworks.lisp: The qvm/impl/lispworks<dot>lisp file
Lisp File, qvm/impl/sbcl.lisp: The qvm/impl/sbcl<dot>lisp file
Lisp File, qvm/linear-algebra.lisp: The qvm/linear-algebra<dot>lisp file
Lisp File, qvm/measurement.lisp: The qvm/measurement<dot>lisp file
Lisp File, qvm/misc.lisp: The qvm/misc<dot>lisp file
Lisp File, qvm/noisy-qvm.lisp: The qvm/noisy-qvm<dot>lisp file
Lisp File, qvm/package.lisp: The qvm/package<dot>lisp file
Lisp File, qvm/path-simulate.lisp: The qvm/path-simulate<dot>lisp file
Lisp File, qvm/qam.lisp: The qvm/qam<dot>lisp file
Lisp File, qvm/qvm.lisp: The qvm/qvm<dot>lisp file
Lisp File, qvm/shm.lisp: The qvm/shm<dot>lisp file
Lisp File, qvm/transition-classical-instructions.lisp: The qvm/transition-classical-instructions<dot>lisp file
Lisp File, qvm/transition.lisp: The qvm/transition<dot>lisp file
Lisp File, qvm/utilities.lisp: The qvm/utilities<dot>lisp file
Lisp File, qvm/wavefunction.lisp: The qvm/wavefunction<dot>lisp file

Q
qvm.asd: The qvm<dot>asd file
qvm/allocator.lisp: The qvm/allocator<dot>lisp file
qvm/apply-gate.lisp: The qvm/apply-gate<dot>lisp file
qvm/classical-memory.lisp: The qvm/classical-memory<dot>lisp file
qvm/compile-gate.lisp: The qvm/compile-gate<dot>lisp file
qvm/config.lisp: The qvm/config<dot>lisp file
qvm/density-qvm.lisp: The qvm/density-qvm<dot>lisp file
qvm/depolarizing-noise.lisp: The qvm/depolarizing-noise<dot>lisp file
qvm/execution.lisp: The qvm/execution<dot>lisp file
qvm/floats.lisp: The qvm/floats<dot>lisp file
qvm/grovel-shared-memory.lisp: The qvm/grovel-shared-memory<dot>lisp file
qvm/grovel-system-constants.lisp: The qvm/grovel-system-constants<dot>lisp file
qvm/impl/clozure.lisp: The qvm/impl/clozure<dot>lisp file
qvm/impl/lispworks.lisp: The qvm/impl/lispworks<dot>lisp file
qvm/impl/sbcl.lisp: The qvm/impl/sbcl<dot>lisp file
qvm/linear-algebra.lisp: The qvm/linear-algebra<dot>lisp file
qvm/measurement.lisp: The qvm/measurement<dot>lisp file
qvm/misc.lisp: The qvm/misc<dot>lisp file
qvm/noisy-qvm.lisp: The qvm/noisy-qvm<dot>lisp file
qvm/package.lisp: The qvm/package<dot>lisp file
qvm/path-simulate.lisp: The qvm/path-simulate<dot>lisp file
qvm/qam.lisp: The qvm/qam<dot>lisp file
qvm/qvm.lisp: The qvm/qvm<dot>lisp file
qvm/shm.lisp: The qvm/shm<dot>lisp file
qvm/transition-classical-instructions.lisp: The qvm/transition-classical-instructions<dot>lisp file
qvm/transition.lisp: The qvm/transition<dot>lisp file
qvm/utilities.lisp: The qvm/utilities<dot>lisp file
qvm/wavefunction.lisp: The qvm/wavefunction<dot>lisp file

Jump to:   F   L   Q  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   Q   R   S   T   W   Z  
Index Entry  Section

%
%close: Internal functions
%ftruncate: Internal functions
%make-classical-memory: Internal functions
%make-nat-tuple: Internal functions
%make-shared-memory: Internal functions
%mmap: Internal functions
%munmap: Internal functions
%perform-and: Internal functions
%perform-integer-add: Internal functions
%perform-integer-div: Internal functions
%perform-integer-mul: Internal functions
%perform-integer-sub: Internal functions
%perform-ior: Internal functions
%perform-move: Internal functions
%perform-real-add: Internal functions
%perform-real-div: Internal functions
%perform-real-mul: Internal functions
%perform-real-sub: Internal functions
%perform-xor: Internal functions
%serial-norm: Internal functions
%strerror: Internal functions
%trial-amplitudes: Internal generic functions
%trial-amplitudes: Internal generic functions
%var-accessor-%errno: Internal functions

(
(setf %trial-amplitudes): Internal generic functions
(setf %trial-amplitudes): Internal generic functions
(setf %var-accessor-%errno): Internal functions
(setf amplitudes): Internal generic functions
(setf amplitudes): Internal generic functions
(setf dereference-mref): Internal functions
(setf gate-definitions): Internal generic functions
(setf gate-definitions): Internal generic functions
(setf memory-bit-ref): Exported functions
(setf memory-integer-ref): Exported functions
(setf memory-octet-ref): Exported functions
(setf memory-real-ref): Exported functions
(setf memory-ref): Exported functions
(setf memory-view-ref): Internal functions
(setf noisy-gate-definitions): Internal generic functions
(setf noisy-gate-definitions): Internal generic functions
(setf noisy-gate-definitions): Internal generic functions
(setf nth-amplitude): Exported functions
(setf pc): Internal generic functions
(setf pc): Internal generic functions
(setf posix-shared-memory-name): Internal functions
(setf posix-shared-memory-pointer): Internal functions
(setf posix-shared-memory-size): Internal functions
(setf probability-gate-x): Internal generic functions
(setf probability-gate-x): Internal generic functions
(setf probability-gate-y): Internal generic functions
(setf probability-gate-y): Internal generic functions
(setf probability-gate-z): Internal generic functions
(setf probability-gate-z): Internal generic functions
(setf probability-measure-x): Internal generic functions
(setf probability-measure-x): Internal generic functions
(setf probability-measure-y): Internal generic functions
(setf probability-measure-y): Internal generic functions
(setf probability-measure-z): Internal generic functions
(setf probability-measure-z): Internal generic functions
(setf program): Internal generic functions
(setf program): Internal generic functions
(setf program-compiled-p): Internal generic functions
(setf program-compiled-p): Internal generic functions
(setf readout-povms): Internal generic functions
(setf readout-povms): Internal generic functions
(setf readout-povms): Internal generic functions
(setf source-instruction): Internal generic functions
(setf source-instruction): Internal generic functions
(setf temporary-state): Internal generic functions
(setf temporary-state): Internal generic functions

A
add-depolarizing-noise: Internal functions
allocate-memory-for-model: Internal functions
allocate-vector: Exported generic functions
allocate-vector: Exported generic functions
allocate-vector: Exported generic functions
allocate-vector: Exported generic functions
allocation-length: Exported generic functions
allocation-length: Exported generic functions
allocation-length: Exported generic functions
allocation-length: Exported generic functions
allocation-name: Internal generic functions
allocation-name: Internal generic functions
amplitudes: Internal generic functions
amplitudes: Internal generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-gate: Exported generic functions
apply-matrix-operator: Exported functions
apply-operator: Exported functions
apply-superoperator: Internal generic functions
apply-superoperator: Internal generic functions
assert-in-bounds: Internal functions

B
barf-memory: Internal functions
boolean-bit: Internal functions
bring-to-zero-state: Internal functions

C
call-at-exit: Internal functions
cflonum: Exported compiler macros
cflonum: Exported functions
check-classical-memory-bounds: Internal functions
check-kraus-ops: Internal functions
check-povm: Internal functions
classical-memories: Internal generic functions
classical-memories: Internal generic functions
classical-memories: Internal generic functions
classical-memory-model: Internal generic functions
classical-memory-model: Internal generic functions
classical-memory-model: Internal generic functions
classical-memory-p: Internal functions
classical-memory-subsystem: Exported generic functions
classical-memory-subsystem: Exported generic functions
compile-instruction: Internal generic functions
compile-instruction: Internal generic functions
compile-instruction: Internal generic functions
compile-instruction: Internal generic functions
compile-lambda: Internal functions
compile-loaded-program: Internal generic functions
compile-loaded-program: Internal generic functions
compile-loaded-program: Internal generic functions
compile-loaded-program: Internal generic functions
compile-loaded-program: Internal generic functions
compile-measure-chains: Internal functions
compile-operator: Internal generic functions
compile-operator: Internal generic functions
compile-operator: Internal generic functions
compile-operator: Internal generic functions
compile-operator: Internal generic functions
compiled-gate-apply-operator: Internal generic functions
compiled-gate-apply-operator: Internal generic functions
compiled-matrix: Internal generic functions
compiled-matrix: Internal generic functions
Compiler Macro, cflonum: Exported compiler macros
Compiler Macro, flonum: Exported compiler macros
compose-operators: Internal functions
conjugate-entrywise: Internal generic functions
conjugate-entrywise: Internal generic functions
conjugate-entrywise: Internal generic functions
conjugate-entrywise: Internal generic functions
copy-hash-table: Internal functions
copy-memory-view: Internal functions
copy-posix-shared-memory: Internal functions
copy-wavefunction: Exported functions
corrupt-measurement-outcome: Internal functions
count-logical-cores: Exported functions
cumulative-distribution-function: Internal functions
current-instruction: Internal functions

D
dagger: Internal functions
deallocate-all-shared-memories: Internal functions
define-binary-transition: Internal macros
define-direct-comparator: Internal macros
define-indirect-comparator: Internal macros
define-matmul: Internal macros
defun-inlinable: Internal macros
density-matrix-view: Internal generic functions
density-matrix-view: Internal generic functions
density-qvm-force-measurement: Internal functions
density-qvm-measurement-probabilities: Internal functions
density-qvm-qubit-probability: Internal functions
dereference-mref: Internal functions
do-nat-tuple: Internal macros
dummy-finalizer: Internal functions

E
eject-bit: Internal functions
eject-bit-code: Internal functions
ensure-s64: Internal functions
ensure-signed-integer: Internal functions
extract-amplitudes: Internal functions

F
find-measure-chains: Internal functions
find-or-make-apply-matrix-operator-function: Internal functions
flonum: Exported compiler macros
flonum: Exported functions
force-measurement: Exported functions
force-parameter: Internal functions
free-posix-shared-memory: Internal functions
full-density-number-of-qubits: Internal functions
Function, %close: Internal functions
Function, %ftruncate: Internal functions
Function, %make-classical-memory: Internal functions
Function, %make-nat-tuple: Internal functions
Function, %make-shared-memory: Internal functions
Function, %mmap: Internal functions
Function, %munmap: Internal functions
Function, %perform-and: Internal functions
Function, %perform-integer-add: Internal functions
Function, %perform-integer-div: Internal functions
Function, %perform-integer-mul: Internal functions
Function, %perform-integer-sub: Internal functions
Function, %perform-ior: Internal functions
Function, %perform-move: Internal functions
Function, %perform-real-add: Internal functions
Function, %perform-real-div: Internal functions
Function, %perform-real-mul: Internal functions
Function, %perform-real-sub: Internal functions
Function, %perform-xor: Internal functions
Function, %serial-norm: Internal functions
Function, %strerror: Internal functions
Function, %var-accessor-%errno: Internal functions
Function, (setf %var-accessor-%errno): Internal functions
Function, (setf dereference-mref): Internal functions
Function, (setf memory-bit-ref): Exported functions
Function, (setf memory-integer-ref): Exported functions
Function, (setf memory-octet-ref): Exported functions
Function, (setf memory-real-ref): Exported functions
Function, (setf memory-ref): Exported functions
Function, (setf memory-view-ref): Internal functions
Function, (setf nth-amplitude): Exported functions
Function, (setf posix-shared-memory-name): Internal functions
Function, (setf posix-shared-memory-pointer): Internal functions
Function, (setf posix-shared-memory-size): Internal functions
Function, add-depolarizing-noise: Internal functions
Function, allocate-memory-for-model: Internal functions
Function, apply-matrix-operator: Exported functions
Function, apply-operator: Exported functions
Function, assert-in-bounds: Internal functions
Function, barf-memory: Internal functions
Function, boolean-bit: Internal functions
Function, bring-to-zero-state: Internal functions
Function, call-at-exit: Internal functions
Function, cflonum: Exported functions
Function, check-classical-memory-bounds: Internal functions
Function, check-kraus-ops: Internal functions
Function, check-povm: Internal functions
Function, classical-memory-p: Internal functions
Function, compile-lambda: Internal functions
Function, compile-measure-chains: Internal functions
Function, compose-operators: Internal functions
Function, copy-hash-table: Internal functions
Function, copy-memory-view: Internal functions
Function, copy-posix-shared-memory: Internal functions
Function, copy-wavefunction: Exported functions
Function, corrupt-measurement-outcome: Internal functions
Function, count-logical-cores: Exported functions
Function, cumulative-distribution-function: Internal functions
Function, current-instruction: Internal functions
Function, dagger: Internal functions
Function, deallocate-all-shared-memories: Internal functions
Function, density-qvm-force-measurement: Internal functions
Function, density-qvm-measurement-probabilities: Internal functions
Function, density-qvm-qubit-probability: Internal functions
Function, dereference-mref: Internal functions
Function, dummy-finalizer: Internal functions
Function, eject-bit: Internal functions
Function, eject-bit-code: Internal functions
Function, ensure-s64: Internal functions
Function, ensure-signed-integer: Internal functions
Function, extract-amplitudes: Internal functions
Function, find-measure-chains: Internal functions
Function, find-or-make-apply-matrix-operator-function: Internal functions
Function, flonum: Exported functions
Function, force-measurement: Exported functions
Function, force-parameter: Internal functions
Function, free-posix-shared-memory: Internal functions
Function, full-density-number-of-qubits: Internal functions
Function, generate-amplitude-address-code: Internal functions
Function, generate-complement-iteration: Internal functions
Function, generate-extraction-code: Internal functions
Function, generate-gate-application-code: Internal functions
Function, generate-inner-matrix-multiply-code: Internal functions
Function, generate-permutation-gate-application-code: Internal functions
Function, generate-permutation-gate-code: Internal functions
Function, getpagesize: Internal functions
Function, half: Internal functions
Function, index-to-address: Internal functions
Function, initialize-random-state: Internal functions
Function, inject-bit: Internal functions
Function, inject-bit-code: Internal functions
Function, insert-amplitudes: Internal functions
Function, install-gates: Internal functions
Function, kraus-list: Internal functions
Function, kraus-list%0: Internal functions
Function, kronecker-multiply: Internal functions
Function, lift-matrix-to-superoperator: Internal functions
Function, list-classical-states: Internal functions
Function, load-program: Exported functions
Function, loaded-program-length: Internal functions
Function, lookup-gate: Internal functions
Function, magicl-matrix-to-quantum-operator: Internal functions
Function, make-classical-memory: Exported functions
Function, make-density-qvm: Exported functions
Function, make-lisp-cflonum-vector: Internal functions
Function, make-matrix: Internal functions
Function, make-pauli-noise-map: Exported functions
Function, make-pauli-perturbed-1q-gate: Internal functions
Function, make-posix-shared-memory: Internal functions
Function, make-qvm: Exported functions
Function, make-shared-array: Internal functions
Function, make-vector-from-pointer: Internal functions
Function, map-amplitudes: Exported functions
Function, map-classical-state: Internal functions
Function, map-complement: Internal functions
Function, map-complement-in-parallel: Internal functions
Function, map-complement-in-parallel-truly: Internal functions
Function, map-reordered-amplitudes: Internal functions
Function, map-reordered-amplitudes-in-parallel: Internal functions
Function, map-reordered-amplitudes-in-parallel-truly: Internal functions
Function, matmul2: Internal functions
Function, matmul4: Internal functions
Function, matmul8: Internal functions
Function, matrix-multiply: Internal functions
Function, matrix-multiply-code: Internal functions
Function, measure-and-store: Internal functions
Function, measure-chain-at: Internal functions
Function, measure-chain-to-instruction: Internal functions
Function, memory-bit-ref: Exported functions
Function, memory-descriptors-to-qvm-memory-model: Exported functions
Function, memory-integer-ref: Exported functions
Function, memory-octet-ref: Exported functions
Function, memory-pointer: Internal functions
Function, memory-real-ref: Exported functions
Function, memory-ref: Exported functions
Function, memory-size: Internal functions
Function, memory-view: Internal functions
Function, memory-view-aliasing-classical-memory: Internal functions
Function, memory-view-classical-memory: Internal functions
Function, memory-view-length: Internal functions
Function, memory-view-p: Internal functions
Function, memory-view-reader: Internal functions
Function, memory-view-ref: Internal functions
Function, memory-view-root-classical-memory: Internal functions
Function, memory-view-writer: Internal functions
Function, midpoint: Internal functions
Function, naive-measure-all: Internal functions
Function, nat-tuple: Internal functions
Function, nat-tuple-cardinality: Internal functions
Function, nat-tuple-complement: Internal functions
Function, nop-count: Internal functions
Function, norm: Internal functions
Function, normalize-wavefunction: Exported functions
Function, nth-amplitude: Exported functions
Function, octets-required-for-quantum-state: Exported functions
Function, octets-required-for-qubits: Exported functions
Function, outer-multiply: Internal functions
Function, path-simulate: Exported functions
Function, permutation-to-transpositions: Internal functions
Function, perturb-measured-bits: Internal functions
Function, perturb-measurement: Internal functions
Function, posix-shared-memory-finalizer: Internal functions
Function, posix-shared-memory-name: Internal functions
Function, posix-shared-memory-p: Internal functions
Function, posix-shared-memory-pointer: Internal functions
Function, posix-shared-memory-size: Internal functions
Function, prepare-for-parallelization: Exported functions
Function, probability: Exported functions
Function, program-matrix: Exported functions
Function, psum: Internal functions
Function, pull-teeth-to-get-a-gate: Internal functions
Function, qubit-probability: Exported functions
Function, quil-name: Internal functions
Function, requires-swapping-p: Internal functions
Function, reset-classical-memory: Internal functions
Function, root-memory-view-p: Internal functions
Function, round-to-next-page: Internal functions
Function, round-up-to-next-multiple: Internal functions
Function, run-program: Exported functions
Function, sample-wavefunction-as-distribution: Internal functions
Function, sample-wavefunction-as-distribution-in-parallel: Internal functions
Function, sample-wavefunction-as-distribution-in-parallel-truly: Internal functions
Function, sample-wavefunction-multiple-times: Internal functions
Function, seeded-random-state: Exported functions
Function, set-qubit-components-of-amplitude-address: Internal functions
Function, shm-unlink: Internal functions
Function, shm-vector-allocation-size: Internal functions
Function, shm-vector-from-pointer: Internal functions
Function, shm-vector-header-size: Internal functions
Function, simple-array-allocation-size: Internal functions
Function, single-kraus: Internal functions
Function, single-kraus%0: Internal functions
Function, size-of: Internal functions
Function, slurp-memory: Internal functions
Function, subdivide: Internal functions
Function, sysconf: Internal functions
Function, tr: Internal functions
Function, typed-reader/writer: Internal functions
Function, warm-apply-matrix-operator-cache: Exported functions
Function, wavefunction-from-path-simulation: Exported functions
Function, wavefunction-qubits: Internal functions
Function, zero-out-classical-memory: Exported functions

G
gate-definitions: Internal generic functions
gate-definitions: Internal generic functions
generate-amplitude-address-code: Internal functions
generate-complement-iteration: Internal functions
generate-extraction-code: Internal functions
generate-gate-application-code: Internal functions
generate-inner-matrix-multiply-code: Internal functions
generate-permutation-gate-application-code: Internal functions
generate-permutation-gate-code: Internal functions
Generic Function, %trial-amplitudes: Internal generic functions
Generic Function, (setf %trial-amplitudes): Internal generic functions
Generic Function, (setf amplitudes): Internal generic functions
Generic Function, (setf gate-definitions): Internal generic functions
Generic Function, (setf noisy-gate-definitions): Internal generic functions
Generic Function, (setf pc): Internal generic functions
Generic Function, (setf probability-gate-x): Internal generic functions
Generic Function, (setf probability-gate-y): Internal generic functions
Generic Function, (setf probability-gate-z): Internal generic functions
Generic Function, (setf probability-measure-x): Internal generic functions
Generic Function, (setf probability-measure-y): Internal generic functions
Generic Function, (setf probability-measure-z): Internal generic functions
Generic Function, (setf program): Internal generic functions
Generic Function, (setf program-compiled-p): Internal generic functions
Generic Function, (setf readout-povms): Internal generic functions
Generic Function, (setf source-instruction): Internal generic functions
Generic Function, (setf temporary-state): Internal generic functions
Generic Function, allocate-vector: Exported generic functions
Generic Function, allocation-length: Exported generic functions
Generic Function, allocation-name: Internal generic functions
Generic Function, amplitudes: Internal generic functions
Generic Function, apply-gate: Exported generic functions
Generic Function, apply-superoperator: Internal generic functions
Generic Function, classical-memories: Internal generic functions
Generic Function, classical-memory-model: Internal generic functions
Generic Function, classical-memory-subsystem: Exported generic functions
Generic Function, compile-instruction: Internal generic functions
Generic Function, compile-loaded-program: Internal generic functions
Generic Function, compile-operator: Internal generic functions
Generic Function, compiled-gate-apply-operator: Internal generic functions
Generic Function, compiled-matrix: Internal generic functions
Generic Function, conjugate-entrywise: Internal generic functions
Generic Function, density-matrix-view: Internal generic functions
Generic Function, gate-definitions: Internal generic functions
Generic Function, invalid-instruction: Exported generic functions
Generic Function, invalid-reason: Exported generic functions
Generic Function, measure: Exported generic functions
Generic Function, measure-all: Exported generic functions
Generic Function, measure-all-storage: Internal generic functions
Generic Function, noisy-gate-definitions: Internal generic functions
Generic Function, number-of-qubits: Exported generic functions
Generic Function, oob-from: Internal generic functions
Generic Function, oob-index: Internal generic functions
Generic Function, oob-name: Internal generic functions
Generic Function, oob-to: Internal generic functions
Generic Function, original-amplitude-pointer: Internal generic functions
Generic Function, pc: Internal generic functions
Generic Function, probability-gate-x: Internal generic functions
Generic Function, probability-gate-y: Internal generic functions
Generic Function, probability-gate-z: Internal generic functions
Generic Function, probability-measure-x: Internal generic functions
Generic Function, probability-measure-y: Internal generic functions
Generic Function, probability-measure-z: Internal generic functions
Generic Function, program: Internal generic functions
Generic Function, program-compiled-p: Internal generic functions
Generic Function, readout-povms: Internal generic functions
Generic Function, reset-quantum-state: Internal generic functions
Generic Function, run: Exported generic functions
Generic Function, set-noisy-gate: Exported generic functions
Generic Function, set-readout-povm: Internal generic functions
Generic Function, source-gate: Internal generic functions
Generic Function, source-instruction: Internal generic functions
Generic Function, temporary-state: Internal generic functions
Generic Function, transition: Exported generic functions
getpagesize: Internal functions

H
half: Internal functions

I
index-to-address: Internal functions
initialize-random-state: Internal functions
inject-bit: Internal functions
inject-bit-code: Internal functions
insert-amplitudes: Internal functions
install-gates: Internal functions
invalid-instruction: Exported generic functions
invalid-instruction: Exported generic functions
invalid-reason: Exported generic functions
invalid-reason: Exported generic functions

K
kraus-list: Internal functions
kraus-list%0: Internal functions
kronecker-multiply: Internal functions

L
lift-matrix-to-superoperator: Internal functions
list-classical-states: Internal functions
load-program: Exported functions
loaded-program-length: Internal functions
lookup-gate: Internal functions

M
Macro, define-binary-transition: Internal macros
Macro, define-direct-comparator: Internal macros
Macro, define-indirect-comparator: Internal macros
Macro, define-matmul: Internal macros
Macro, defun-inlinable: Internal macros
Macro, do-nat-tuple: Internal macros
Macro, measuring-gc: Internal macros
Macro, pdotimes: Internal macros
Macro, probabilistically: Internal macros
Macro, psum-dotimes: Internal macros
Macro, shm-open: Internal macros
Macro, with-modified-amplitudes: Internal macros
Macro, with-random-state: Exported macros
magicl-matrix-to-quantum-operator: Internal functions
make-classical-memory: Exported functions
make-density-qvm: Exported functions
make-lisp-cflonum-vector: Internal functions
make-matrix: Internal functions
make-pauli-noise-map: Exported functions
make-pauli-perturbed-1q-gate: Internal functions
make-posix-shared-memory: Internal functions
make-qvm: Exported functions
make-shared-array: Internal functions
make-vector-from-pointer: Internal functions
map-amplitudes: Exported functions
map-classical-state: Internal functions
map-complement: Internal functions
map-complement-in-parallel: Internal functions
map-complement-in-parallel-truly: Internal functions
map-reordered-amplitudes: Internal functions
map-reordered-amplitudes-in-parallel: Internal functions
map-reordered-amplitudes-in-parallel-truly: Internal functions
matmul2: Internal functions
matmul4: Internal functions
matmul8: Internal functions
matrix-multiply: Internal functions
matrix-multiply-code: Internal functions
measure: Exported generic functions
measure: Exported generic functions
measure: Exported generic functions
measure-all: Exported generic functions
measure-all: Exported generic functions
measure-all: Exported generic functions
measure-all: Exported generic functions
measure-all: Exported generic functions
measure-all-storage: Internal generic functions
measure-all-storage: Internal generic functions
measure-and-store: Internal functions
measure-chain-at: Internal functions
measure-chain-to-instruction: Internal functions
measuring-gc: Internal macros
memory-bit-ref: Exported functions
memory-descriptors-to-qvm-memory-model: Exported functions
memory-integer-ref: Exported functions
memory-octet-ref: Exported functions
memory-pointer: Internal functions
memory-real-ref: Exported functions
memory-ref: Exported functions
memory-size: Internal functions
memory-view: Internal functions
memory-view-aliasing-classical-memory: Internal functions
memory-view-classical-memory: Internal functions
memory-view-length: Internal functions
memory-view-p: Internal functions
memory-view-reader: Internal functions
memory-view-ref: Internal functions
memory-view-root-classical-memory: Internal functions
memory-view-writer: Internal functions
Method, %trial-amplitudes: Internal generic functions
Method, (setf %trial-amplitudes): Internal generic functions
Method, (setf amplitudes): Internal generic functions
Method, (setf gate-definitions): Internal generic functions
Method, (setf noisy-gate-definitions): Internal generic functions
Method, (setf noisy-gate-definitions): Internal generic functions
Method, (setf pc): Internal generic functions
Method, (setf probability-gate-x): Internal generic functions
Method, (setf probability-gate-y): Internal generic functions
Method, (setf probability-gate-z): Internal generic functions
Method, (setf probability-measure-x): Internal generic functions
Method, (setf probability-measure-y): Internal generic functions
Method, (setf probability-measure-z): Internal generic functions
Method, (setf program): Internal generic functions
Method, (setf program-compiled-p): Internal generic functions
Method, (setf readout-povms): Internal generic functions
Method, (setf readout-povms): Internal generic functions
Method, (setf source-instruction): Internal generic functions
Method, (setf temporary-state): Internal generic functions
Method, allocate-vector: Exported generic functions
Method, allocate-vector: Exported generic functions
Method, allocate-vector: Exported generic functions
Method, allocation-length: Exported generic functions
Method, allocation-length: Exported generic functions
Method, allocation-length: Exported generic functions
Method, allocation-name: Internal generic functions
Method, amplitudes: Internal generic functions
Method, apply-gate: Exported generic functions
Method, apply-gate: Exported generic functions
Method, apply-gate: Exported generic functions
Method, apply-gate: Exported generic functions
Method, apply-gate: Exported generic functions
Method, apply-gate: Exported generic functions
Method, apply-gate: Exported generic functions
Method, apply-superoperator: Internal generic functions
Method, classical-memories: Internal generic functions
Method, classical-memories: Internal generic functions
Method, classical-memory-model: Internal generic functions
Method, classical-memory-model: Internal generic functions
Method, classical-memory-subsystem: Exported generic functions
Method, compile-instruction: Internal generic functions
Method, compile-instruction: Internal generic functions
Method, compile-instruction: Internal generic functions
Method, compile-loaded-program: Internal generic functions
Method, compile-loaded-program: Internal generic functions
Method, compile-loaded-program: Internal generic functions
Method, compile-loaded-program: Internal generic functions
Method, compile-operator: Internal generic functions
Method, compile-operator: Internal generic functions
Method, compile-operator: Internal generic functions
Method, compile-operator: Internal generic functions
Method, compiled-gate-apply-operator: Internal generic functions
Method, compiled-matrix: Internal generic functions
Method, conjugate-entrywise: Internal generic functions
Method, conjugate-entrywise: Internal generic functions
Method, conjugate-entrywise: Internal generic functions
Method, density-matrix-view: Internal generic functions
Method, gate-definitions: Internal generic functions
Method, invalid-instruction: Exported generic functions
Method, invalid-reason: Exported generic functions
Method, measure: Exported generic functions
Method, measure: Exported generic functions
Method, measure-all: Exported generic functions
Method, measure-all: Exported generic functions
Method, measure-all: Exported generic functions
Method, measure-all: Exported generic functions
Method, measure-all-storage: Internal generic functions
Method, noisy-gate-definitions: Internal generic functions
Method, noisy-gate-definitions: Internal generic functions
Method, number-of-qubits: Exported generic functions
Method, oob-from: Internal generic functions
Method, oob-index: Internal generic functions
Method, oob-name: Internal generic functions
Method, oob-to: Internal generic functions
Method, original-amplitude-pointer: Internal generic functions
Method, pc: Internal generic functions
Method, probability-gate-x: Internal generic functions
Method, probability-gate-y: Internal generic functions
Method, probability-gate-z: Internal generic functions
Method, probability-measure-x: Internal generic functions
Method, probability-measure-y: Internal generic functions
Method, probability-measure-z: Internal generic functions
Method, program: Internal generic functions
Method, program-compiled-p: Internal generic functions
Method, readout-povms: Internal generic functions
Method, readout-povms: Internal generic functions
Method, reset-quantum-state: Internal generic functions
Method, reset-quantum-state: Internal generic functions
Method, run: Exported generic functions
Method, run: Exported generic functions
Method, set-noisy-gate: Exported generic functions
Method, set-noisy-gate: Exported generic functions
Method, set-readout-povm: Internal generic functions
Method, set-readout-povm: Internal generic functions
Method, source-gate: Internal generic functions
Method, source-instruction: Internal generic functions
Method, temporary-state: Internal generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
Method, transition: Exported generic functions
midpoint: Internal functions

N
naive-measure-all: Internal functions
nat-tuple: Internal functions
nat-tuple-cardinality: Internal functions
nat-tuple-complement: Internal functions
noisy-gate-definitions: Internal generic functions
noisy-gate-definitions: Internal generic functions
noisy-gate-definitions: Internal generic functions
nop-count: Internal functions
norm: Internal functions
normalize-wavefunction: Exported functions
nth-amplitude: Exported functions
number-of-qubits: Exported generic functions
number-of-qubits: Exported generic functions

O
octets-required-for-quantum-state: Exported functions
octets-required-for-qubits: Exported functions
oob-from: Internal generic functions
oob-from: Internal generic functions
oob-index: Internal generic functions
oob-index: Internal generic functions
oob-name: Internal generic functions
oob-name: Internal generic functions
oob-to: Internal generic functions
oob-to: Internal generic functions
original-amplitude-pointer: Internal generic functions
original-amplitude-pointer: Internal generic functions
outer-multiply: Internal functions

P
path-simulate: Exported functions
pc: Internal generic functions
pc: Internal generic functions
pdotimes: Internal macros
permutation-to-transpositions: Internal functions
perturb-measured-bits: Internal functions
perturb-measurement: Internal functions
posix-shared-memory-finalizer: Internal functions
posix-shared-memory-name: Internal functions
posix-shared-memory-p: Internal functions
posix-shared-memory-pointer: Internal functions
posix-shared-memory-size: Internal functions
prepare-for-parallelization: Exported functions
probabilistically: Internal macros
probability: Exported functions
probability-gate-x: Internal generic functions
probability-gate-x: Internal generic functions
probability-gate-y: Internal generic functions
probability-gate-y: Internal generic functions
probability-gate-z: Internal generic functions
probability-gate-z: Internal generic functions
probability-measure-x: Internal generic functions
probability-measure-x: Internal generic functions
probability-measure-y: Internal generic functions
probability-measure-y: Internal generic functions
probability-measure-z: Internal generic functions
probability-measure-z: Internal generic functions
program: Internal generic functions
program: Internal generic functions
program-compiled-p: Internal generic functions
program-compiled-p: Internal generic functions
program-matrix: Exported functions
psum: Internal functions
psum-dotimes: Internal macros
pull-teeth-to-get-a-gate: Internal functions

Q
qubit-probability: Exported functions
quil-name: Internal functions

R
readout-povms: Internal generic functions
readout-povms: Internal generic functions
readout-povms: Internal generic functions
requires-swapping-p: Internal functions
reset-classical-memory: Internal functions
reset-quantum-state: Internal generic functions
reset-quantum-state: Internal generic functions
reset-quantum-state: Internal generic functions
root-memory-view-p: Internal functions
round-to-next-page: Internal functions
round-up-to-next-multiple: Internal functions
run: Exported generic functions
run: Exported generic functions
run: Exported generic functions
run-program: Exported functions

S
sample-wavefunction-as-distribution: Internal functions
sample-wavefunction-as-distribution-in-parallel: Internal functions
sample-wavefunction-as-distribution-in-parallel-truly: Internal functions
sample-wavefunction-multiple-times: Internal functions
seeded-random-state: Exported functions
set-noisy-gate: Exported generic functions
set-noisy-gate: Exported generic functions
set-noisy-gate: Exported generic functions
set-qubit-components-of-amplitude-address: Internal functions
set-readout-povm: Internal generic functions
set-readout-povm: Internal generic functions
set-readout-povm: Internal generic functions
shm-open: Internal macros
shm-unlink: Internal functions
shm-vector-allocation-size: Internal functions
shm-vector-from-pointer: Internal functions
shm-vector-header-size: Internal functions
simple-array-allocation-size: Internal functions
single-kraus: Internal functions
single-kraus%0: Internal functions
size-of: Internal functions
slurp-memory: Internal functions
source-gate: Internal generic functions
source-gate: Internal generic functions
source-instruction: Internal generic functions
source-instruction: Internal generic functions
subdivide: Internal functions
sysconf: Internal functions

T
temporary-state: Internal generic functions
temporary-state: Internal generic functions
tr: Internal functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
transition: Exported generic functions
typed-reader/writer: Internal functions

W
warm-apply-matrix-operator-cache: Exported functions
wavefunction-from-path-simulation: Exported functions
wavefunction-qubits: Internal functions
with-modified-amplitudes: Internal macros
with-random-state: Exported macros

Z
zero-out-classical-memory: Exported functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   Q   R   S   T   W   Z  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   $   %   *   +  
A   C   F   G   I   L   M   N   O   P   R   S   T   W  
Index Entry  Section

$
$map-failed: Internal constants
$map-shared: Internal constants
$o-creat: Internal constants
$o-excl: Internal constants
$o-rdwr: Internal constants
$prot-read: Internal constants
$prot-write: Internal constants
$sc-nprocessors-onln: Internal constants
$sc-page-size: Internal constants

%
%0: Internal structures
%0: Internal structures
%errno: Internal symbol macros

*
*compile-before-running*: Exported special variables
*optimize-briskly*: Internal special variables
*optimize-dangerously-fast*: Internal special variables
*optimize-safely*: Internal special variables
*qubits-required-for-parallelization*: Exported special variables
*transition-verbose*: Exported special variables

+
+max-nat-tuple-cardinality+: Internal constants
+octets-per-cflonum+: Internal constants
+octets-per-flonum+: Internal constants

A
aliasing-classical-memory: Internal structures
amplitudes: Exported classes
apply-operator: Internal classes

C
classical-memories: Exported classes
classical-memory-model: Exported classes
classical-memory-subsystem: Exported classes
Constant, $map-failed: Internal constants
Constant, $map-shared: Internal constants
Constant, $o-creat: Internal constants
Constant, $o-excl: Internal constants
Constant, $o-rdwr: Internal constants
Constant, $prot-read: Internal constants
Constant, $prot-write: Internal constants
Constant, $sc-nprocessors-onln: Internal constants
Constant, $sc-page-size: Internal constants
Constant, +max-nat-tuple-cardinality+: Internal constants
Constant, +octets-per-cflonum+: Internal constants
Constant, +octets-per-flonum+: Internal constants
Constant, size-of-mode_t: Internal constants
Constant, size-of-off_t: Internal constants
Constant, size-of-size_t: Internal constants

F
from: Exported conditions

G
gate-definitions: Exported classes
gate-matrix: Internal classes

I
index: Exported conditions
instruction: Exported conditions

L
length: Exported classes
length: Exported classes
length: Exported classes
length: Internal structures

M
matrix-view: Exported classes

N
name: Exported conditions
name: Exported classes
name: Internal structures
noisy-gate-definitions: Exported classes
noisy-gate-definitions: Exported classes
number-of-qubits: Exported classes

O
original-amplitude-pointer: Exported classes

P
pointer: Exported structures
pointer: Internal structures
probability-gate-x: Exported classes
probability-gate-y: Exported classes
probability-gate-z: Exported classes
probability-measure-x: Exported classes
probability-measure-y: Exported classes
probability-measure-z: Exported classes
program: Exported classes
program-compiled-p: Exported classes
program-counter: Exported classes

R
reader: Internal structures
readout-povms: Exported classes
readout-povms: Exported classes
reason: Exported conditions
root-classical-memory: Internal structures

S
size: Exported structures
size: Internal structures
size-of-mode_t: Internal constants
size-of-off_t: Internal constants
size-of-size_t: Internal constants
Slot, %0: Internal structures
Slot, %0: Internal structures
Slot, aliasing-classical-memory: Internal structures
Slot, amplitudes: Exported classes
Slot, apply-operator: Internal classes
Slot, classical-memories: Exported classes
Slot, classical-memory-model: Exported classes
Slot, classical-memory-subsystem: Exported classes
Slot, from: Exported conditions
Slot, gate-definitions: Exported classes
Slot, gate-matrix: Internal classes
Slot, index: Exported conditions
Slot, instruction: Exported conditions
Slot, length: Exported classes
Slot, length: Exported classes
Slot, length: Exported classes
Slot, length: Internal structures
Slot, matrix-view: Exported classes
Slot, name: Exported conditions
Slot, name: Exported classes
Slot, name: Internal structures
Slot, noisy-gate-definitions: Exported classes
Slot, noisy-gate-definitions: Exported classes
Slot, number-of-qubits: Exported classes
Slot, original-amplitude-pointer: Exported classes
Slot, pointer: Exported structures
Slot, pointer: Internal structures
Slot, probability-gate-x: Exported classes
Slot, probability-gate-y: Exported classes
Slot, probability-gate-z: Exported classes
Slot, probability-measure-x: Exported classes
Slot, probability-measure-y: Exported classes
Slot, probability-measure-z: Exported classes
Slot, program: Exported classes
Slot, program-compiled-p: Exported classes
Slot, program-counter: Exported classes
Slot, reader: Internal structures
Slot, readout-povms: Exported classes
Slot, readout-povms: Exported classes
Slot, reason: Exported conditions
Slot, root-classical-memory: Internal structures
Slot, size: Exported structures
Slot, size: Internal structures
Slot, source-gate: Internal classes
Slot, source-instruction: Internal classes
Slot, storage: Exported classes
Slot, temporary-state: Exported classes
Slot, to: Exported conditions
Slot, trial-amplitudes: Exported classes
Slot, writer: Internal structures
source-gate: Internal classes
source-instruction: Internal classes
Special Variable, *compile-before-running*: Exported special variables
Special Variable, *optimize-briskly*: Internal special variables
Special Variable, *optimize-dangerously-fast*: Internal special variables
Special Variable, *optimize-safely*: Internal special variables
Special Variable, *qubits-required-for-parallelization*: Exported special variables
Special Variable, *transition-verbose*: Exported special variables
storage: Exported classes
Symbol Macro, %errno: Internal symbol macros

T
temporary-state: Exported classes
to: Exported conditions
trial-amplitudes: Exported classes

W
writer: Internal structures

Jump to:   $   %   *   +  
A   C   F   G   I   L   M   N   O   P   R   S   T   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   D   F   I   K   L   M   N   P   Q   S   T  
Index Entry  Section

A
amplitude-address: Internal types

C
c-allocation: Exported classes
cflonum: Exported types
cflonum-vector: Internal types
Class, c-allocation: Exported classes
Class, classical-memory-subsystem: Exported classes
Class, compiled-gate-application: Internal classes
Class, compiled-matrix-gate-application: Internal classes
Class, compiled-permutation-gate-application: Internal classes
Class, density-qvm: Exported classes
Class, depolarizing-qvm: Exported classes
Class, lisp-allocation: Exported classes
Class, measure-all: Exported classes
Class, noisy-qvm: Exported classes
Class, posix-shared-memory-allocation: Exported classes
Class, pure-state-qvm: Exported classes
Class, quantum-abstract-machine: Exported classes
classical-memory: Exported structures
classical-memory-subsystem: Exported classes
compiled-gate-application: Internal classes
compiled-matrix-gate-application: Internal classes
compiled-permutation-gate-application: Internal classes
Condition, invalid-instruction-encountered: Exported conditions
Condition, memory-index-out-of-bounds: Exported conditions

D
density-qvm: Exported classes
depolarizing-qvm: Exported classes

F
finalizer: Internal types
flonum: Exported types
flonum-vector: Internal types

I
invalid-instruction-encountered: Exported conditions

K
kraus-list: Internal structures

L
lisp-allocation: Exported classes

M
measure-all: Exported classes
memory-index-out-of-bounds: Exported conditions
memory-view: Internal structures

N
nat-tuple: Internal types
nat-tuple-cardinality: Internal types
nat-tuple-element: Internal types
noisy-qvm: Exported classes
non-negative-fixnum: Internal types

P
Package, qvm: The qvm package
parallelization-limit: Exported types
posix-shared-memory: Internal structures
posix-shared-memory-allocation: Exported classes
pure-state-qvm: Exported classes

Q
quantum-abstract-machine: Exported classes
quantum-operator: Exported types
quantum-state: Exported types
quil-bit: Exported types
quil-octet: Exported types
qvm: The qvm system
qvm: The qvm package
qvm-integer: Exported types
qvm-real: Exported types

S
single-kraus: Internal structures
Structure, classical-memory: Exported structures
Structure, kraus-list: Internal structures
Structure, memory-view: Internal structures
Structure, posix-shared-memory: Internal structures
Structure, single-kraus: Internal structures
Structure, superoperator: Internal structures
superoperator: Internal structures
System, qvm: The qvm system

T
Type, amplitude-address: Internal types
Type, cflonum: Exported types
Type, cflonum-vector: Internal types
Type, finalizer: Internal types
Type, flonum: Exported types
Type, flonum-vector: Internal types
Type, nat-tuple: Internal types
Type, nat-tuple-cardinality: Internal types
Type, nat-tuple-element: Internal types
Type, non-negative-fixnum: Internal types
Type, parallelization-limit: Exported types
Type, quantum-operator: Exported types
Type, quantum-state: Exported types
Type, quil-bit: Exported types
Type, quil-octet: Exported types
Type, qvm-integer: Exported types
Type, qvm-real: Exported types

Jump to:   A   C   D   F   I   K   L   M   N   P   Q   S   T