Skip to main content

PennyLane plugin for Cirq

Project description

Travis Codecov coverage Codacy grade Read the Docs PyPI

PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.

Cirq is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators.

This PennyLane plugin allows to use both the software and hardware backends of Cirq as devices for PennyLane.


  • Access to Cirq’s simulator backend via the cirq.simulator device
  • Support for all PennyLane core functionality


Plugin Name requires both PennyLane and Cirq. It can be installed via pip:

$ python -m pip install pennylane-cirq

Getting started

Once Pennylane Cirq is installed, the provided Cirq devices can be accessed straight away in PennyLane.

You can instantiate these devices for PennyLane as follows:

import pennylane as qml
dev = qml.device('cirq.simulator', wires=2, shots=100, analytic=True)

These devices can then be used just like other devices for the definition and evaluation of QNodes within PennyLane. For more details, see the plugin usage guide and refer to the PennyLane documentation.


We welcome contributions - simply fork the Plugin Name repository, and then make a pull request containing your contribution. All contributors to PennyLane-Cirq will be listed as authors on the releases.

We also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects or applications built on PennyLane and Cirq.


Johannes Jakob Meyer

If you are doing research using PennyLane, please cite our papers:

Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, and Nathan Killoran. PennyLane: Automatic differentiation of hybrid quantum-classical computations. 2018. arXiv:1811.04968

Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. Evaluating analytic gradients on quantum hardware. 2018. Phys. Rev. A 99, 032331


If you are having issues, please let us know by posting the issue on our GitHub issue tracker.


Plugin Name is free and open source, released under the Apache License, Version 2.0.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PennyLane-Cirq, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size PennyLane_Cirq-0.2.0-py3-none-any.whl (17.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size PennyLane-Cirq-0.2.0.tar.gz (9.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page