Quantum computer simulator that supports GPU acceleration and hardware random number generators.
Find a file
2025-11-26 17:05:59 -05:00
examples migration 2025-10-31 17:56:24 -04:00
src Update src/examples/send.sh 2025-11-26 17:05:59 -05:00
build.sh build.sh 2025-10-31 17:51:50 -04:00
LICENSE migration 2025-10-31 17:56:24 -04:00
Makefile migration 2025-10-31 17:56:24 -04:00
README.md Update README.md 2025-11-25 17:00:09 -05:00
README_old.md migration 2025-10-31 17:56:24 -04:00

QAnsel

A quantum computer simulator which supports hardware acceleration (GPUs) as well as hardware random number generators.

Compilation / Installation

	git clone https://www.foleosoft.com/software/QAnsel
	cd QAnsel
	make
	sudo make install

If you are compiling for a device which cannot support hardware acceleration, then you can use make simple which will build the program with those features stripped out.

Examples

Many example programs that can be executed inside of QAnsel can be found in the examples folder.

Usage

The QAnsel simulator expects programs to be written in a language similar to OpenQASM 2.0. These programs must be piped into QAnsel as standard input and the simulation results will be displayed as standard output. Below is an example using a here document.

	$ ./QAnsel << EOF
	> qreg q[2];
	> creg c[2];
	> h q[0];
	> cx q[0], q[1];
	> measure q[0] -> c[0];
	> measure q[1] -> c[1];
	> sample c;
	> EOF
	00: 50.7%
	01: 0.0%
	10: 0.0%
	11: 49.3%

Please use the -? flag to see a help document.

Special Hardware

To enable a hardware random number generator, the -r flag must be used. This flag will select the hardware random number generator based on an order of precedence. The order is as follows.

  1. Quantis-PCIe-40M
  2. TrueRNG V3
  3. Intel Secure Key Technology

To enable GPU acceleration, the -oX flag has to be set replacing X with an optimization level equal to 4 or greater.

It is recommended that you run a simple program with the -v flag which will produce output stating which hardware devices were actually found and enabled.

QAnsel can handle up to 16 qubits, however, qubit counts greater than 14 will not fit into most consumer-end GPUs. It is recommended to stick to a maximum of 14 qubits. This is compatible with GPU acceleration with mearly 3 GB of VRAM.