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.17.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 17:34:31 2021 GMT+0.


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

1 Introduction

qvm: The Rigetti Quantum Virtual Machine

github release docker pulls DOI

The Rigetti Quantum Virtual Machine (QVM) is a flexible and efficient simulator for Quil.

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

(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
$ make install

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.

Note: If you're on Windows and using the Command Prompt, the echo command is slightly different to the examples shown below: do not wrap your quil code in quotes. For example, in Command Prompt, you would do echo H 0 | qvm not echo "H 0" | qvm.

$ 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 Build, Test, and Release 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. To instead pull a specific version of the QVM, run docker pull rigetti/qvm:VERSION, where VERSION is something like 1.10.0.

Additionally, all branches and commits for the QVM repository have corresponding image tags. For example, the image that contains the HEAD of branch "qvm-fixes" can be pulled with docker pull rigetti/qvm:qvm-fixes (NOTE: some characters are invalid in Docker image tags, and are rewritten according to the description of CI_COMMIT_REF_SLUG). The image built from the commit with first eight characters abcd1234 can be pulled with docker pull rigetti/qvm:abcd1234.

The Dockerfile for qvm builds from two parent Docker images:

  1. rigetti/lisp: Contains SBCL, Quicklisp, and third-party libraries.
  2. rigetti/quilc: Contains the Quil Compiler.

The Dockerfile for qvm intentionally pins the versions of these two images, which means that the version numbers must be actively incremented as necessary. If the build for qvm is failing, this is probably the place to look, because the unit tests are run inside of a freshly-built qvm Docker image as part of the GitLab CI pipeline.

However, because the development workflow for the QVM often involves having a locally cloned copy of quilc master, there are two additional CI jobs that override the version of quilc and instead build off of rigetti/quilc:edge, which corresponds to the HEAD of master. These jobs are optional, meaning that if they fail the overall CI pipeline will not be marked as a failure, but they provide additional useful information to those that develop quilc and the QVM in unison.

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

Port 5000 is exposed using the EXPOSE directive in the rigetti/qvm image, so you can additionally use the -P option to automatically bind this container port to a randomly assigned host port. You can then inspect the mapping using docker port CONTAINER [PORT].

Release Process

  1. Update VERSION.txt 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.
  6. Update the qvm version of downstream dependencies (if applicable, see next section).

Downstream Dependencies

Currently, there are a couple different components of the Forest SDK that depend on the QVM:

  1. pyquil
  2. forest-benchmarking

It is the responsibility of the releaser to verify that the latest QVM release does not break the test suites of these downstream dependencies. All of these repositories pull the latest released version of the QVM as part of their CI pipelines.

Feature Flags

The QVM library and application can be built with support for optional features specified by the *features* flag in lisp.

Available Flags

| Feature Flag | Description | |-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| | qvm-intrinsics | Enable assembly intrinsics in the build, enabling optimized functions based on processor support. Currently supports AVX2 matrix multiplication. |

Building QVM with Feature Flags

To build with specific flags enabled, set the QVM_FEATURES variable while building:

$ make QVM_FEATURES='FEATURES' qvm

Note: Cache needs to be cleaned when adding new feature flags to ensure libraries compile with correct flags.


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

Dependencies
Parent

qvm (system)

Location

grovel-shared-memory.lisp


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

3.1.5 qvm/config.lisp

Dependencies
Parent

qvm (system)

Location

config.lisp

Exported Definitions
Internal Definitions

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

3.1.6 qvm/impl/allegro.lisp

If Feature

allegro

Dependency

config.lisp (file)

Parent

qvm (system)

Location

impl/allegro.lisp


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

3.1.7 qvm/impl/clozure.lisp

If Feature

clozure

Dependencies
Parent

qvm (system)

Location

impl/clozure.lisp


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

3.1.8 qvm/impl/sbcl.lisp

If Feature

sbcl

Dependencies
Parent

qvm (system)

Location

impl/sbcl.lisp

Internal Definitions

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

3.1.9 qvm/impl/sbcl-intrinsics.lisp

If Feature

(and sbcl qvm-intrinsics)

Dependencies
Parent

qvm (system)

Location

impl/sbcl-intrinsics.lisp


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

3.1.10 qvm/impl/sbcl-avx-vops.lisp

If Feature

(and sbcl qvm-intrinsics avx2)

Dependencies
Parent

qvm (system)

Location

impl/sbcl-avx-vops.lisp


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

3.1.11 qvm/impl/sbcl-x86-vops.lisp

If Feature

(and sbcl qvm-intrinsics)

Dependencies
Parent

qvm (system)

Location

impl/sbcl-x86-vops.lisp


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

3.1.12 qvm/impl/linear-algebra-intrinsics.lisp

If Feature

qvm-intrinsics

Dependencies
Parent

qvm (system)

Location

impl/linear-algebra-intrinsics.lisp


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

3.1.13 qvm/impl/prefetch-intrinsics.lisp

If Feature

qvm-intrinsics

Dependencies
Parent

qvm (system)

Location

impl/prefetch-intrinsics.lisp


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

3.1.14 qvm/impl/lispworks.lisp

If Feature

lispworks

Dependencies
Parent

qvm (system)

Location

impl/lispworks.lisp


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

3.1.15 qvm/utilities.lisp

Dependencies
Parent

qvm (system)

Location

utilities.lisp

Exported Definitions
Internal Definitions

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

3.1.16 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.17 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.18 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.19 qvm/linear-algebra.lisp

Dependencies
Parent

qvm (system)

Location

linear-algebra.lisp

Exported Definitions
Internal Definitions

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

3.1.20 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.21 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.22 qvm/classical-memory-mixin.lisp

Dependency

classical-memory.lisp (file)

Parent

qvm (system)

Location

classical-memory-mixin.lisp

Exported Definitions
Internal Definitions

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

3.1.23 qvm/serial-kernels.lisp

Dependency

classical-memory-mixin.lisp (file)

Parent

qvm (system)

Location

serial-kernels.lisp

Internal Definitions

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

3.1.24 qvm/wavefunction.lisp

Dependency

serial-kernels.lisp (file)

Parent

qvm (system)

Location

wavefunction.lisp

Exported Definitions
Internal Definitions

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

3.1.25 qvm/subsystem.lisp

Dependency

wavefunction.lisp (file)

Parent

qvm (system)

Location

subsystem.lisp

Internal Definitions

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

3.1.26 qvm/state-representation.lisp

Dependency

subsystem.lisp (file)

Parent

qvm (system)

Location

state-representation.lisp

Exported Definitions
Internal Definitions

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

3.1.27 qvm/qvm.lisp

Dependency

state-representation.lisp (file)

Parent

qvm (system)

Location

qvm.lisp

Exported Definitions
Internal Definitions

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

3.1.28 qvm/mixed-state-qvm.lisp

Dependency

qvm.lisp (file)

Parent

qvm (system)

Location

mixed-state-qvm.lisp

Internal Definitions

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

3.1.29 qvm/compile-gate.lisp

Dependency

mixed-state-qvm.lisp (file)

Parent

qvm (system)

Location

compile-gate.lisp

Exported Definitions
Internal Definitions

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

3.1.30 qvm/apply-gate.lisp

Dependency

compile-gate.lisp (file)

Parent

qvm (system)

Location

apply-gate.lisp

Exported Definitions
Internal Definitions

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

3.1.31 qvm/measurement.lisp

Dependency

apply-gate.lisp (file)

Parent

qvm (system)

Location

measurement.lisp

Exported Definitions
Internal Definitions

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

3.1.32 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.33 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.34 qvm/stabilizer-qvm.lisp

Dependency

transition-classical-instructions.lisp (file)

Parent

qvm (system)

Location

stabilizer-qvm.lisp

Exported Definitions
Internal Definitions

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

3.1.35 qvm/execution.lisp

Dependency

stabilizer-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.36 qvm/path-simulate.lisp

Dependency

execution.lisp (file)

Parent

qvm (system)

Location

path-simulate.lisp

Exported Definitions
Internal Definitions

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

3.1.37 qvm/misc.lisp

Dependency

path-simulate.lisp (file)

Parent

qvm (system)

Location

misc.lisp

Exported Definitions

program-matrix (function)


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

3.1.38 qvm/noise-models.lisp

Dependency

misc.lisp (file)

Parent

qvm (system)

Location

noise-models.lisp

Exported Definitions
Internal Definitions

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

3.1.39 qvm/channel-qvm.lisp

Dependency

noise-models.lisp (file)

Parent

qvm (system)

Location

channel-qvm.lisp

Exported Definitions
Internal Definitions

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

3.1.40 qvm/basic-noise-qvm.lisp

Dependency

channel-qvm.lisp (file)

Parent

qvm (system)

Location

basic-noise-qvm.lisp

Exported Definitions
Internal Definitions

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

3.1.41 qvm/density-qvm.lisp

Dependency

basic-noise-qvm.lisp (file)

Parent

qvm (system)

Location

density-qvm.lisp

Exported Definitions
Internal Definitions

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

3.1.42 qvm/noisy-qvm.lisp

Dependency

density-qvm.lisp (file)

Parent

qvm (system)

Location

noisy-qvm.lisp

Exported Definitions
Internal Definitions

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

3.1.43 qvm/depolarizing-noise.lisp

Dependency

noisy-qvm.lisp (file)

Parent

qvm (system)

Location

depolarizing-noise.lisp

Exported Definitions
Internal Definitions

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.

See also *QUBIT-LIMIT-FOR-USING-SERIAL-KERNELS*.

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: defun-inlinable NAME LAMBDA-LIST &body BODY

Define an INLINE-able function.

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: 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: 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: add-noise-models NM1 NM2

Combines two noise models NM1 and NM2 by concatenating their rules. This way, either rule can be matched by an instruction.

Package

qvm

Source

noise-models.lisp (file)

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: boolean-bit BOOLEAN

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

Package

qvm

Source

utilities.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: damping-kraus-map T1 ELAPSED-TIME

Given a value for T1 and a ELAPSED-TIME, generates the kraus operators corresponding to the amplitude damping noise.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: dephasing-kraus-map T-PHI ELAPSED-TIME

Given a value for T-PHI (dephasing time) and a ELAPSED-TIME, calculates the kraus operators corresponding to the dephasing noise.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: depolarizing-kraus-map PROB

Given a probability of depolarization PROB, calculate the kraus operation elements for the depolarizing channel.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: flonum X

Coerce X into a FLONUM.

Package

qvm

Source

floats.lisp (file)

Function: kraus-kron K1S K2S

Calculate the tensor product of two kraus maps K1S and K2S by tensoring their elems. If one of the kraus maps is NIL, tensor the other with the identity matrix.

Package

qvm

Source

basic-noise-qvm.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

classical-memory-mixin.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-classical-memory SIZE

Allocate SIZE octets of memory.

Package

qvm

Source

classical-memory.lisp (file)

Function: make-density-matrix-state NUM-QUBITS &key ALLOCATION
Package

qvm

Source

state-representation.lisp (file)

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

qvm

Source

density-qvm.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-noise-model NOISE-RULES

Returns a noise model with NOISE-RULES.

Package

qvm

Source

noise-models.lisp (file)

Function: make-noise-predicate PREDICATE-FUNCTION PRIORITY NOISE-POSITION &optional NAME

Creates a NOISE-PREDICATE with the given PREDICATE-FUNCTION (function designator), PRIORITY, and NOISE-POSITION.

Package

qvm

Source

noise-models.lisp (file)

Function: make-noise-rule PREDICATE &rest KRAUS-MAPS

Returns a noise rule with the specified PREDICATE and list KRAUS-MAPS.

Package

qvm

Source

noise-models.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-pure-state NUM-QUBITS &key ALLOCATION

ALLOCATION is an optional argument with the following behavior.
- If NULL (default), then a standard wavefunction in the Lisp heap will be allocated.
- If STRING, then the wavefunction will be allocated as a shared memory object, accessible by that name.
- Otherwise, it’s assumed to be an object that is compatible with the ALLOCATION-LENGTH and ALLOCATE-VECTOR methods. - will probs have to redo this in multiple places, have a helper function do the allocation stuff.

Package

qvm

Source

state-representation.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 NULL (default), then a standard wavefunction in the Lisp heap will be allocated.
- If STRING, then the wavefunction will be allocated as a shared memory object, accessible by that name.
- Otherwise, it’s assumed to be an object that is compatible with the ALLOCATION-LENGTH and ALLOCATE-VECTOR methods

Package

qvm

Source

qvm.lisp (file)

Function: map-amplitudes QVM F

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

Package

qvm

Source

qvm.lisp (file)

Function: match-all-gates ()

The returned function is true if the instruction contains a gate (not a MEASURE).

Package

qvm

Source

noise-models.lisp (file)

Function: match-all-nq-gates N

The returned function is true if the instruction operates on N qubits.

Package

qvm

Source

noise-models.lisp (file)

Function: match-any-gates &rest GATES

The returned function is true if there is any intersection between the instruction’s gate and GATES.

Package

qvm

Source

noise-models.lisp (file)

Function: match-any-n-qubits N QUBIT-LIST

The returned function is true if there is any intersection between the instruction’s qubits and the QUBIT-LIST for an N-qubit operation. We need to specify N in the rule because a 2 qubit gate CNOT 0 1 could match a rule with qubits that has operation elements for a 1q gate. We want to prevent this, so we require the user to specify the number of qubits expected in the gate.

Package

qvm

Source

noise-models.lisp (file)

Function: match-instr-idxs PARSED-PROG &rest IDXS

The returned function is true if the index of the INSTR in the program PARSED-PROG matches IDXS.

Package

qvm

Source

noise-models.lisp (file)

Function: match-measure ()

The returned function is true if the instruction is a MEASURE.

Package

qvm

Source

noise-models.lisp (file)

Function: match-measure-at-any &rest QUBITS

The returned function is true if the instruciton is a MEASURE on any of the specified QUBITS.

Package

qvm

Source

noise-models.lisp (file)

Function: match-measure-at-strict QUBIT

The returned function is true if the instruciton is a MEASURE on the specified QUBIT.

Package

qvm

Source

noise-models.lisp (file)

Function: match-strict-gate GATE

The returned function is true if the instruction is a GATE-APPLICATION that is exactly equal to GATE.

Package

qvm

Source

noise-models.lisp (file)

Function: match-strict-qubits &rest QUBITS

The returned function is true if QUBITS exactly equals the gate application’s qubits in the same order (CNOT 0 1 does NOT match CNOT 1 0).

Package

qvm

Source

noise-models.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

classical-memory-mixin.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

classical-memory-mixin.lisp (file)

Reader

memory-ref (function)

Function: memory-size INSTANCE
Package

qvm

Source

classical-memory.lisp (file)

Function: multiply-noise-models NM1 NM2

Combines two noise models NM1 and NM2 in a way such that both set of rules, or one and not the other could be matched by an instruction.

Package

qvm

Source

noise-models.lisp (file)

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: predicate-and NOISE-PREDICATE1 NOISE-PREDICATE2

Logical AND of 2 noise predicates. The NOISE-POSITION is taken from NOISE-PREDICATE1 and the priority is taken to be the max PRIORITY between the two predicates.

Package

qvm

Source

noise-models.lisp (file)

Function: predicate-or NOISE-PREDICATE1 NOISE-PREDICATE2

Logical OR of 2 noise predicates. The NOISE-POSITION is taken from NOISE-PREDICATE1 and the priority is taken to be the max PRIORITY between the two predicates.

Package

qvm

Source

noise-models.lisp (file)

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

Create a worker pool if none exists or if NUM-WORKERS has changed.

If NUM-WORKERS is not provided, the number of workers will be set to the number of logical cores of your machine. This function does nothing if NUM-WORKERS workers have already been created.
If NUM-WORKERS is provided it should be less than or equal to the number of logical cores of your machine.

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

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 QVM QUBIT

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

Package

qvm

Source

qvm.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: tphi T1 T2

Calculate t_phi from T1 and T2. T-PHI = (2*T1*T2) / (2*T1 + T2). T2 must be strictly less than 2 * T1.

Package

qvm

Source

basic-noise-qvm.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-excited-state-probability ()

Compute the probability that qubit QUBIT is in the excited state.

Package

qvm

Source

wavefunction.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: wavefunction-ground-state-probability ()

Compute the probability that qubit QUBIT is in the ground state.

Package

qvm

Source

wavefunction.lisp (file)

Function: wf ()

Construct a wavefunction from the elements (ELT . ELTS).

Package

qvm

Source

wavefunction.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-to-state GATE STATE QUBITS &rest PARAMETERS

Apply a gate GATE to the state STATE on the sub-Hilbert space defined by the NAT-TUPLE of qubit indexes QUBITS. PARAMETERS is a list of numeric parameters passed to a dynamic gate.

Package

qvm

Source

apply-gate.lisp (file)

Methods
Method: apply-gate-to-state (GATE simple-gate) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE parameterized-gate) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE permutation-gate) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE controlled-gate) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE forked-gate) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE dagger-gate) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE compiled-matrix-gate-application) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE compiled-inlined-matrix-gate-application) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE compiled-permutation-gate-application) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE superoperator) (STATE pure-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE superoperator) (STATE density-matrix-state) QUBITS &rest PARAMETERS
Method: apply-gate-to-state (GATE gate) (STATE density-matrix-state) QUBITS &rest PARAMETERS
Generic Function: classical-memory-subsystem OBJECT
Package

qvm

Methods
Method: classical-memory-subsystem (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)

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

Source

classical-memory-mixin.lisp (file)

Generic Function: force-measurement MEASURED-VALUE QUBIT STATE EXCITED-PROBABILITY

Manipulate the STATE as to force the QUBIT in STATE to collapse to the MEASURED-VALUE. EXCTIED-PROBABILITY is the probability that the specified QUBIT measures to |1>, regardless of the MEASURED-VALUE it is being forced to.

Package

qvm

Source

measurement.lisp (file)

Methods
Method: force-measurement MEASURED-VALUE QUBIT (STATE density-matrix-state) EXCITED-PROBABILITY

Force the density-matrix-state STATE to have the qubit QUBIT collapse/measure to MEASURED-VALUE. Modify the density matrix appropriately.EXCITED-PROBABILITY should be the probability that QUBIT measured to |1>, regardless of what it’s being forced as.

Method: force-measurement MEASURED-VALUE QUBIT (STATE pure-state) EXCITED-PROBABILITY

Force the quantum system of the PURE-STATE STATE to have the qubit QUBIT collapse/measure to MEASURED-VALUE. Modify the amplitudes of all other qubits accordingly. EXCITED-PROBABILITY should be the probability that QUBIT measured to |1>, regardless of what it’s being forced as.

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 stabilizer-qvm) Q
Source

stabilizer-qvm.lisp (file)

Method: measure (QVM base-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 noisy-qvm)
Source

noisy-qvm.lisp (file)

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

density-qvm.lisp (file)

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

measurement.lisp (file)

Method: measure-all QAM
Generic Function: name OBJECT
Package

qvm

Methods
Method: name (NOISE-PREDICATE noise-predicate)

Name or descriptor for noise.

Source

noise-models.lisp (file)

Generic Function: noise-model OBJECT
Generic Function: (setf noise-model) NEW-VALUE OBJECT
Package

qvm

Methods
Method: noise-model (CHANNEL-QVM channel-qvm)

automatically generated reader method

Source

channel-qvm.lisp (file)

Method: (setf noise-model) NEW-VALUE (CHANNEL-QVM channel-qvm)

automatically generated writer method

Source

channel-qvm.lisp (file)

Generic Function: noise-position OBJECT
Package

qvm

Methods
Method: noise-position (NOISE-PREDICATE noise-predicate)

Should application of a channel happen before or after the instruction?

Source

noise-models.lisp (file)

Generic Function: noise-predicate OBJECT
Generic Function: (setf noise-predicate) NEW-VALUE OBJECT
Package

qvm

Methods
Method: noise-predicate (NOISE-RULE noise-rule)
Method: (setf noise-predicate) NEW-VALUE (NOISE-RULE noise-rule)

A function that is true when an instruction is matched, false otherwise.

Source

noise-models.lisp (file)

Generic Function: noise-rules OBJECT
Generic Function: (setf noise-rules) NEW-VALUE OBJECT
Package

qvm

Methods
Method: noise-rules (NOISE-MODEL noise-model)
Method: (setf noise-rules) NEW-VALUE (NOISE-MODEL noise-model)

A list of NOISE-RULEs.

Source

noise-models.lisp (file)

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 (QVM stabilizer-qvm)
Source

stabilizer-qvm.lisp (file)

Method: number-of-qubits (BASE-QVM base-qvm)

Number of qubits being simulated by the QVM.

Source

qvm.lisp (file)

Generic Function: predicate-function OBJECT
Package

qvm

Methods
Method: predicate-function (NOISE-PREDICATE noise-predicate)

Does the instruction trigger the application of a channel?

Source

noise-models.lisp (file)

Generic Function: predicate-not NOISE-PREDICATE
Package

qvm

Methods
Method: predicate-not NOISE-PREDICATE

Logical NOT of a NOISE-PREDICATE. The PRIORITY of the predicate is ’inverted’, by taking the difference between itself and +MAXPRIORITY+.

Source

noise-models.lisp (file)

Generic Function: priority OBJECT
Package

qvm

Methods
Method: priority (NOISE-PREDICATE noise-predicate)

For ordering when checking for an instruction’s matching predicates. The convention we use is that more specific predicates get higher priorities.

Source

noise-models.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 basic-noise-qvm) before
Source

basic-noise-qvm.lisp (file)

Method: run (QVM base-qvm) after
Source

execution.lisp (file)

Method: run (QVM classical-memory-mixin)
Source

execution.lisp (file)

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

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

density-qvm.lisp (file)

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

noisy-qvm.lisp (file)

Method: set-noisy-gate (QVM density-qvm) GATE-NAME QUBITS KRAUS-OPS
Generic Function: set-to-zero-state STATE

Set the initial state to the pure zero state.

Package

qvm

Source

state-representation.lisp (file)

Methods
Method: set-to-zero-state (STATE density-matrix-state)
Method: set-to-zero-state (STATE pure-state)
Generic Function: state-elements STATE

Extract the state data from the STATE. This is AMPLITUDES for a PURE-STATE, or ELEMENTS-VECTOR for a DENSITY-MATRIX-STATE.

Package

qvm

Source

state-representation.lisp (file)

Writer

(setf state-elements) (generic function)

Methods
Method: state-elements (STATE density-matrix-state)
Method: state-elements (STATE pure-state)
Generic Function: (setf state-elements) NEW-VALUE STATE
Package

qvm

Reader

state-elements (generic function)

Methods
Method: (setf state-elements) NEW-VALUE (STATE density-matrix-state)
Source

state-representation.lisp (file)

Method: (setf state-elements) NEW-VALUE (STATE pure-state)
Source

state-representation.lisp (file)

Generic Function: transition QVM INSTR

Execute the instruction INSTR on the QVM.

Return just the resulting (possibly modified) QVM after executing INSTR. (Historical note: used to also return pc)

Package

qvm

Source

transition.lisp (file)

Methods
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 noisy-qvm) (INSTR measurement) around
Source

noisy-qvm.lisp (file)

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

noisy-qvm.lisp (file)

Method: transition (QVM density-qvm) (INSTR measurement) around
Source

density-qvm.lisp (file)

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

density-qvm.lisp (file)

Method: transition (QVM basic-noise-qvm) (INSTR measurement) around
Source

basic-noise-qvm.lisp (file)

Method: transition (QVM basic-noise-qvm) (INSTR gate-application) after
Source

basic-noise-qvm.lisp (file)

Method: transition (QVM channel-qvm) (INSTR measurement) around
Source

channel-qvm.lisp (file)

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

channel-qvm.lisp (file)

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

channel-qvm.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR clifford-application)
Source

stabilizer-qvm.lisp (file)

Method: transition (QVM stabilizer-qvm) (INSTR clifford-application)
Source

stabilizer-qvm.lisp (file)

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

stabilizer-qvm.lisp (file)

Method: transition (QVM stabilizer-qvm) (INSTR measure-discard)
Source

stabilizer-qvm.lisp (file)

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

stabilizer-qvm.lisp (file)

Method: transition (QVM stabilizer-qvm) (INSTR reset-qubit)
Source

stabilizer-qvm.lisp (file)

Method: transition (QVM stabilizer-qvm) (INSTR reset)
Source

stabilizer-qvm.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR wait)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-equal-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-greater-than-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-equal-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-less-than-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-equality-bit/bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-store)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-load)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-division-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-division-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-division-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-division-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-multiplication-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-multiplication-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-multiplication-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-multiplication-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-subtraction-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-subtraction-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-subtraction-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-subtraction-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-addition-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-addition-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-addition-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-addition-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-convert-bit/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-convert-bit/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-convert-real/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-convert-real/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-convert-integer/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-convert-integer/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exchange)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-real/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-real/real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-move-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exclusive-or-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exclusive-or-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exclusive-or-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exclusive-or-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exclusive-or-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-exclusive-or-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-inclusive-or-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-inclusive-or-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-inclusive-or-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-inclusive-or-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-inclusive-or-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-inclusive-or-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-and-octet/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-and-integer/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-and-bit/immediate)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-and-octet/octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-and-integer/integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-and-bit/bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-not-integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-not-octet)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-not-bit)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-negate-integer)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM classical-memory-mixin) (INSTR classical-negate-real)
Source

transition-classical-instructions.lisp (file)

Method: transition (QVM pure-state-qvm) (INSTR compiled-measurement)
Method: transition (QVM pure-state-qvm) (INSTR compiled-gate-application)
Method: transition (QVM base-qvm) (INSTR gate-application)
Method: transition (QVM base-qvm) (INSTR measure-all)
Method: transition (QVM base-qvm) (INSTR measure-discard)
Method: transition (QVM base-qvm) (INSTR measure)
Method: transition (QVM classical-memory-mixin) (INSTR jump-unless)
Method: transition (QVM classical-memory-mixin) (INSTR jump-when)
Method: transition (QVM classical-memory-mixin) (INSTR unconditional-jump)
Method: transition (QVM pure-state-qvm) (INSTR reset-qubit)
Method: transition (QVM base-qvm) (INSTR reset)
Method: transition (QVM classical-memory-mixin) (INSTR halt)
Method: transition (QVM classical-memory-mixin) (INSTR pragma)
Method: transition (QVM classical-memory-mixin) (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

alexandria: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: basic-noise-qvm ()

BASIC-NOISE-QVM is a QVM that supports a noise model defined by T1, T2, T-phi, depolarization probability, and readout fidelities on each qubit. At each instruction, damping, dephasing, and depolarizing noise is applied for the qubits involved in the instruction. If READOUT-POVMS are defined for a qubit, the readout noise is applied after a MEASURE instruction on that qubit.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Direct superclasses

base-qvm (class)

Direct methods
Direct slots
Slot: t1-vals

Hash table of qubit idx to T1 value for each qubit to simulate

Initargs

:t1-vals

Readers

t1-vals (generic function)

Writers

(setf t1-vals) (generic function)

Slot: t2-vals

Hash table of qubit idx to T2 value for each qubit to simulate

Initargs

:t2-vals

Readers

t2-vals (generic function)

Writers

(setf t2-vals) (generic function)

Slot: tphi-vals

Hash table of qubit idx to TPHI value for each qubit to simulate.

Initargs

:tphi-vals

Readers

tphi-vals (generic function)

Writers

(setf tphi-vals) (generic function)

Slot: depolarization-ops

A hash table of qubit to depolarization operators, representing gate application noise. Gate over-rotations and under-rotations average out to the depolarizing channel.

Initargs

:depolarization-ops

Readers

depolarization-ops (generic function)

Writers

(setf depolarization-ops) (generic function)

Slot: readout-povms

A hash-table of qubit idx to a list of povms, representing the readout assignment probabilities (p(0|0) p(0|1) p(1|0) p(1|1)).

Initargs

:readout-povms

Readers

readout-povms (generic function)

Writers

(setf readout-povms) (generic function)

Slot: avg-gate-time

To calculate the kraus operators for T1, T2, etc. noise, a gate time value is needed. Ideally, this gate time should be the duration of the gate preceding the application of the kraus noise. As an approximation, this value should represent the average gate time of the gates that will be run.

Initargs

:avg-gate-time

Readers

avg-gate-time (generic function)

Slot: elapsed-time

A value to keep track of the elpased time of the program. The elapsed time is used for calculating the kraus operators of some noise value at a given point in the program.

Initargs

:elapsed-time

Readers

elapsed-time (generic function)

Writers

(setf elapsed-time) (generic function)

Direct Default Initargs
InitargValue
:t1-vals(make-hash-table :test (quote eql))
:tphi-vals(make-hash-table :test (quote eql))
:t2-vals(make-hash-table :test (quote eql))
:depolarization-ops(make-hash-table :test (quote eql))
:readout-povms(make-hash-table :test (quote eql))
:avg-gate-time(error ":avg-gate-time is a required initarg to basic-noise-qvm")
:elapsed-time0.0d0
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: channel-qvm ()

The CHANNEL-QVM is a QVM that supports a fully explicit NOISE-MODEL. The NOISE-MODEL is an explicit definition of where and how different channels should be applied to a program running in the CHANNEL-QVM.

Package

qvm

Source

channel-qvm.lisp (file)

Direct superclasses

base-qvm (class)

Direct methods
Direct slots
Slot: noise-model
Initargs

:noise-model

Readers

noise-model (generic function)

Writers

(setf noise-model) (generic function)

Direct Default Initargs
InitargValue
:noise-model(qvm:make-noise-model nil)
Class: classical-memory-mixin ()

A mixin for quantum abstract machines making use of a classical memory subsystem and a program vector.

Package

qvm

Source

classical-memory-mixin.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
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: wait-function

A unary function taking a QVM and implementing Quil’s WAIT logic. (The default does nothing and just warns.)

Initargs

:wait-function

Readers

wait-function (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))
:wait-function(quote qvm::warning-wait-function)
:gate-definitions(qvm::copy-hash-table cl-quil::**default-gate-definitions**)
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-matrix-state ()

A DENSITY-MATRIX-STATE is a general quantum state of N qubits described by a density matrix ρ, representing a statistical mixture of PURE-STATEs. The elements of ρ are represented by the length 2^(2*N) vector ELEMENTS-VECTOR which is in row-major order. MATRIX-VIEW is the 2D ’traditional’ matrix representation of ρ.

Package

qvm

Source

state-representation.lisp (file)

Direct superclasses

quantum-system-state (class)

Direct methods
Direct slots
Slot: elements-vector

The contents of a density matrix ρ as a one-dimensional vector. For a state of N qubits, this vector should be of length 2^(2*N).

Initargs

:elements-vector

Readers

elements-vector (generic function)

Writers

(setf elements-vector) (generic function)

Slot: matrix-view

2D array displaced to ELEMENTS-VECTOR

Readers

matrix-view (generic function)

Slot: temporary-state

A placeholder for computations on the elements-vector of a DENSITY-MATRIX-STATE.

Initargs

:temporary-state

Readers

temporary-state (generic function)

Writers

(setf temporary-state) (generic function)

Direct Default Initargs
InitargValue
:elements-vectornil
:temporary-statenil
Class: density-qvm ()

A density matrix simulator.

Package

qvm

Source

density-qvm.lisp (file)

Direct superclasses

base-qvm (class)

Direct methods
Direct slots
Slot: noisy-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
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: noise-model ()

A NOISE-MODEL is a collection of NOISE-RULES, describing what type of noise should be applied to a program that goes through a QVM, and where that noise should be applied.

Package

qvm

Source

noise-models.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: noise-rules

A list of NOISE-RULEs.

Initargs

:noise-rules

Readers

noise-rules (generic function)

Writers

(setf noise-rules) (generic function)

Slot: readout-povms

A hash table of qubit to readout noise assignment probabilities, given as a 4-element list ((p(0|0) p(0|1) p(1|0) p(1|1)).

Initargs

:readout-povms

Readers

readout-povms (generic function)

Writers

(setf readout-povms) (generic function)

Direct Default Initargs
InitargValue
:noise-rulesnil
:readout-povms(make-hash-table :test (quote eql))
Class: noise-predicate ()

A NOISE-PREDICATE describes a collection of program instructions. When used in a NOISE-RULE, the NOISE-PREDICATE describes which instructions should be matched by the noise described in the OPERATION-ELEMENTS. Optionally, the NOISE-PREDICATE can be given a NAME. If none is provided, use the default ’NOISE-NAME’.

Package

qvm

Source

noise-models.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: predicate-function

Does the instruction trigger the application of a channel?

Initargs

:predicate-function

Readers

predicate-function (generic function)

Slot: priority

For ordering when checking for an instruction’s matching predicates. The convention we use is that more specific predicates get higher priorities.

Initargs

:priority

Readers

priority (generic function)

Slot: noise-position

Should application of a channel happen before or after the instruction?

Type

qvm:noise-position

Initargs

:noise-position

Readers

noise-position (generic function)

Slot: name

Name or descriptor for noise.

Initargs

:name

Readers

name (generic function)

Direct Default Initargs
InitargValue
:predicate-functionnil
:priority10
:noise-position(quote :after)
:nameqvm::+default-noise-predicate-name+
Class: noise-rule ()

A NOISE-RULE consists of noise data (OPERATION-ELEMENTS) and a specification of where the noise data should be applied to the program (NOISE-PREDICATE).

Package

qvm

Source

noise-models.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: noise-predicate

A function that is true when an instruction is matched, false otherwise.

Initargs

:noise-predicate

Readers

noise-predicate (generic function)

Writers

(setf noise-predicate) (generic function)

Slot: operation-elements

A list of kraus maps to apply when the rule is matched. Each kraus map is a list of kraus operators.

Initargs

:operation-elements

Readers

operation-elements (generic function)

Class: noisy-qvm ()
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 :test (quote eql))

Readers

readout-povms (generic function)

Writers

(setf readout-povms) (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 ()

A PURE-STATE contains the quantum mechanical state for a system that can be described by a vector |ψ> of N qubits with unit length in a Hilbert space. The elements of this length 2^N vector is represented by AMPLITUDES.

Package

qvm

Source

state-representation.lisp (file)

Direct superclasses

quantum-system-state (class)

Direct methods
Direct slots
Slot: amplitudes

The wavefunction of a pure state.

Initargs

:amplitudes

Readers

amplitudes (generic function)

Writers

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

Initargs

:trial-amplitudes

Readers

%trial-amplitudes (generic function)

Writers

(setf %trial-amplitudes) (generic function)

Slot: original-amplitudes

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

Readers

original-amplitudes (generic function)

Direct Default Initargs
InitargValue
:amplitudesnil
:trial-amplitudesnil
:original-amplitudesnil
Class: pure-state-qvm ()

An pure-state implementation of the Quantum Abstract Machine.

Package

qvm

Source

qvm.lisp (file)

Direct superclasses

base-qvm (class)

Direct subclasses
Direct methods
Direct slots
Slot: state

The unpermuted wavefunction in standard order.

Type

(or null qvm:pure-state)

Initargs

:state

Readers

state (generic function)

Writers

%set-state (generic function)


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

5.1.9 Types

Type: amplitude-address ()

An address into an array of amplitudes.

Package

qvm

Source

wavefunction.lisp (file)

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: noise-position ()

Describes the position of a noise rule relative to an instruction. Should the noise be applied :BEFORE or :AFTER the instruction is executed?

Package

qvm

Source

noise-models.lisp (file)

Type: parallelization-limit ()

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

Package

qvm

Source

config.lisp (file)

Type: probability ()
Package

qvm

Source

basic-noise-qvm.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.8-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.17.1/src/grovel-shared-memory.processed-grovel-file

Constant: $map-shared
Package

qvm

Source

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

Constant: $o-creat
Package

qvm

Source

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

Constant: $o-excl
Package

qvm

Source

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

Constant: $o-rdwr
Package

qvm

Source

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

Constant: $prot-read
Package

qvm

Source

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

Constant: $prot-write
Package

qvm

Source

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

Constant: $sc-nprocessors-onln
Package

qvm

Source

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

Constant: $sc-page-size
Package

qvm

Source

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

Constant: +default-noise-predicate-name+
Package

qvm

Source

noise-models.lisp (file)

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

qvm

Source

utilities.lisp (file)

Constant: +maxpriority+
Package

qvm

Source

noise-models.lisp (file)

Constant: +minpriority+
Package

qvm

Source

noise-models.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.8-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.17.1/src/grovel-shared-memory.processed-grovel-file

Constant: size-of-off_t
Package

qvm

Source

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

Constant: size-of-size_t
Package

qvm

Source

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


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

5.2.2 Special variables

Special Variable: *available-kernels*

An association list of kernels. The keys are integers representing number of qubits, and values are symbols designating function names corresponding to an operator whose lambda list is that described in DEFINE-SERIAL-KERNEL.

Package

qvm

Source

serial-kernels.lisp (file)

Special Variable: *compile-measure-chains*

Compile chains of measures into an efficient sampling.

Package

qvm

Source

config.lisp (file)

Special Variable: *fuse-gates-during-compilation*

Should gates be fused during compilation?

Package

qvm

Source

config.lisp (file)

Special Variable: *inline-static-gates-during-compilation*

Inline the actual gate matrices into the compiled instructions.

Package

qvm

Source

config.lisp (file)

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)

Special Variable: *qubit-limit-for-using-serial-kernels*

The maximum number of qubits allowed in order to use a specified serial kernel.

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.8-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.17.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: define-serial-kernel NAME NUM-QUBITS

Define a function named NAME which has the lambda list

(OP WF Q0 ... Qn-1)

which applies the gate OP (represented as a QUANTUM-OPERATOR) to the wavefunction WF (represented as a QUANTUM-STATE) with qubits Q0 ... Qn-1, where N = NUM-QUBITS.

This function mutates WF and is unsafe.

Package

qvm

Source

serial-kernels.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: probabilistically P &body BODY

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

Package

qvm

Source

utilities.lisp (file)

Macro: shm-open NAME OFLAG &rest VARARGS0
Package

qvm

Source

shm.lisp (file)

Macro: sum-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: 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)

Macro: with-parallel-subdivisions (START END COUNT &key NUM-DIVISIONS FORCE-PARALLEL) &body BODY
Package

qvm

Source

utilities.lisp (file)


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

5.2.5 Functions

Function: %check-depol-entry QUBIT KRAUS-MAP

Check that a key value pair in the DEPOLARIZATION-OPS slot is valid. The QUBIT must be a non-negative integer, and the KRAUS-MAP must be a valid kraus map.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: %check-noise-entry QUBIT NOISE-VAL

Check that a key value pair in T1-VALS, T2-VALS, or TPHI-VALS is valid. The QUBIT must be a NON-NEGATIVE INTEGER, and the NOISE-VAL must be of VALID-NOISE-VALUE type for T1-VALS, T2-VALS, and TPHI-VALS.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: %check-povm-entry QUBIT POVM

Check that a key value pair in READOUT-POVMS is valid. The QUBIT must be a NON-NEGATIVE INTEGER, and the POVM must be a correctly formatted POVM.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: %close FD
Package

qvm

Source

shm.lisp (file)

Function: %collapse-integer-by-mask INTEGER MASK

Let INTEGER and MASK be integers of the same bit-length. Remove the bits of INTEGER that correspond to the zeros of MASK.

Package

qvm

Source

subsystem.lisp (file)

Function: %corrupt-qvm-memory-with-povm QVM INSTR POVM-MAP

Apply POVM-MAP to the measured result of the INSTR application.

Package

qvm

Source

channel-qvm.lisp (file)

Function: %evolve-density-matrix-with-superoperator SOP STATE QUBITS GHOST-QUBITS &key PARAMS

Apply a superoperator SOP to a vectorized density matrix given in the DENSITY-MATRIX-STATE STATE, where QUBITS and GHOST-QUBITS are tuples of qubit indices which the superoperator acts on (from the left and right respectively). The computation may require the STATE’s TEMPORARY-STATE, a vector of the same length as the AMPLITUDES of the STATE. Returns the pair of updated STATE and (perhaps freshly allocated) TEMPORARY-STORAGE.

Package

qvm

Source

apply-gate.lisp (file)

Function: %evolve-pure-state-stochastically KRAUS-MAP STATE QUBITS

Uniformly at random select one of the kraus operators in KRAUS-MAP to apply for the PURE-STATE STATE. Randomly select one of the Kraus operators by inverse transform sampling (cf [1]): We divide the unit interval [0,1] into n bins where the j-th bin size equals the probability p_j with which the j-th Kraus operator k_j should be applied. We know that the Kraus operators are normalized such that p_j = <psi|k_j^H k_j |psi> where x^H denotes hermitian conjugation of x and can therefore perform this sampling lazily: First generate a uniformly sampled random number r in [0,1]. Next, find j such that

sum_{k=1}^{j-1} p_k < r <= sum_{k=1}^{j} p_k

This is possible by evaluating only all p_k for k<=j. Then pick this j as the choice of Kraus operator to apply.
[1]: https://en.wikipedia.org/wiki/Inverse_transform_sampling

Package

qvm

Source

apply-gate.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.8-linux-x64/home/quickref/quicklisp/dists/quicklisp/software/qvm-v1.17.1/src/grovel-shared-memory.processed-grovel-file

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

Apply depolarizing noise to the list QUBITS of the QVM with the following probabilities:

* Probability of an X-gate PX,
* Probability of a Y-gate PY, and
* Probability of a Z-gate PZ.

It should be that PX + PY + PZ <= 1.

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: and-predicate-names NAME1 NAME2

Returns the concatenated predicate name (NAME1 & NAME2)

Package

qvm

Source

noise-models.lisp (file)

Function: apply-1q-operator ()

Apply a 1-qubit operator OP to the wavefunction WF on qubits Q0.

Note: This function is raw and unsafe. Pass bad data => get a crash.

Package

qvm

Source

serial-kernels.lisp (file)

Function: apply-2q-operator ()

Apply a 2-qubits operator OP to the wavefunction WF on qubits Q0, Q1.

Note: This function is raw and unsafe. Pass bad data => get a crash.

Package

qvm

Source

serial-kernels.lisp (file)

Function: apply-3q-operator ()

Apply a 3-qubits operator OP to the wavefunction WF on qubits Q0, Q1, Q2.

Note: This function is raw and unsafe. Pass bad data => get a crash.

Package

qvm

Source

serial-kernels.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: bit= A B
Package

qvm

Source

compile-gate.lisp (file)

Function: bring-to-zero-state ()

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

Package

qvm

Source

wavefunction.lisp (file)

Function: calculate-dephasing-map QUBIT-TPHI QUBIT-T1 QUBIT-T2 ELAPSED-TIME

Build the dephasing map. If TPHI is not null, use that to calculate the dephasing map. In the absence of a TPHI value, use T1 and T2 to calculate TPHI if those values exist. T2 is upper bounded by 2 * T1.

Package

qvm

Source

basic-noise-qvm.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-all-kraus-ops SEQ

Call CHECK-KRAUS-OPS on each element of SEQ.

Package

qvm

Source

channel-qvm.lisp (file)

Function: check-all-povms SEQ

Call CHECK-POVM on each element of SEQ.

Package

qvm

Source

channel-qvm.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

channel-qvm.lisp (file)

Function: check-povm POVM

Verify that the list POVM contains a valid single qubit diagonal POVM, given as the list (p(0|0) p(0|1) p(1|0) p(1|1)).

Package

qvm

Source

channel-qvm.lisp (file)

Function: check-superoperators SUPEROPERATORS

Convert each SUPEROPERATOR in SUPEROPERATORS to a matrix and call CHECK-ALL-KRAUS-OPS on the resulting list.

Package

qvm

Source

qvm.lisp (file)

Function: classical-memory-p OBJECT
Package

qvm

Source

classical-memory.lisp (file)

Function: compile-clifford C &key CACHE
Package

qvm

Source

stabilizer-qvm.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: convert-to-kraus-list KRAUS-OPS

Converts a list of magicl matrices KRAUS-OPS to a SUPEROPERATOR KRAUS-LIST, which is a list of SINGLE-KRAUS.

Package

qvm

Source

apply-gate.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: copy-subsystem INSTANCE
Package

qvm

Source

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

classical-memory-mixin.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-matrix-state-measurement-probabilities STATE

Computes the probability distribution of measurement outcomes (a vector) associated with the specified density matrix state in the MIXED-STATE-QVM.

For example, if (NUMBER-OF-QUBITS QVM) is 2, then this will return a vector

#(p[0,0] p[0,1] p[1,0] p[1,1])

where p[i,j] denotes the probability that a simultaneous measurement of qubits 0,1 results in the outcome i,j.

Package

qvm

Source

state-representation.lisp (file)

Function: density-qvm-measurement-probabilities QVM

Computes the probability distribution of measurement outcomes (a vector) associated with the STATE of the DENSITY-QVM.

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

classical-memory-mixin.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

classical-memory-mixin.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: eject-qubit-from-subsystem SS QUBIT

Eject the qubit QUBIT from the subsystem SS. Return two values:

1. A subsystem with the qubit factored out. (If the qubit is not a part of the system, it is assumed to be in the zero state.)

2. The state of the factored out qubit.

Package

qvm

Source

subsystem.lisp (file)

Function: enable-all-qvm-optimizations ()
Package

qvm

Source

config.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: ensure-superoperator MAT

Converts a magicl matrix MAT into a SINGLE-KRAUS SUPEROPERATOR.

Package

qvm

Source

linear-algebra.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-matching-rule RULES INSTR POSITION

Return the first rule that matches INSTR/POSITION in the list RULES.

Package

qvm

Source

channel-qvm.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 (a NAT-TUPLE).

This function will compile new ones on-demand.

Package

qvm

Source

compile-gate.lisp (file)

Function: find-or-make-projector-operator-function QUBIT

Find a projector function for the Hilbert subspace designated by QUBIT (a QUIL:QUBIT).

This function will compile new ones on-demand.

Package

qvm

Source

compile-gate.lisp (file)

Function: find-serial-kernel N

Find a serial gate application kernel for an N-qubit operator.

Package

qvm

Source

serial-kernels.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

mixed-state-qvm.lisp (file)

Function: gate-application-to-clifford GATE-APP
Package

qvm

Source

stabilizer-qvm.lisp (file)

Function: gaussian-random-complex ()

Return a complex number with Gaussian-random real and imaginary parts.

Package

qvm

Source

wavefunction.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-gate-application-code-with-matrix QUBITS MATRIX

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 either be:

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

- a QUANTUM-OPERATOR.

COLUMN should be a list of symbols all of which should (eventually) be bound to the vector being multiplied.

RESULT should be a list of SETF-able forms to which the result will be assigned.

Package

qvm

Source

compile-gate.lisp (file)

Function: generate-kraus-ops STANDARD-MATRICES PROBS

Builds a list of kraus operators from the base matrices in STANDARD-MATRICES, each scaled by a corresponding probability in PROBS.

Package

qvm

Source

basic-noise-qvm.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: generate-single-qubit-measurement-code QUBIT &key DOTIMES-ITERATOR

Generate a lambda expression which takes a wavefunction and non-deterministically measures QUBIT. The lambda will mutate the wavefunction and return the bit measured.

DOTIMES-ITERATOR controls which style of DOTIMES is used.

Package

qvm

Source

compile-gate.lisp (file)

Function: getpagesize ()
Package

qvm

Source

shm.lisp (file)

Function: gray-bit N

Let G(n) be the Nth number in Gray code order with G(0) = 0, i.e., GRAY-ENCODE. Then (G (1+ n)) == (LOGXOR (G n) (ASH 1 (GRAY-BIT n))).

Package

qvm

Source

utilities.lisp (file)

Function: gray-encode N

Compute the Nth Gray code.

Package

qvm

Source

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

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

classical-memory-mixin.lisp (file)

Function: join-subsystems SS1 SS2

Join two (disjoint) qubit subsystems SS1 and SS2 into a larger qubit subsystem.

Package

qvm

Source

subsystem.lisp (file)

Function: kraus-list %0
Package

qvm

Source

linear-algebra.lisp (file)

Function: kraus-list%0 INSTANCE
Package

qvm

Source

linear-algebra.lisp (file)

Function: kronecker-multiply A B

Compute the Kronecker product of matrices A and B.

Package

qvm

Source

linear-algebra.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

classical-memory-mixin.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

classical-memory-mixin.lisp (file)

Function: make-clifford-application CLIFFORD &rest QUBITS
Package

qvm

Source

stabilizer-qvm.lisp (file)

Function: make-lisp-cflonum-vector LENGTH
Package

qvm

Source

allocator.lisp (file)

Function: make-mixed-state-qvm NUM-QUBITS &key ALLOCATION &allow-other-keys

Build a MIXED-STATE-QVM with a DENSITY-MATRIX-STATE representing NUM-QUBITS qubits.

Package

qvm

Source

mixed-state-qvm.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-stabilizer-qvm NUM-QUBITS &key CLASSICAL-MEMORY-MODEL
Package

qvm

Source

stabilizer-qvm.lisp (file)

Function: make-subsystem &key (STATE STATE) (QUBITS QUBITS)
Package

qvm

Source

subsystem.lisp (file)

Function: make-subsystem-on-qubits &rest QUBITS

Make a subsystem (in the zero-state) for the qubits QUBITS.

Note: Duplicate qubits are ignored.

Package

qvm

Source

subsystem.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 N 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: map-subdivisions F TOTAL NUM-RANGES

Call the function F on the endpoints of NUM-RANGES half-open (on the right) intervals whose union is [0, TOTAL). The signature of F should be

START * END -> NIL.

Package

qvm

Source

utilities.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-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: mixed-state-qvm-measurement-probabilities QVM

Computes the probability distribution of measurement outcomes (a vector) associated with the STATE of the DENSITY-QVM.

Package

qvm

Source

mixed-state-qvm.lisp (file)

Function: naive-measure-all QAM
Package

qvm

Source

measurement.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: nat-tuple-position NT ELT

In what position is ELT in the nat-tuple NT?

Package

qvm

Source

utilities.lisp (file)

Function: nat-tuple-ref NT I

Extract the Ith element of the nat-tuple NT.

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: not-predicate-name NAME

Returns the concatenated predicate name !NAME

Package

qvm

Source

noise-models.lisp (file)

Function: or-predicate-names NAME1 NAME2

Returns the concatenated predicate name NAME1|NAME2

Package

qvm

Source

noise-models.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 READOUT-POVMS

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

measurement.lisp (file)

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

Given the readout error encoded in the assignment probabilities P00, P01, P10, P11, randomly sample the observed (potentially corrupted) measurement outcome.

Package

qvm

Source

channel-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: power-of-two-p N

Is N equal to some non-negative integer power of two?

Package

qvm

Source

utilities.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: (setf qubit-depolarization) DEPOLARIZATION-PROBABILITY QVM QUBIT

Save the DEPOLARIZATION-PROBABILITY for QUBIT. The depolarizing channel represents the average gate over-rotation/under-rotation noise. It is specified by DEPOLARIZATION-PROBABILITY, which is the probability of overrotation/underrotation for the given QUBIT.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: (setf qubit-fro) FRO QVM QUBIT

Save the readout POVMs for the FRO on the specified QUBIT on the QVM. The FRO is assumed to be the average readout fidelity (avg of p(1|1) and p(0|0)) so as an approximation, we set p(0|0) = p(1|1) = fR0 in the READOUT-POVMS assignment probabilities.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: qubit-limit-for-using-serial-kernels ()

The maximum number of qubits allowed in order to use a specified serial kernel. The value of this function also takes into account *QUBITS-REQUIRED-FOR-PARALLELIZATION*.

Package

qvm

Source

config.lisp (file)

Function: (setf qubit-povm) POVM NOISE-MODEL QUBIT

Set the POVM for a QUBIT in this NOISE-MODEL.

Package

qvm

Source

noise-models.lisp (file)

Function: (setf qubit-t1) T1 QVM QUBIT

Evaluate that T1 is valid, and save it for the specified QUBIT in the QVM.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: (setf qubit-t2) T2 QVM QUBIT

Evaluate that T2 is valid and save it for the specified QUBIT in the QVM.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: (setf qubit-tphi) TPHI QVM QUBIT

Evaluate that TPHI is valid and save it for the specified QUBIT in the QVM.

Package

qvm

Source

basic-noise-qvm.lisp (file)

Function: quil-name TYPE-NAME
Package

qvm

Source

classical-memory.lisp (file)

Function: random-clifford-program LENGTH MAX-CLIFFORD-ARITY NUM-QUBITS &key MEASURE
Package

qvm

Source

stabilizer-qvm.lisp (file)

Function: random-qubits NUM-QUBITS MAX-QUBIT
Package

qvm

Source

stabilizer-qvm.lisp (file)

Function: random-range A B
Package

qvm

Source

stabilizer-qvm.lisp (file)

Function: randomize-wavefunction ()

Randomize the elements of WAVEFUNCTION resulting in a valid complex unit vector.

Package

qvm

Source

wavefunction.lisp (file)

Function: reset-classical-memory QVM

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

Package

qvm

Source

classical-memory-mixin.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: rule-matches-instr-p RULE INSTR POSITION

Check if RULE is matched by instruction data INSTR and the POSITION of the match request.

Package

qvm

Source

channel-qvm.lisp (file)

Function: rule-priority>= RULE1 RULE2

Comparator function for the PRIORITY of 2 noise rules. Returns true if the priority of R1 is >= to the priority of R2.

Package

qvm

Source

noise-models.lisp (file)

Function: sample-wavefunction-as-distribution WF PS

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

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

linear-algebra.lisp (file)

Function: single-kraus%0 INSTANCE
Package

qvm

Source

linear-algebra.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: subsystem-contains-qubit-p SS QUBIT

Does the subsystem SS contain the qubits QUBIT?

Package

qvm

Source

subsystem.lisp (file)

Function: subsystem-contains-qubits-p SS QUBIT-SET

Does the subsystem SS contain the qubits designated by the bit-set QUBIT-SET?

Package

qvm

Source

subsystem.lisp (file)

Function: subsystem-num-qubits SS

How many qubits does the subsystem SS represent?

Package

qvm

Source

subsystem.lisp (file)

Function: subsystem-physical-to-logical-qubit SS PHYS-QUBIT

What logical qubit number does the physical qubit PHYS-QUBIT have in the subsystem SS?

(The "logical qubit" is the relative position of the qubit in the system.)

Package

qvm

Source

subsystem.lisp (file)

Function: subsystem-qubits INSTANCE
Package

qvm

Source

subsystem.lisp (file)

Function: subsystem-state INSTANCE
Package

qvm

Source

subsystem.lisp (file)

Function: subsystemp OBJECT
Package

qvm

Source

subsystem.lisp (file)

Function: superoperator-to-component-matrices SOP

Convert SOP into a MAGICL:MATRIX or a LIST of them.

Package

qvm

Source

linear-algebra.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: warning-wait-function QVM
Package

qvm

Source

classical-memory-mixin.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: %set-state NEW-VALUE OBJECT
Package

qvm

Methods
Method: %set-state NEW-VALUE (MIXED-STATE-QVM mixed-state-qvm)

automatically generated writer method

Source

mixed-state-qvm.lisp (file)

Method: %set-state NEW-VALUE (PURE-STATE-QVM pure-state-qvm)

The unpermuted wavefunction in standard order.

Source

qvm.lisp (file)

Method: %set-state NEW-VALUE (BASE-QVM base-qvm)

The state of the quantum system simulated by the QVM.

Source

qvm.lisp (file)

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

qvm

Methods
Method: %trial-amplitudes (QVM noisy-qvm)
Source

noisy-qvm.lisp (file)

Method: %trial-amplitudes (PURE-STATE pure-state)
Method: (setf %trial-amplitudes) NEW-VALUE (PURE-STATE pure-state)

A second wavefunction used when applying a noisy quantum channel. Applying a Kraus map generally requires evaluating psi_j = K_j * psi for several different j, making it necessary to keep the original wavefunction around. This value should be a QUANTUM-STATE whose size is compatible with the number of qubits of the CHANNEL-QVM. The actual values can be initialized in any way because they will be overwritten. As such, it merely is scratch space for intermediate computations, and hence should not be otherwise directly accessed.

Source

state-representation.lisp (file)

Generic Function: allocation OBJECT
Package

qvm

Methods
Method: allocation (QUANTUM-SYSTEM-STATE quantum-system-state)

automatically generated reader method

Source

state-representation.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 (QVM noisy-qvm)
Method: (setf amplitudes) NEW-AMPLITUDES (QVM noisy-qvm)
Source

noisy-qvm.lisp (file)

Method: amplitudes (QVM density-qvm)
Source

density-qvm.lisp (file)

Method: amplitudes (QVM base-qvm)
Method: (setf amplitudes) NEW-AMPLITUDES (QVM base-qvm)
Source

qvm.lisp (file)

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

The wavefunction of a pure state.

Source

state-representation.lisp (file)

Method: (setf amplitudes) NEW-AMPLITUDES QVM
Source

density-qvm.lisp (file)

Generic Function: apply-all-kraus-maps QVM INSTR KRAUS-MAPS

Apply every kraus map in the list KRAUS-MAPS to the state of the system.

Package

qvm

Source

channel-qvm.lisp (file)

Methods
Method: apply-all-kraus-maps (QVM basic-noise-qvm) (INSTR gate-application) KRAUS-OPS
Source

basic-noise-qvm.lisp (file)

Method: apply-all-kraus-maps (QVM channel-qvm) (INSTR gate-application) KRAUS-MAPS
Generic Function: apply-classical-readout-noise QVM INSTR

Given a QVM and a (measurement) instruction INSTR, corrupt the readout bit according to the POVM specifications of QVM.

Package

qvm

Source

channel-qvm.lisp (file)

Methods
Method: apply-classical-readout-noise (QVM noisy-qvm) (INSTR compiled-measurement)
Source

noisy-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM noisy-qvm) (INSTR measure)
Source

noisy-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM noisy-qvm) (INSTR measure-discard)
Source

noisy-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM density-qvm) (INSTR measure-discard)
Source

density-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM density-qvm) (INSTR measure)
Source

density-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM basic-noise-qvm) (INSTR measure-discard)
Source

basic-noise-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM basic-noise-qvm) (INSTR compiled-measurement)
Source

basic-noise-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM basic-noise-qvm) (INSTR measure)
Source

basic-noise-qvm.lisp (file)

Method: apply-classical-readout-noise (QVM channel-qvm) (INSTR measure-discard)
Method: apply-classical-readout-noise (QVM channel-qvm) (INSTR measure)
Method: apply-classical-readout-noise (QVM channel-qvm) (INSTR compiled-measurement)
Generic Function: apply-kraus-map QVM INSTR KRAUS-OPS

Apply noise from a kraus map KRAUS-OPS to the system. Randomly select a kraus operator from KRAUS-OPS using inverse transform sampling to apply to the STATE of the QVM system.

Package

qvm

Source

channel-qvm.lisp (file)

Generic Function: apply-measure-discard-to-state QVM STATE INSTR
Package

qvm

Methods
Method: apply-measure-discard-to-state QVM (STATE density-matrix-state) (INSTR measure-discard)
Source

measurement.lisp (file)

Method: apply-measure-discard-to-state QVM (STATE pure-state) (INSTR measure-discard)
Source

measurement.lisp (file)

Generic Function: avg-gate-time OBJECT
Package

qvm

Methods
Method: avg-gate-time (BASIC-NOISE-QVM basic-noise-qvm)

To calculate the kraus operators for T1, T2, etc. noise, a gate time value is needed. Ideally, this gate time should be the duration of the gate preceding the application of the kraus noise. As an approximation, this value should represent the average gate time of the gates that will be run.

Source

basic-noise-qvm.lisp (file)

Generic Function: check-allocate-computation-space STATE
Package

qvm

Methods
Method: check-allocate-computation-space (STATE density-matrix-state)
Source

state-representation.lisp (file)

Method: check-allocate-computation-space (STATE pure-state)
Source

state-representation.lisp (file)

Generic Function: classical-memories OBJECT
Package

qvm

Methods
Method: classical-memories (QVM classical-memory-mixin)
Source

classical-memory-mixin.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 classical-memory-mixin)
Source

classical-memory-mixin.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: clifford-application-clifford OBJECT
Package

qvm

Methods
Method: clifford-application-clifford (CLIFFORD-APPLICATION clifford-application)

automatically generated reader method

Source

stabilizer-qvm.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 noisy-qvm) ISN
Source

noisy-qvm.lisp (file)

Method: compile-instruction (QVM density-qvm) ISN
Source

density-qvm.lisp (file)

Method: compile-instruction (QVM channel-qvm) ISN
Source

channel-qvm.lisp (file)

Method: compile-instruction (QVM pure-state-qvm) (ISN measurement)
Method: compile-instruction QVM (ISN gate-application)
Method: compile-instruction QVM (ISN compiled-instruction)
Method: compile-instruction QVM ISN
Method: compile-instruction (QVM mixed-state-qvm) ISN
Source

mixed-state-qvm.lisp (file)

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 depolarizing-qvm)
Source

depolarizing-noise.lisp (file)

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

noisy-qvm.lisp (file)

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

density-qvm.lisp (file)

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

channel-qvm.lisp (file)

Method: compile-loaded-program (QVM mixed-state-qvm)
Source

mixed-state-qvm.lisp (file)

Method: compile-loaded-program (QVM pure-state-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-INLINED-MATRIX-GATE-APPLICATION compiled-inlined-matrix-gate-application)

The (static) matrix represented by this application.

Source

compile-gate.lisp (file)

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

linear-algebra.lisp (file)

Methods
Method: conjugate-entrywise (GATE simple-gate)
Method: conjugate-entrywise (GATE permutation-gate)
Method: conjugate-entrywise (GATE parameterized-gate)
Generic Function: depolarization-ops OBJECT
Generic Function: (setf depolarization-ops) NEW-VALUE OBJECT
Package

qvm

Methods
Method: depolarization-ops (BASIC-NOISE-QVM basic-noise-qvm)
Method: (setf depolarization-ops) NEW-VALUE (BASIC-NOISE-QVM basic-noise-qvm)

A hash table of qubit to depolarization operators, representing gate application noise. Gate over-rotations and under-rotations average out to the depolarizing channel.

Source

basic-noise-qvm.lisp (file)

Generic Function: elapsed-time OBJECT
Generic Function: (setf elapsed-time) NEW-VALUE OBJECT
Package

qvm

Methods
Method: elapsed-time (BASIC-NOISE-QVM basic-noise-qvm)
Method: (setf elapsed-time) NEW-VALUE (BASIC-NOISE-QVM basic-noise-qvm)

A value to keep track of the elpased time of the program. The elapsed time is used for calculating the kraus operators of some noise value at a given point in the program.

Source

basic-noise-qvm.lisp (file)

Generic Function: elements-vector OBJECT
Generic Function: (setf elements-vector) NEW-VALUE OBJECT
Package

qvm

Methods
Method: elements-vector (DENSITY-MATRIX-STATE density-matrix-state)
Method: (setf elements-vector) NEW-VALUE (DENSITY-MATRIX-STATE density-matrix-state)

The contents of a density matrix ρ as a one-dimensional vector. For a state of N qubits, this vector should be of length 2^(2*N).

Source

state-representation.lisp (file)

Method: (setf elements-vector) NEW-VALUE (STATE density-matrix-state) after
Source

state-representation.lisp (file)

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

qvm

Methods
Method: gate-definitions (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)
Method: (setf gate-definitions) NEW-VALUE (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)

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

Source

classical-memory-mixin.lisp (file)

Generic Function: get-excited-state-probability STATE QUBIT

Get the excited state probability from the wavefunction (if PURE-STATE) or density matrix (if DENSITY-MATRIX-STATE).

Package

qvm

Source

measurement.lisp (file)

Methods
Method: get-excited-state-probability (STATE pure-state) QUBIT
Method: get-excited-state-probability (STATE density-matrix-state) QUBIT
Generic Function: matrix-view OBJECT
Package

qvm

Methods
Method: matrix-view (DENSITY-MATRIX-STATE density-matrix-state)

2D array displaced to ELEMENTS-VECTOR

Source

state-representation.lisp (file)

Generic Function: measure-all-state STATE QVM

The protocol for MEASURE-ALL differs by the STATE type of the QVM.

Package

qvm

Source

measurement.lisp (file)

Methods
Method: measure-all-state (STATE density-matrix-state) (QVM basic-noise-qvm)
Source

basic-noise-qvm.lisp (file)

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

basic-noise-qvm.lisp (file)

Method: measure-all-state (STATE density-matrix-state) (QVM channel-qvm)
Source

channel-qvm.lisp (file)

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

channel-qvm.lisp (file)

Method: measure-all-state (STATE density-matrix-state) (QVM base-qvm)
Method: measure-all-state (STATE pure-state) (QVM base-qvm)
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 (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)

Method: noisy-gate-definitions (DENSITY-QVM density-qvm)

automatically generated reader method

Source

density-qvm.lisp (file)

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

automatically generated writer method

Source

density-qvm.lisp (file)

Generic Function: num-qubits STATE

Return the number of qubits represented by the STATE.

Package

qvm

Source

state-representation.lisp (file)

Methods
Method: num-qubits (STATE density-matrix-state)
Method: num-qubits (STATE pure-state)
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: operation-elements OBJECT
Package

qvm

Methods
Method: operation-elements (NOISE-RULE noise-rule)

A list of kraus maps to apply when the rule is matched. Each kraus map is a list of kraus operators.

Source

noise-models.lisp (file)

Generic Function: original-amplitudes OBJECT
Package

qvm

Methods
Method: original-amplitudes (PURE-STATE pure-state)

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

Source

state-representation.lisp (file)

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

qvm

Methods
Method: pc (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)
Method: (setf pc) NEW-VALUE (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)

The program counter.

Source

classical-memory-mixin.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 (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)
Method: (setf program) NEW-VALUE (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)

The program to be executed.

Source

classical-memory-mixin.lisp (file)

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

qvm

Methods
Method: program-compiled-p (BASE-QVM base-qvm)
Method: (setf program-compiled-p) NEW-VALUE (BASE-QVM base-qvm)

Has the loaded program been compiled?

Source

qvm.lisp (file)

Generic Function: projector-operator OBJECT
Package

qvm

Methods
Method: projector-operator (COMPILED-MEASUREMENT compiled-measurement)

Projection function which takes a WAVEFUNCTION as an argument and returns the measured bit result.

Source

compile-gate.lisp (file)

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

qvm

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

Method: readout-povms (DENSITY-QVM density-qvm)

automatically generated reader method

Source

density-qvm.lisp (file)

Method: (setf readout-povms) NEW-VALUE (DENSITY-QVM density-qvm)

automatically generated writer method

Source

density-qvm.lisp (file)

Method: readout-povms (BASIC-NOISE-QVM basic-noise-qvm)
Method: (setf readout-povms) NEW-VALUE (BASIC-NOISE-QVM basic-noise-qvm)

