Python package for writing, manipulating, and running quantum circuits on quantum computers and simulators.
Features – Installation – Quick Start – Documentation – Integrations – Community – Citing Cirq – Contact
Cirq provides useful abstractions for dealing with today’s noisy intermediate-scale quantum (NISQ) computers, where the details of quantum hardware are vital to achieving state-of-the-art results. Some of its features include:
Cirq supports Python version 3.10 and later, and can be used on Linux, MacOS, and Windows, as well as Google Colab. For complete installation instructions, please refer to the Install section of the online Cirq documentation.
Here is a simple example to get you up and running with Cirq after you have installed it. Start a Python interpreter, and then type the following:
import cirq
# Pick a qubit.
qubit = cirq.GridQubit(0, 0)
# Create a circuit.
circuit = 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)
Python should then print output similar to this:
Circuit:
(0, 0): ───X^0.5───M('m')───
Results:
m=11000111111011001000
Congratulations! You have run your first quantum simulation in Cirq. You can continue to learn more by exploring the many Cirq tutorials described below.
The primary documentation site for Cirq is the Cirq home page on the Quantum AI website. There and elsewhere, a variety of documentation for Cirq is available.
pip install cirq
.pip install --upgrade cirq~=1.0.dev
.Google Quantum AI has a suite of open-source software that lets you do more with Cirq. From high-performance simulators, to novel tools for expressing and analyzing fault-tolerant quantum algorithms, our software stack lets you develop quantum programs for a variety of applications.
Your interests | Software to explore |
---|---|
Quantum algorithms? Fault-tolerant quantum computing (FTQC)? |
Qualtran |
Large circuits and/or a lot of simulations? | qsim |
Circuits with thousands of qubits and millions of Clifford operations? | Stim |
Quantum error correction (QEC)? | Stim |
Chemistry and/or material science? |
OpenFermion OpenFermion-FQE OpenFermion-PySCF OpenFermion-Psi4 |
Quantum machine learning (QML)? | TensorFlow Quantum |
Real experiments using Cirq? | ReCirq |
Cirq has benefited from contributions by over 200 people and counting. We are dedicated to cultivating an open and inclusive community to build software for quantum computers, and have a community code of conduct.
Stay on top of Cirq developments using the approach that best suits your needs:
cirq-announce
.Cirq releases take place approximately every quarter.
cirq
. You can also search past
questions using that tag – it's a great way to learn!When publishing articles or otherwise writing about Cirq, please cite the Cirq version you use – it will help others reproduce your results. We use Zenodo to preserve releases. The following links let you download the bibliographic record for the latest stable release of Cirq in some popular formats:
For formatted citations and records in other formats, as well as records for all releases of Cirq past and present, please visit the Cirq page on Zenodo.
For any questions or concerns not addressed here, please email quantum-oss-maintainers@google.com.
Cirq is not an official Google product. Copyright 2019 The Cirq Developers.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )