Skip to content

Fast quantum circuit simulator Qulacs as backend for Cirq

License

Notifications You must be signed in to change notification settings

qulacs/cirq-qulacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fast quantum circuit simulator Qulacs as backend for Cirq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages