Cirq  |  Google Quantum AI (2024)

Sign in
  • Cirq
  • Google Quantum AI
  • Software
  • Cirq
Cirq | Google Quantum AI (2)

Cirq | Google Quantum AI (3)

An open source framework for programming quantum computers

Cirq is a Python software library for writing, manipulating, and optimizing quantum circuits, and then running them on quantum computers and quantum simulators. Cirq provides useful abstractions for dealing with today’s noisy intermediate-scale quantum computers, where details of the hardware are vital to achieving state-of-the-art results.

Get started with Cirq open_in_new GitHub repository

import cirq# Pick a qubit.qubit = cirq.GridQubit(0, 0)# Create a circuitcircuit = cirq.Circuit( cirq.X(qubit)**0.5, # Square root of NOT. cirq.measure(qubit, key='m') # Measurement.)print("Circuit:")print(circuit)# Simulate the circuit several times.simulator = cirq.Simulator()result = simulator.run(circuit, repetitions=20)print("Results:")print(result)
Learn how to build quantum circuits from gates acting on qubits. Understand what a Moment is and how different insertion strategies can help you build your desired circuit. Learn about how to slice and dice circuits and transform them into new and better circuits. Learn more

Cirq | Google Quantum AI (5)

Hardware constraints have a large impact on whether a circuit is practical or not on modern hardware. Learn how devices can be defined to handle these constraints.

Cirq | Google Quantum AI (6)

Cirq comes with built-in simulators, both for wave functions and for density matrices. These can handle noisy quantum channels using monte carlo or full density matrix simulations. In addition, Cirq works with a state-of-the-art wave function simulator: qsim. These simulators can be used to mock quantum hardware with the Quantum Virtual Machine.

Simulate with Cirq Simulate with qsim Simulate with the QVM

Cirq is used to run experiments on Google's quantum processors. Learn more about the latest experiments and access the code to se how to run them yourself. Learn more

Cirq | Google Quantum AI (8)

Get started on Cirq’s basics with this tutorial. Learn the difference between gates and operations and how to build circuits out of moments. Simulate the resulting quantum circuits and find out how to perform transformations on these circuits.

Cirq | Google Quantum AI (9)

Learn how to write a quantum approximate optimization algorithm for NISQ hardware by writing a variational algorithm to optimize a solution to max-cut, which is a hard problem for classical computing.

Learn the basics of Cirq, from gates to operations to circuits to simulation. This is the best starting point for those who know the basics of quantum computing. See tutorial Cirq users have coded up a zoo of textbook quantum algorithms. These give you an idea of good patterns to follow in your own code and are useful when you are learning these algorithms. See list of algorithms

The Quantum Virtual Machine gives you the opportunity to run circuits on simulated hardware, which mocks the circuit constraints and noise behavior present in existing quantum hardware devices.

Run a simple circuit with the QVM Learn how the QVM works

See how to implement a Quantum Approximate Optimization Algorithm on real hardware. See tutorial

We are dedicated to cultivating an open and inclusive community to build software for near term quantum computers, and we welcome contributions from the community.

Cirq | Google Quantum AI (14)

Cirq | Google Quantum AI (15)

We host virtual open source meetings every week. Join our email lists to get invited to the ongoing open source meetings relevant to your work.

Subscribe: cirq-dev

Subscribe: openfermion-dev

Subscribe: tfq-dev

Subscribe: qsim-qsimh-dev

Cirq | Google Quantum AI (16)

Whether you are a researcher who wants to push the boundaries of what's available for NISQ computers, a software engineer, a technical writer, or a student who is excited about quantum computing, we welcome your contributions to our open source code available on GitHub.

If you are looking for something to help out in Cirq, see the list of good first issues to get started.

For larger features, check out our RFC process to learn how to contribute.

Learn more

Cirq | Google Quantum AI (17)

We’re looking for talented people to join our team to push the state of the art in quantum computing.

Join us

Cirq | Google Quantum AI (18)

Cirq  |  Google Quantum AI (2024)
Top Articles
Latest Posts
Article information

Author: Edwin Metz

Last Updated:

Views: 6178

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Edwin Metz

Birthday: 1997-04-16

Address: 51593 Leanne Light, Kuphalmouth, DE 50012-5183

Phone: +639107620957

Job: Corporate Banking Technician

Hobby: Reading, scrapbook, role-playing games, Fishing, Fishing, Scuba diving, Beekeeping

Introduction: My name is Edwin Metz, I am a fair, energetic, helpful, brave, outstanding, nice, helpful person who loves writing and wants to share my knowledge and understanding with you.