Skip to content
Fast quantum circuit simulator Qulacs as backend for Cirq
Python Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmark
cirqqulacs
docker
tests
.gitignore
LICENSE
README.md
benchmark.png
setup.py

README.md

Cirq-Qulacs

Feature

  • Fast quantum circuit simulation on Cirq with qulacs backend
  • It also supports CUDA for high performance simulation

Performance

Test enviornment

  • Depth 8 Quantum Volume circuit generated by openqasm
  • Nvidia Tesla V100
  • Intel Xeon E5-2690v4
  • Circuit compression disabled

benchmark

Installation

Requirements

Install cirq-qulacs from source

Install

git clone https://github.com/qulacs/cirq-qulacs.git
cd cirq-qulacs
python setup.py install

Uninstall

pip uninstall cirqqulacs

Sample code

CPU

import cirq
from cirqqulacs import QulacsSimulator

qubit_n = 3
qubits = [cirq.LineQubit(i) for i in range(qubit_n)]
circuit = cirq.Circuit()
circuit.append(cirq.ops.X(qubits[0]))
circuit.append(cirq.ops.Rx(np.pi/5.5).on(qubits[1]))
circuit.append(cirq.ops.CCZ(qubits[0], qubits[1], qubits[2]))
result = QulacsSimulator().simulate(circuit)

GPU

import cirq
from cirqqulacs import QulacsSimulatorGpu

qubit_n = 3
qubits = [cirq.LineQubit(i) for i in range(qubit_n)]
circuit = cirq.Circuit()
circuit.append(cirq.ops.X(qubits[0]))
circuit.append(cirq.ops.Rx(np.pi/5.5).on(qubits[1]))
circuit.append(cirq.ops.CCZ(qubits[0], qubits[1], qubits[2]))
result = QulacsSimulatorGpu().simulate(circuit)

License

MIT License (see LICENSE file).

You can’t perform that action at this time.