MyNixOS website logo
Description

A Quantum Computer Simulator.

A quantum computer simulator framework with up to 24 qubits. It allows to define general single qubit gates and general controlled single qubit gates. For convenience, it currently provides the most common gates (X, Y, Z, H, Z, S, T, Rx, Ry, Rz, CNOT, SWAP, Toffoli or CCNOT, Fredkin or CSWAP). 'qsimulatR' also implements noise models. 'qsimulatR' supports plotting of circuits and is able to export circuits to 'Qiskit' <https://qiskit.org/>, a python package which can be used to run on IBM's hardware <https://quantum-computing.ibm.com/>.

qsimulatR

A simple quantum computer simulator in R.

Installation

Install the programming language R if you have not done so yet.

Download the source code, e.g. with

git clone https://github.com/HISKP-LQCD/qsimulatR.git

and go into the newly created directory qsimulatR. Execute:

./install

You might have to install additional packages. Just use install.packages() for any packages recommended in a possible error message.

The install script might not work under Windows. To circumvent this, you can download the source package from github. Then

install.packages("qsimulatR.zip", repos=NULL, type="source")

The library qsimulatR is now available in your R installation and can be loaded with:

library(qsimulatR)

Check for updates regularly. Do so by going into the directory qsimulatR and executing

git pull
./install

Usage

A detailed usage description can be found in qsimulatR.pdf. We provide many useful examples in the R Markdown format in vignettes.

Your first very simple program with qsimulatR might look like this:

library(qsimulatR)

# generate a quantum state with 2 qubits, initialised to |00>
x = qstate(nbits=2)
# display the state
x

# apply the Hadamard gate to the first (right) qubit
y = H(1) * x
y

# apply a controlled NOT
z = CNOT(c(1,2)) * y
z

# draw the resulting circuit
plot(z)

# project onto a single compute basis state
res = measure(z)
# draw the circuit
plot(res$psi)

# perform the measurement many times and plot the outcome
dist = measure(z, rep=1000)
hist(dist)
Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows