- Cirq
- Google Quantum AI
- Software
- Cirq
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)
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 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
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.
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.
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
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.
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.
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
We’re looking for talented people to join our team to push the state of the art in quantum computing.
Join us
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }] {}