A hash-table of qubit idx to a list of povms, representing the readout assignment probabilities (p(0|0) p(0|1) p(1|0) p(1|1)).

Source

basic-noise-qvm.lisp (file)

Method: readout-povms (NOISE-MODEL noise-model)
Method: (setf readout-povms) NEW-VALUE (NOISE-MODEL noise-model)

A hash table of qubit to readout noise assignment probabilities, given as a 4-element list ((p(0|0) p(0|1) p(1|0) p(1|1)).

Source

noise-models.lisp (file)

Generic Function: requires-swapping-amps-p STATE

Determine whether the state-elements are in the correct QVM slot after doing a computation that requires the additional space. This is only relevant for a PURE-STATE.

Package

qvm

Source

state-representation.lisp (file)

Methods
Method: requires-swapping-amps-p (STATE density-matrix-state)
Method: requires-swapping-amps-p (STATE pure-state)
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 base-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

density-qvm.lisp (file)

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

noisy-qvm.lisp (file)

Method: set-readout-povm (QVM density-qvm) QUBIT POVM
Generic Function: set-superoperator QVM GATE-NAME QUBITS KRAUS-OPS
Package

qvm

Methods
Method: set-superoperator (QVM base-qvm) GATE-NAME QUBITS KRAUS-OPS
Source

qvm.lisp (file)

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-INSTRUCTION compiled-instruction)
Method: (setf source-instruction) NEW-VALUE (COMPILED-INSTRUCTION compiled-instruction)

The instruction that was compiled to produce this one.

Source

compile-gate.lisp (file)

Generic Function: stabilizer-qvm-tableau OBJECT
Package

qvm

Methods
Method: stabilizer-qvm-tableau (STABILIZER-QVM stabilizer-qvm)

automatically generated reader method

Source

stabilizer-qvm.lisp (file)

Generic Function: state OBJECT
Package

qvm

Methods
Method: state (MIXED-STATE-QVM mixed-state-qvm)

automatically generated reader method

Source

mixed-state-qvm.lisp (file)

Method: state (PURE-STATE-QVM pure-state-qvm)

The unpermuted wavefunction in standard order.

Source

qvm.lisp (file)

Method: state (BASE-QVM base-qvm)

The state of the quantum system simulated by the QVM.

Source

qvm.lisp (file)

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

qvm

Methods
Method: superoperator-definitions (BASE-QVM base-qvm)
Method: (setf superoperator-definitions) NEW-VALUE (BASE-QVM base-qvm)

A hash table of gate name to SUPEROPERATOR. These superoperator definitions are meant to override the gate name definitions stored in GATE-DEFINITIONS, such that a superoperator will be applied to the state of the QVM if the current gate name matches an entry in the SUPEROPERATOR-DEFINITIONS.

Source

qvm.lisp (file)

Generic Function: swap-internal-amplitude-pointers STATE

Only relevant for PURE-STATE – swap AMPLITUDES with TRIAL-AMPLITUDES.

Package

qvm

Source

state-representation.lisp (file)

Methods
Method: swap-internal-amplitude-pointers (STATE pure-state)
Generic Function: t1-vals OBJECT
Generic Function: (setf t1-vals) NEW-VALUE OBJECT
Package

qvm

Methods
Method: t1-vals (BASIC-NOISE-QVM basic-noise-qvm)
Method: (setf t1-vals) NEW-VALUE (BASIC-NOISE-QVM basic-noise-qvm)

Hash table of qubit idx to T1 value for each qubit to simulate

Source

basic-noise-qvm.lisp (file)

Generic Function: t2-vals OBJECT
Generic Function: (setf t2-vals) NEW-VALUE OBJECT
Package

qvm

Methods
Method: t2-vals (BASIC-NOISE-QVM basic-noise-qvm)
Method: (setf t2-vals) NEW-VALUE (BASIC-NOISE-QVM basic-noise-qvm)

Hash table of qubit idx to T2 value for each qubit to simulate

Source

basic-noise-qvm.lisp (file)

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

qvm

Methods
Method: temporary-state (DENSITY-MATRIX-STATE density-matrix-state)
Method: (setf temporary-state) NEW-VALUE (DENSITY-MATRIX-STATE density-matrix-state)

A placeholder for computations on the elements-vector of a DENSITY-MATRIX-STATE.

Source

state-representation.lisp (file)

Generic Function: tphi-vals OBJECT
Generic Function: (setf tphi-vals) NEW-VALUE OBJECT
Package

qvm

Methods
Method: tphi-vals (BASIC-NOISE-QVM basic-noise-qvm)
Method: (setf tphi-vals) NEW-VALUE (BASIC-NOISE-QVM basic-noise-qvm)

Hash table of qubit idx to TPHI value for each qubit to simulate.

Source

basic-noise-qvm.lisp (file)

Generic Function: wait-function OBJECT
Package

qvm

Methods
Method: wait-function (CLASSICAL-MEMORY-MIXIN classical-memory-mixin)

A unary function taking a QVM and implementing Quil’s WAIT logic. (The default does nothing and just warns.)

Source

classical-memory-mixin.lisp (file)


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

5.2.7 Structures

Structure: kraus-list ()
Package

qvm

Source

linear-algebra.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

linear-algebra.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: subsystem ()

Representation of the state of a subsystem of qubits.

Package

qvm

Source

subsystem.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods

print-object (method)

Direct slots
Slot: state
Type

qvm:quantum-state

Initform

(qvm:wf 1)

Readers

subsystem-state (function)

Writers

(setf subsystem-state) (function)

Slot: qubits
Type

unsigned-byte

Initform

0

Readers

subsystem-qubits (function)

Writers

(setf subsystem-qubits) (function)

Structure: superoperator ()

Representation of a linear operator on density operators.

Package

qvm

Source

linear-algebra.lisp (file)

Direct superclasses

algebraic-data-type (structure)

Direct subclasses
Direct methods

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

5.2.8 Classes

Class: base-qvm ()
Package

qvm

Source

qvm.lisp (file)

Direct superclasses

classical-memory-mixin (class)

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

Number of qubits being simulated by the QVM.

Type

alexandria:non-negative-fixnum

Initargs

:number-of-qubits

Initform

(error ":number-of-qubits is a required initarg to base-qvm.")

Readers

number-of-qubits (generic function)

Slot: state

The state of the quantum system simulated by the QVM.

Initargs

:state

Readers

state (generic function)

Writers

%set-state (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: superoperator-definitions

A hash table of gate name to SUPEROPERATOR. These superoperator definitions are meant to override the gate name definitions stored in GATE-DEFINITIONS, such that a superoperator will be applied to the state of the QVM if the current gate name matches an entry in the SUPEROPERATOR-DEFINITIONS.

Initargs

:superoperator-definitions

Initform

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

Readers

superoperator-definitions (generic function)

Writers

(setf superoperator-definitions) (generic function)

Class: clifford-application ()

A gate application that’s actually a Clifford.

Package

qvm

Source

stabilizer-qvm.lisp (file)

Direct superclasses

application (class)

Direct methods
Direct slots
Slot: clifford
Initargs

:clifford

Readers

clifford-application-clifford (generic function)

Class: compiled-gate-application ()

A representation of a compiled gate application.

Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Direct slots
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-inlined-matrix-gate-application ()

A compiled GATE-APPLICATION that has the matrix inlined. 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-instruction ()
Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses

standard-object (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)

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-measurement ()

A compiled MEASURE, regardless of its classical effect.

Package

qvm

Source

compile-gate.lisp (file)

Direct superclasses
Direct methods
Direct slots
Slot: projector-operator

Projection function which takes a WAVEFUNCTION as an argument and returns the measured bit result.

Initargs

:projector-operator

Readers

projector-operator (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-to-state (method)

Class: mixed-state-qvm ()

A qvm for simulating mixed-state quantum systems.

Package

qvm

Source

mixed-state-qvm.lisp (file)

Direct superclasses

base-qvm (class)

Direct methods
Direct slots
Slot: state
Type

(or null qvm:density-matrix-state)

Initargs

:state

Readers

state (generic function)

Writers

%set-state (generic function)

Class: quantum-system-state ()

A QUANTUM-SYSTEM-STATE contains the quantum mechanical state of the QVM and any additional helper objects used in performing computations on the state.

Package

qvm

Source

state-representation.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods

allocation (method)

Direct slots
Slot: allocation
Initargs

:allocation

Readers

allocation (generic function)

Class: stabilizer-qvm ()

A QVM that can efficiently simulate Clifford circuits and measurement.

Package

qvm

Source

stabilizer-qvm.lisp (file)

Direct superclasses

classical-memory-mixin (class)

Direct methods
Direct slots
Slot: tableau
Initargs

:tableau

Readers

stabilizer-qvm-tableau (generic function)


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

5.2.9 Types

Type: cflonum-vector &optional LENGTH
Package

qvm

Source

floats.lisp (file)

Type: density-operator-matrix-view ()

The matrix view of a density operator.

Package

qvm

Source

density-qvm.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.

In the context of the QVM, this represents a particular Hilbert space.

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: noise-priority ()
Package

qvm

Source

noise-models.lisp (file)

Type: valid-noise-value ()
Package

qvm

Source

basic-noise-qvm.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․asd file
File, Lisp, qvm/allocator.lisp: The qvm/allocator․lisp file
File, Lisp, qvm/apply-gate.lisp: The qvm/apply-gate․lisp file
File, Lisp, qvm/basic-noise-qvm.lisp: The qvm/basic-noise-qvm․lisp file
File, Lisp, qvm/channel-qvm.lisp: The qvm/channel-qvm․lisp file
File, Lisp, qvm/classical-memory-mixin.lisp: The qvm/classical-memory-mixin․lisp file
File, Lisp, qvm/classical-memory.lisp: The qvm/classical-memory․lisp file
File, Lisp, qvm/compile-gate.lisp: The qvm/compile-gate․lisp file
File, Lisp, qvm/config.lisp: The qvm/config․lisp file
File, Lisp, qvm/density-qvm.lisp: The qvm/density-qvm․lisp file
File, Lisp, qvm/depolarizing-noise.lisp: The qvm/depolarizing-noise․lisp file
File, Lisp, qvm/execution.lisp: The qvm/execution․lisp file
File, Lisp, qvm/floats.lisp: The qvm/floats․lisp file
File, Lisp, qvm/grovel-shared-memory.lisp: The qvm/grovel-shared-memory․lisp file
File, Lisp, qvm/grovel-system-constants.lisp: The qvm/grovel-system-constants․lisp file
File, Lisp, qvm/impl/allegro.lisp: The qvm/impl/allegro․lisp file
File, Lisp, qvm/impl/clozure.lisp: The qvm/impl/clozure․lisp file
File, Lisp, qvm/impl/linear-algebra-intrinsics.lisp: The qvm/impl/linear-algebra-intrinsics․lisp file
File, Lisp, qvm/impl/lispworks.lisp: The qvm/impl/lispworks․lisp file
File, Lisp, qvm/impl/prefetch-intrinsics.lisp: The qvm/impl/prefetch-intrinsics․lisp file
File, Lisp, qvm/impl/sbcl-avx-vops.lisp: The qvm/impl/sbcl-avx-vops․lisp file
File, Lisp, qvm/impl/sbcl-intrinsics.lisp: The qvm/impl/sbcl-intrinsics․lisp file
File, Lisp, qvm/impl/sbcl-x86-vops.lisp: The qvm/impl/sbcl-x86-vops․lisp file
File, Lisp, qvm/impl/sbcl.lisp: The qvm/impl/sbcl․lisp file
File, Lisp, qvm/linear-algebra.lisp: The qvm/linear-algebra․lisp file
File, Lisp, qvm/measurement.lisp: The qvm/measurement․lisp file
File, Lisp, qvm/misc.lisp: The qvm/misc․lisp file
File, Lisp, qvm/mixed-state-qvm.lisp: The qvm/mixed-state-qvm․lisp file
File, Lisp, qvm/noise-models.lisp: The qvm/noise-models․lisp file
File, Lisp, qvm/noisy-qvm.lisp: The qvm/noisy-qvm․lisp file
File, Lisp, qvm/package.lisp: The qvm/package․lisp file
File, Lisp, qvm/path-simulate.lisp: The qvm/path-simulate․lisp file
File, Lisp, qvm/qam.lisp: The qvm/qam․lisp file
File, Lisp, qvm/qvm.lisp: The qvm/qvm․lisp file
File, Lisp, qvm/serial-kernels.lisp: The qvm/serial-kernels․lisp file
File, Lisp, qvm/shm.lisp: The qvm/shm․lisp file
File, Lisp, qvm/stabilizer-qvm.lisp: The qvm/stabilizer-qvm․lisp file
File, Lisp, qvm/state-representation.lisp: The qvm/state-representation․lisp file
File, Lisp, qvm/subsystem.lisp: The qvm/subsystem․lisp file
File, Lisp, qvm/transition-classical-instructions.lisp: The qvm/transition-classical-instructions․lisp file
File, Lisp, qvm/transition.lisp: The qvm/transition․lisp file
File, Lisp, qvm/utilities.lisp: The qvm/utilities․lisp file
File, Lisp, qvm/wavefunction.lisp: The qvm/wavefunction․lisp file

L
Lisp File, qvm.asd: The qvm․asd file
Lisp File, qvm/allocator.lisp: The qvm/allocator․lisp file
Lisp File, qvm/apply-gate.lisp: The qvm/apply-gate․lisp file
Lisp File, qvm/basic-noise-qvm.lisp: The qvm/basic-noise-qvm․lisp file
Lisp File, qvm/channel-qvm.lisp: The qvm/channel-qvm․lisp file
Lisp File, qvm/classical-memory-mixin.lisp: The qvm/classical-memory-mixin․lisp file
Lisp File, qvm/classical-memory.lisp: The qvm/classical-memory․lisp file
Lisp File, qvm/compile-gate.lisp: The qvm/compile-gate․lisp file
Lisp File, qvm/config.lisp: The qvm/config․lisp file
Lisp File, qvm/density-qvm.lisp: The qvm/density-qvm․lisp file
Lisp File, qvm/depolarizing-noise.lisp: The qvm/depolarizing-noise․lisp file
Lisp File, qvm/execution.lisp: The qvm/execution․lisp file
Lisp File, qvm/floats.lisp: The qvm/floats․lisp file
Lisp File, qvm/grovel-shared-memory.lisp: The qvm/grovel-shared-memory․lisp file
Lisp File, qvm/grovel-system-constants.lisp: The qvm/grovel-system-constants․lisp file
Lisp File, qvm/impl/allegro.lisp: The qvm/impl/allegro․lisp file
Lisp File, qvm/impl/clozure.lisp: The qvm/impl/clozure․lisp file
Lisp File, qvm/impl/linear-algebra-intrinsics.lisp: The qvm/impl/linear-algebra-intrinsics․lisp file
Lisp File, qvm/impl/lispworks.lisp: The qvm/impl/lispworks․lisp file
Lisp File, qvm/impl/prefetch-intrinsics.lisp: The qvm/impl/prefetch-intrinsics․lisp file
Lisp File, qvm/impl/sbcl-avx-vops.lisp: The qvm/impl/sbcl-avx-vops․lisp file
Lisp File, qvm/impl/sbcl-intrinsics.lisp: The qvm/impl/sbcl-intrinsics․lisp file
Lisp File, qvm/impl/sbcl-x86-vops.lisp: The qvm/impl/sbcl-x86-vops․lisp file
Lisp File, qvm/impl/sbcl.lisp: The qvm/impl/sbcl․lisp file
Lisp File, qvm/linear-algebra.lisp: The qvm/linear-algebra․lisp file
Lisp File, qvm/measurement.lisp: The qvm/measurement․lisp file
Lisp File, qvm/misc.lisp: The qvm/misc․lisp file
Lisp File, qvm/mixed-state-qvm.lisp: The qvm/mixed-state-qvm․lisp file
Lisp File, qvm/noise-models.lisp: The qvm/noise-models․lisp file
Lisp File, qvm/noisy-qvm.lisp: The qvm/noisy-qvm․lisp file
Lisp File, qvm/package.lisp: The qvm/package․lisp file
Lisp File, qvm/path-simulate.lisp: The qvm/path-simulate․lisp file
Lisp File, qvm/qam.lisp: The qvm/qam․lisp file
Lisp File, qvm/qvm.lisp: The qvm/qvm․lisp file
Lisp File, qvm/serial-kernels.lisp: The qvm/serial-kernels․lisp file
Lisp File, qvm/shm.lisp: The qvm/shm․lisp file
Lisp File, qvm/stabilizer-qvm.lisp: The qvm/stabilizer-qvm․lisp file
Lisp File, qvm/state-representation.lisp: The qvm/state-representation․lisp file
Lisp File, qvm/subsystem.lisp: The qvm/subsystem․lisp file
Lisp File, qvm/transition-classical-instructions.lisp: The qvm/transition-classical-instructions․lisp file
Lisp File, qvm/transition.lisp: The qvm/transition․lisp file
Lisp File, qvm/utilities.lisp: The qvm/utilities․lisp file
Lisp File, qvm/wavefunction.lisp: The qvm/wavefunction․lisp file

Q
qvm.asd: The qvm․asd file
qvm/allocator.lisp: The qvm/allocator․lisp file
qvm/apply-gate.lisp: The qvm/apply-gate․lisp file
qvm/basic-noise-qvm.lisp: The qvm/basic-noise-qvm․lisp file
qvm/channel-qvm.lisp: The qvm/channel-qvm․lisp file
qvm/classical-memory-mixin.lisp: The qvm/classical-memory-mixin․lisp file
qvm/classical-memory.lisp: The qvm/classical-memory․lisp file
qvm/compile-gate.lisp: The qvm/compile-gate․lisp file
qvm/config.lisp: The qvm/config․lisp file
qvm/density-qvm.lisp: The qvm/density-qvm․lisp file
qvm/depolarizing-noise.lisp: The qvm/depolarizing-noise․lisp file
qvm/execution.lisp: The qvm/execution․lisp file
qvm/floats.lisp: The qvm/floats․lisp file
qvm/grovel-shared-memory.lisp: The qvm/grovel-shared-memory․lisp file
qvm/grovel-system-constants.lisp: The qvm/grovel-system-constants․lisp file
qvm/impl/allegro.lisp: The qvm/impl/allegro․lisp file
qvm/impl/clozure.lisp: The qvm/impl/clozure․lisp file
qvm/impl/linear-algebra-intrinsics.lisp: The qvm/impl/linear-algebra-intrinsics․lisp file
qvm/impl/lispworks.lisp: The qvm/impl/lispworks․lisp file
qvm/impl/prefetch-intrinsics.lisp: The qvm/impl/prefetch-intrinsics․lisp file
qvm/impl/sbcl-avx-vops.lisp: The qvm/impl/sbcl-avx-vops․lisp file
qvm/impl/sbcl-intrinsics.lisp: The qvm/impl/sbcl-intrinsics․lisp file
qvm/impl/sbcl-x86-vops.lisp: The qvm/impl/sbcl-x86-vops․lisp file
qvm/impl/sbcl.lisp: The qvm/impl/sbcl․lisp file
qvm/linear-algebra.lisp: The qvm/linear-algebra․lisp file
qvm/measurement.lisp: The qvm/measurement․lisp file
qvm/misc.lisp: The qvm/misc․lisp file
qvm/mixed-state-qvm.lisp: The qvm/mixed-state-qvm․lisp file
qvm/noise-models.lisp: The qvm/noise-models․lisp file
qvm/noisy-qvm.lisp: The qvm/noisy-qvm․lisp file
qvm/package.lisp: The qvm/package․lisp file
qvm/path-simulate.lisp: The qvm/path-simulate․lisp file
qvm/qam.lisp: The qvm/qam․lisp file
qvm/qvm.lisp: The qvm/qvm․lisp file
qvm/serial-kernels.lisp: The qvm/serial-kernels․lisp file
qvm/shm.lisp: The qvm/shm․lisp file
qvm/stabilizer-qvm.lisp: The qvm/stabilizer-qvm․lisp file
qvm/state-representation.lisp: The qvm/state-representation․lisp file
qvm/subsystem.lisp: The qvm/subsystem․lisp file
qvm/transition-classical-instructions.lisp: The qvm/transition-classical-instructions․lisp file
qvm/transition.lisp: The qvm/transition․lisp file
qvm/utilities.lisp: The qvm/utilities․lisp file
qvm/wavefunction.lisp: The qvm/wavefunction․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   J   K   L   M   N   O   P   Q   R   S   T   W   Z  
Index Entry  Section

%
%check-depol-entry: Internal functions
%check-noise-entry: Internal functions
%check-povm-entry: Internal functions
%close: Internal functions
%collapse-integer-by-mask: Internal functions
%corrupt-qvm-memory-with-povm: Internal functions
%evolve-density-matrix-with-superoperator: Internal functions
%evolve-pure-state-stochastically: 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
%set-state: Internal generic functions
%set-state: Internal generic functions
%set-state: Internal generic functions
%set-state: Internal generic functions
%strerror: Internal functions
%trial-amplitudes: Internal generic 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 amplitudes): Internal generic functions
(setf amplitudes): Internal generic functions
(setf amplitudes): Internal generic functions
(setf depolarization-ops): Internal generic functions
(setf depolarization-ops): Internal generic functions
(setf dereference-mref): Internal functions
(setf elapsed-time): Internal generic functions
(setf elapsed-time): Internal generic functions
(setf elements-vector): Internal generic functions
(setf elements-vector): Internal generic functions
(setf elements-vector): Internal generic 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 noise-model): Exported generic functions
(setf noise-model): Exported generic functions
(setf noise-predicate): Exported generic functions
(setf noise-predicate): Exported generic functions
(setf noise-rules): Exported generic functions
(setf noise-rules): Exported generic 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 qubit-depolarization): Internal functions
(setf qubit-fro): Internal functions
(setf qubit-povm): Internal functions
(setf qubit-t1): Internal functions
(setf qubit-t2): Internal functions
(setf qubit-tphi): Internal functions
(setf readout-povms): Internal generic functions
(setf readout-povms): 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 state-elements): Exported generic functions
(setf state-elements): Exported generic functions
(setf state-elements): Exported generic functions
(setf superoperator-definitions): Internal generic functions
(setf superoperator-definitions): Internal generic functions
(setf t1-vals): Internal generic functions
(setf t1-vals):&n